typescript is a quickly evolving superset of JavaScript with active development of new features. Our paper seeks to understand how quickly these features are adopted by the developer community. Existing work in JavaSc...
详细信息
ISBN:
(纸本)9798350311846
typescript is a quickly evolving superset of JavaScript with active development of new features. Our paper seeks to understand how quickly these features are adopted by the developer community. Existing work in JavaScript shows the adoption of dynamic language features can be a major hindrance to static analysis. As typescript evolves the addition of features makes the underlying standard more and more difficult to keep up with. In our work we present an analysis of 454 open source typescript repositories and study the adoption of 13 language features over the past three years. We show that while new versions of the typescript compiler are aggressively adopted by the community, the same cannot be said for language features. While some experience strong growth others are rarely adopted by projects. Our work serves as a starting point for future study of the adoption of features in typescript. We also release our analysis and data gathering software as open source in the hope it helps the programming languages community.
Many RDF devtools exist for JavaScript that let developers read and modify RDF data, but they often opt to use proprietary interfaces and don't fully leverage themethods of reading and writing datawith which JavaS...
详细信息
ISBN:
(数字)9783031472435
ISBN:
(纸本)9783031472428;9783031472435
Many RDF devtools exist for JavaScript that let developers read and modify RDF data, but they often opt to use proprietary interfaces and don't fully leverage themethods of reading and writing datawith which JavaScript developers are familiar. This paper introduces Linked Data Objects (LDO), a JavaScript-based devtool designed tomake reading and writing RDF as similar to programming traditional typescript applications as possible. LDO generates typescript typings and a JSON-LD context from an RDF Shape like ShEx. A JavaScript Proxy uses the generated code to serve as an abstracted interface for an underlying RDF/JS dataset, allowing the developer to manipulate RDF as a typescript object literal. LDO is currently in use in a small number of RDF-based projects and our user studies indicate that LDO's interface-parity with typescript object literals is preferable to proprietary interfaces in other JavaScript RDF devtools. Finally, this paper proposes future work to make LDO even more approachable for JavaScript developers.
JavaScript (JS) is one of the most popular programming languages, and widely used for web apps, mobile apps, desktop clients, and even backend development. Due to its dynamic and flexible nature, however, JS applicati...
详细信息
ISBN:
(纸本)9781450393034
JavaScript (JS) is one of the most popular programming languages, and widely used for web apps, mobile apps, desktop clients, and even backend development. Due to its dynamic and flexible nature, however, JS applications often have a reputation for poor software quality. While the type-safe superset typescript (TS) offers features to address these prejudices, there is currently insufficient empirical evidence to broadly support the claim that TS applications exhibit better software quality than JS applications. We therefore conducted a repository mining study based on 604 GitHub projects (299 for JS, 305 for TS) with over 16M LoC. Using SonarQube and the GitHub API, we collected and analyzed four facets of software quality: a) code quality (# of code smells per LoC), b) code understandability (cognitive complexity per LoC), c) bug proneness (bug fix commit ratio), and d) bug resolution time (mean time a bug issue is open). For TS, we also collected how frequently the type-safety ignoring any type was used per project via ESLint. The analysis indicates that TS applications exhibit significantly better code quality and understandability than JS applications. Contrary to expectations, however, bug proneness and bug resolution time of our TS sample were not significantly lower than for JS: the mean bug fix commit ratio of TS projects was more than 60% larger (0.126 vs. 0.206), and TS projects needed on average more than an additional day to fix bugs (31.86 vs. 33.04 days). Furthermore, reducing the usage of the any type in TS apps appears to be beneficial: its frequency was significantly correlated with all metrics except bug proneness, even though the correlations were of small strengths (Spearman's rho between 0.17 and 0.26). Our results indicate that the perceived positive influence of Type-Script for avoiding bugs in comparison to JavaScript may be more complicated than assumed. While using TS seems to have benefits, it does not automatically lead to less and easier
In this paper, We present ManyTypes4typescript, a very large corpus for training and evaluating machine-learning models for sequence-based type inference in typescript. The dataset includes over 9 million type annotat...
详细信息
ISBN:
(纸本)9781450393034
In this paper, We present ManyTypes4typescript, a very large corpus for training and evaluating machine-learning models for sequence-based type inference in typescript. The dataset includes over 9 million type annotations, across 13,953 projects and 539,571 files. The dataset is approximately 10x larger than analogous type inference datasets for Python, and is the largest available for typescript. We also provide API access to the dataset, which can be integrated into any tokenizer and used with any state-of-the-art sequence-based model. Finally, we provide analysis and performance results for state-of-the-art code-specific models, for baselining. ManyTypes4typescript is available on Huggingface, Zenodo, and CodeXGLUE.
Developers are starting to write large and complex applications in typescript, a typed dialect of JavaScript. typescript applications integrate JavaScript libraries via typed descriptions of their APIs called declarat...
详细信息
ISBN:
(纸本)9781450386753
Developers are starting to write large and complex applications in typescript, a typed dialect of JavaScript. typescript applications integrate JavaScript libraries via typed descriptions of their APIs called declaration files. DefinitelyTyped is the standard public repository for these files. The repository is populated and maintained manually by volunteers, which is error-prone and time consuming. Discrepancies between a declaration file and the JavaScript implementation lead to incorrect feedback from the typescript IDE and, thus, to incorrect uses of the underlying JavaScript library. This work presents dts-generate, a tool that generates typescript declaration files for JavaScript libraries uploaded to the NPM registry. It extracts code examples from the documentation written by the developer, executes the library driven by the examples, gathers run-time information, and generates a declaration file based on this information. To evaluate the tool, 249 declaration files were generated directly from an NPM module and 111 of these were compared with the corresponding declaration file provided on DefinitelyTyped. All these files either exhibited no differences at all or differences that can be resolved by extending the developer-provided examples.
typescript is an increasingly popular open-source language that builds on JavaScript by adding optional static type definitions. Its ecosystem has many tools that require confidence in their correctness when manipulat...
详细信息
ISBN:
(纸本)9781450390620
typescript is an increasingly popular open-source language that builds on JavaScript by adding optional static type definitions. Its ecosystem has many tools that require confidence in their correctness when manipulating typescript programs. Tool developers commonly use tests for increasing confidence in a tool's implementation correctness. To test tool implementations, tool developers can manually write typescript programs to be used as test inputs, but they can miss problematic programs as there are many language features to consider. In addition, a range of those tools have properties that apply specifically to programs that compile successfully and satisfy complex constraints. We therefore present a program generation technique that allows generating successfully compiling typescript programs, that optionally also satisfy tool-specific constraints not captured by syntactic constraints alone. We evaluated our technique by generating programs in the context of five automated typescript refactoring implementation, and by running tests with the generated programs as inputs. The majority (97.45%) of the generated programs compiled without errors, and all of the generated programs could be refactored, meaning that they can indeed satisfy tool-specific constraints to be used as test inputs. We tested the refactorings using the generated programs as test inputs and we found and reported a bug in a typescript refactoring, where the refactoring introduced a compilation error to programs that previously had no errors.
typescript is a dynamically typed language widely used to develop large-scale applications nowadays. These applications are usually designed with complex class or interface hierarchies and have highly polymorphic beha...
详细信息
typescript is a dynamically typed language widely used to develop large-scale applications nowadays. These applications are usually designed with complex class or interface hierarchies and have highly polymorphic behaviors. These object-oriented (OO) features will lead to inefficient inline caches (ICs) or trigger deoptimizations, which impact the performance of typescript applications. To address this problem, we introduce an inline caching design called hidden inheritance (HI). The basic idea of HI is to cache the static information of class or interface hierarchies into hidden classes, which are leveraged to generate efficient inline caches for improving the performance of OO-style typescript programs. The HI design is implemented in a typescript engine STSC (Static typescript Compiler) including a static compiler and a runtime system. STSC statically generates hidden classes and enhanced inline caches, which are applied to generate specialized machine code via ahead-of-time compilation (AOTC) or just-in-time compilation (JITC). To evaluate the efficiency of this technique, we implement STSC on a state-of-the-art JavaScript virtual machine V8 and demonstrate its performance improvements on industrial benchmarks and applications.
While the programming of microcontroller-based embeddable devices typically is the realm of the C language, such devices are now finding their way into the classroom for CS education, even at the level of middle schoo...
详细信息
ISBN:
(纸本)9781450369770
While the programming of microcontroller-based embeddable devices typically is the realm of the C language, such devices are now finding their way into the classroom for CS education, even at the level of middle school. As a result, the use of scripting languages (such as JavaScript and Python) for microcontrollers is on the rise. We present Static typescript (STS), a subset of typescript (itself, a gradually typed superset of JavaScript), and its compiler/linker toolchain, which is implemented fully in typescript and runs in the web browser. STS is designed to be useful in practice (especially in education), while being amenable to static compilation targeting small devices. A user's STS program is compiled to machine code in the browser and linked against a precompiled C++ runtime, producing an executable that is more efficient than the prevalent embedded interpreter approach, extending battery life and making it possible to run on devices with as little as 16 kB of RAM (such as the BBC micro:bit). This paper is primarily a description of the STS system and the technical challenges of implementing embedded programming platforms in the classroom.
暂无评论