-
Privacy-Respecting Type Error Telemetry at Scale
Authors:
Ben Greenman,
Alan Jeffrey,
Shriram Krishnamurthi,
Mitesh Shah
Abstract:
Context: Roblox Studio lets millions of creators build interactive experiences by programming in a variant of Lua called Luau. The creators form a broad group, ranging from novices writing their first script to professional developers; thus, Luau must support a wide audience. As part of its efforts to support all kinds of programmers, Luau includes an optional, gradual type system and goes to grea…
▽ More
Context: Roblox Studio lets millions of creators build interactive experiences by programming in a variant of Lua called Luau. The creators form a broad group, ranging from novices writing their first script to professional developers; thus, Luau must support a wide audience. As part of its efforts to support all kinds of programmers, Luau includes an optional, gradual type system and goes to great lengths to minimize false positive errors.
Inquiry: Since Luau is currently being used by many creators, we want to collect data to improve the language and, in particular, the type system. The standard way to collect data is to deploy client-side telemetry; however, we cannot scrape personal data or proprietary information, which means we cannot collect source code fragments, error messages, or even filepaths. The research questions are thus about how to conduct telemetry that is not invasive and obtain insights from it about type errors.
Approach: We designed and implemented a pseudonymized, randomly-sampling telemetry system for Luau. Telemetry records include a timestamp, a session id, a reason for sending, and a numeric summary of the most recent type analyses. This information lets us study type errors over time without revealing private data. We deployed the system in Roblox Studio during Spring 2023 and collected over 1.5 million telemetry records from over 340,000 sessions.
Knowledge: We present several findings about Luau, all of which suggest that telemetry is an effective way to study type error pragmatics. One of the less-surprising findings is that opt-in gradual types are unpopular: there is an 100x gap between the number of untyped Luau sessions and the number of typed ones. One surprise is that the strict mode for type analysis is overly conservative about interactions with data assets. A reassuring finding is that type analysis rarely hits its internal limits on problem size.
Grounding: Our findings are supported by a dataset of over 1.5 million telemetry records. The data and scripts for analyzing it are available in an artifact.
Importance: Beyond the immediate benefits to Luau, our findings about types and type errors have implications for adoption and ergonomics in other gradual languages such as TypeScript, Elixir, and Typed Racket. Our telemetry design is of broad interest, as it reports on type errors without revealing sensitive information.
△ Less
Submitted 4 March, 2024;
originally announced March 2024.
-
Profiling Programming Language Learning
Authors:
Will Crichton,
Shriram Krishnamurthi
Abstract:
This paper documents a year-long experiment to "profile" the process of learning a programming language: gathering data to understand what makes a language hard to learn, and using that data to improve the learning process. We added interactive quizzes to The Rust Programming Language, the official textbook for learning Rust. Over 13 months, 62,526 readers answered questions 1,140,202 times. First…
▽ More
This paper documents a year-long experiment to "profile" the process of learning a programming language: gathering data to understand what makes a language hard to learn, and using that data to improve the learning process. We added interactive quizzes to The Rust Programming Language, the official textbook for learning Rust. Over 13 months, 62,526 readers answered questions 1,140,202 times. First, we analyze the trajectories of readers. We find that many readers drop-out of the book early when faced with difficult language concepts like Rust's ownership types. Second, we use classical test theory and item response theory to analyze the characteristics of quiz questions. We find that better questions are more conceptual in nature, such as asking why a program does not compile vs. whether a program compiles. Third, we performed 12 interventions into the book to help readers with difficult questions. We find that on average, interventions improved quiz scores on the targeted questions by +20%. Fourth, we show that our technique can likely generalize to languages with smaller user bases by simulating our statistical inferences on small N. These results demonstrate that quizzes are a simple and useful technique for understanding language learning at all scales.
△ Less
Submitted 2 January, 2024;
originally announced January 2024.
-
Conceptual Mutation Testing for Student Programming Misconceptions
Authors:
Siddhartha Prasad,
Ben Greenman,
Tim Nelson,
Shriram Krishnamurthi
Abstract:
Context: Students often misunderstand programming problem descriptions. This can lead them to solve the wrong problem, which creates frustration, obstructs learning, and imperils grades. Researchers have found that students can be made to better understand the problem by writing examples before they start programming. These examples are checked against correct and wrong implementations -- analogou…
▽ More
Context: Students often misunderstand programming problem descriptions. This can lead them to solve the wrong problem, which creates frustration, obstructs learning, and imperils grades. Researchers have found that students can be made to better understand the problem by writing examples before they start programming. These examples are checked against correct and wrong implementations -- analogous to mutation testing -- provided by course staff. Doing so results in better student understanding of the problem as well as better test suites to accompany the program, both of which are desirable educational outcomes.
Inquiry: Producing mutant implementations requires care. If there are too many, or they are too obscure, students will end up spending a lot of time on an unproductive task and also become frustrated. Instead, we want a small number of mutants that each correspond to common problem misconceptions. This paper presents a workflow with partial automation to produce mutants of this form which, notably, are not those produced by mutation-testing tools.
Approach: We comb through student tests that fail a correct implementation. The student misconceptions are embedded in these failures. We then use methods to semantically cluster these failures. These clusters are then translated into conceptual mutants. These can then be run against student data to determine whether we they are better than prior methods. Some of these processes also enjoy automation.
Knowledge: We find that student misconceptions illustrated by failing tests can be operationalized by the above process. The resulting mutants do much better at identifying student misconceptions.
Grounding: Our findings are grounded in a manual analysis of student examples and a quantitative evaluation of both our clustering techniques and our process for making conceptual mutants. The clustering evaluation compares against a ground truth using standard cluster-correspondence measures, while the mutant evaluation examines how conceptual mutants perform against student data.
Importance: Our work contributes a workflow, with some automation, to reduce the cost and increase the effectiveness of generating conceptually interesting mutants. Such mutants can both improve learning outcomes and reduce student frustration, leading to better educational outcomes. In the process, we also identify a variation of mutation testing not commonly discussed in the software literature.
△ Less
Submitted 28 December, 2023;
originally announced January 2024.
-
A Core Calculus for Documents
Authors:
Will Crichton,
Shriram Krishnamurthi
Abstract:
Passive documents and active programs now widely comingle. Document languages include Turing-complete programming elements, and programming languages include sophisticated document notations. However, there are no formal foundations that model these languages. This matters because the interaction between document and program can be subtle and error-prone. In this paper we describe several such pro…
▽ More
Passive documents and active programs now widely comingle. Document languages include Turing-complete programming elements, and programming languages include sophisticated document notations. However, there are no formal foundations that model these languages. This matters because the interaction between document and program can be subtle and error-prone. In this paper we describe several such problems, then taxonomize and formalize document languages as levels of a document calculus. We employ the calculus as a foundation for implementing complex features such as reactivity, as well as for proving theorems about the boundary of content and computation. We intend for the document calculus to provide a theoretical basis for new document languages, and to assist designers in cleaning up the unsavory corners of existing languages.
△ Less
Submitted 14 November, 2023; v1 submitted 6 October, 2023;
originally announced October 2023.
-
A Grounded Conceptual Model for Ownership Types in Rust
Authors:
Will Crichton,
Gavin Gray,
Shriram Krishnamurthi
Abstract:
Programmers learning Rust struggle to understand ownership types, Rust's core mechanism for ensuring memory safety without garbage collection. This paper describes our attempt to systematically design a pedagogy for ownership types. First, we studied Rust developers' misconceptions of ownership to create the Ownership Inventory, a new instrument for measuring a person's knowledge of ownership. We…
▽ More
Programmers learning Rust struggle to understand ownership types, Rust's core mechanism for ensuring memory safety without garbage collection. This paper describes our attempt to systematically design a pedagogy for ownership types. First, we studied Rust developers' misconceptions of ownership to create the Ownership Inventory, a new instrument for measuring a person's knowledge of ownership. We found that Rust learners could not connect Rust's static and dynamic semantics, such as determining why an ill-typed program would (or would not) exhibit undefined behavior. Second, we created a conceptual model of Rust's semantics that explains borrow checking in terms of flow-sensitive permissions on paths into memory. Third, we implemented a Rust compiler plugin that visualizes programs under the model. Fourth, we integrated the permissions model and visualizations into a broader pedagogy of ownership by writing a new ownership chapter for The Rust Programming Language, a popular Rust textbook. Fifth, we evaluated an initial deployment of our pedagogy against the original version, using reader responses to the Ownership Inventory as a point of comparison. Thus far, the new pedagogy has improved learner scores on the Ownership Inventory by an average of 9% ($N = 342, d = 0.56$).
△ Less
Submitted 8 September, 2023;
originally announced September 2023.
-
Dependently Ty** R Vectors, Arrays, and Matrices
Authors:
John Wrenn,
Anjali Pal,
Alexa VanHattum,
Shriram Krishnamurthi
Abstract:
The R programming language is widely used in large-scale data analyses. It contains especially rich built-in support for dealing with vectors, arrays, and matrices. These operations feature prominently in the applications that form R's raison d'ĂȘtre, making their behavior worth understanding. Furthermore, ostensibly for programmer convenience, their behavior in R is a notable extension over the co…
▽ More
The R programming language is widely used in large-scale data analyses. It contains especially rich built-in support for dealing with vectors, arrays, and matrices. These operations feature prominently in the applications that form R's raison d'ĂȘtre, making their behavior worth understanding. Furthermore, ostensibly for programmer convenience, their behavior in R is a notable extension over the corresponding operations in mathematics, thereby offering some challenges for specification and static verification.
We report on progress towards statically ty** this aspect of the R language. The interesting aspects of ty**, in this case, warn programmers about violating bounds, so the types must necessarily be dependent. We explain the ways in which R extends standard mathematical behavior. We then show how R's behavior can be specified in LiquidHaskell, a dependently-typed extension to Haskell. In the general case, actually verifying library and client code is currently beyond LiquidHaskell's reach; therefore, this work provides challenges and opportunities both for ty** R and for progress in dependently-typed programming languages.
△ Less
Submitted 9 April, 2023;
originally announced April 2023.
-
Little Tricky Logic: Misconceptions in the Understanding of LTL
Authors:
Ben Greenman,
Sam Saarinen,
Tim Nelson,
Shriram Krishnamurthi
Abstract:
Context: Linear Temporal Logic (LTL) has been used widely in verification. Its importance and popularity have only grown with the revival of temporal logic synthesis, and with new uses of LTL in robotics and planning activities. All these uses demand that the user have a clear understanding of what an LTL specification means.
Inquiry: Despite the growing use of LTL, no studies have investigated…
▽ More
Context: Linear Temporal Logic (LTL) has been used widely in verification. Its importance and popularity have only grown with the revival of temporal logic synthesis, and with new uses of LTL in robotics and planning activities. All these uses demand that the user have a clear understanding of what an LTL specification means.
Inquiry: Despite the growing use of LTL, no studies have investigated the misconceptions users actually have in understanding LTL formulas. This paper addresses the gap with a first study of LTL misconceptions.
Approach: We study researchers' and learners' understanding of LTL in four rounds (three written surveys, one talk-aloud) spread across a two-year timeframe. Concretely, we decompose "understanding LTL" into three questions. A person reading a spec needs to understand what it is saying, so we study the map** from LTL to English. A person writing a spec needs to go in the other direction, so we study English to LTL. However, misconceptions could arise from two sources: a misunderstanding of LTL's syntax or of its underlying semantics. Therefore, we also study the relationship between formulas and specific traces.
Knowledge: We find several misconceptions that have consequences for learners, tool builders, and designers of new property languages. These findings are already resulting in changes to the Alloy modeling language. We also find that the English to LTL direction was the most common source of errors; unfortunately, this is the critical "authoring" direction in which a subtle mistake can lead to a faulty system. We contribute study instruments that are useful for training learners (whether academic or industrial) who are getting acquainted with LTL, and we provide a code book to assist in the analysis of responses to similar-style questions.
Grounding: Our findings are grounded in the responses to our survey rounds. Round 1 used Quizius to identify misconceptions among learners in a way that reduces the threat of expert blind spots. Rounds 2 and 3 confirm that both additional learners and researchers (who work in formal methods, robotics, and related fields) make similar errors. Round 4 adds deep support for our misconceptions via talk-aloud surveys.
Importance This work provides useful answers to two critical but unexplored questions: in what ways is LTL tricky and what can be done about it? Our survey instruments can serve as a starting point for other studies.
△ Less
Submitted 3 November, 2022;
originally announced November 2022.
-
Gradual Soundness: Lessons from Static Python
Authors:
Kuang-Chen Lu,
Ben Greenman,
Carl Meyer,
Dino Viehland,
Aniket Panse,
Shriram Krishnamurthi
Abstract:
Context: Gradually-typed languages allow typed and untyped code to interoperate, but typically come with significant drawbacks. In some languages, the types are unreliable; in others, communication across type boundaries can be extremely expensive; and still others allow only limited forms of interoperability. The research community is actively seeking a sound, fast, and expressive approach to gra…
▽ More
Context: Gradually-typed languages allow typed and untyped code to interoperate, but typically come with significant drawbacks. In some languages, the types are unreliable; in others, communication across type boundaries can be extremely expensive; and still others allow only limited forms of interoperability. The research community is actively seeking a sound, fast, and expressive approach to gradual ty**.
Inquiry: This paper describes Static Python, a language developed by engineers at Instagram that has proven itself sound, fast, and reasonably expressive in production. Static Python's approach to gradual types is essentially a programmer-tunable combination of the concrete and transient approaches from the literature. Concrete types provide full soundness and low performance overhead, but impose nonlocal constraints. Transient types are sound in a shallow sense and easier to use; they help to bridge the gap between untyped code and typed concrete code.
Approach: We evaluate the language in its current state and develop a model that captures the essence of its approach to gradual types. We draw upon personal communication, bug reports, and the Static Python regression test suite to develop this model.
Knowledge: Our main finding is that the gradual soundness that arises from a mix of concrete and transient types is an effective way to lower the maintenance cost of the concrete approach. We also find that method-based JIT technology can eliminate the costs of the transient approach. On a more technical level, this paper describes two contributions: a model of Static Python and a performance evaluation of Static Python. The process of formalization found several errors in the implementation, including fatal errors.
Grounding: Our model of Static Python is implemented in PLT Redex and tested using property-based soundness tests and 265 tests from the Static Python regression suite. This paper includes a small core of the model to convey the main ideas of the Static Python approach and its soundness. Our performance claims are based on production experience in the Instagram web server. Migrations to Static Python in the server have caused a 3.7\% increase in requests handled per second at maximum CPU load.
Importance: Static Python is the first sound gradual language whose piece-meal application to a realistic codebase has consistently improved performance. Other language designers may wish to replicate its approach, especially those who currently maintain unsound gradual languages and are seeking a path to soundness.
△ Less
Submitted 28 June, 2022;
originally announced June 2022.
-
Evidence of Spin Frustration in Vanadium Diselenide Monolayer Magnet
Authors:
** Kwan Johnny Wong,
Wen Zhang,
Fabio Bussolotti,
Xinmao Yin,
Tun Seng Herng,
Lei Zhang,
Yu Li Huang,
Giovanni Vinai,
Sridevi Krishnamurthi,
Danil W Bukhvalov,
Yu Jie Zheng,
Rebekah Chua,
Alpha T N Diaye,
Simon A. Morton,
Chao-Yao Yang,
Kui-Hon Ou Yang,
Piero Torelli,
Wei Chen,
Kuan Eng Johnson Goh,
Jun Ding,
Minn-Tsong Lin,
Geert Brocks,
Michel P de Jong,
Antonio H Castro Neto,
Andrew Thye Shen Wee
Abstract:
Monolayer VSe2, featuring both charge density wave and magnetism phenomena, represents a unique van der Waals magnet in the family of metallic two-dimensional transition-metal dichalcogenides (2D-TMDs). Herein, by means of in-situ microscopic and spectroscopic techniques, including scanning tunneling microscopy/spectroscopy, synchrotron X-ray and angle-resolved photoemission, and X-ray absorption,…
▽ More
Monolayer VSe2, featuring both charge density wave and magnetism phenomena, represents a unique van der Waals magnet in the family of metallic two-dimensional transition-metal dichalcogenides (2D-TMDs). Herein, by means of in-situ microscopic and spectroscopic techniques, including scanning tunneling microscopy/spectroscopy, synchrotron X-ray and angle-resolved photoemission, and X-ray absorption, direct spectroscopic signatures are established, that identify the metallic 1T-phase and vanadium 3d1 electronic configuration in monolayer VSe2 grown on graphite by molecular-beam epitaxy. Element-specific X-ray magnetic circular dichroism, complemented with magnetic susceptibility measurements, further reveals monolayer VSe2 as a frustrated magnet, with its spins exhibiting subtle correlations, albeit in the absence of a long-range magnetic order down to 2 K and up to a 7 T magnetic field. This observation is attributed to the relative stability of the ferromagnetic and antiferromagnetic ground states, arising from its atomic-scale structural features, such as rotational disorders and edges. The results of this study extend the current understanding of metallic 2D-TMDs in the search for exotic low-dimensional quantum phenomena, and stimulate further theoretical and experimental studies on van der Waals monolayer magnets.
△ Less
Submitted 6 June, 2022;
originally announced June 2022.
-
Automated, Targeted Testing of Property-Based Testing Predicates
Authors:
Tim Nelson,
Elijah Rivera,
Sam Soucie,
Thomas Del Vecchio,
John Wrenn,
Shriram Krishnamurthi
Abstract:
Context: This work is based on property-based testing (PBT). PBT is an increasingly important form of software testing. Furthermore, it serves as a concrete gateway into the abstract area of formal methods. Specifically, we focus on students learning PBT methods.
Inquiry: How well do students do at PBT? Our goal is to assess the quality of the predicates they write as part of PBT. Prior work int…
▽ More
Context: This work is based on property-based testing (PBT). PBT is an increasingly important form of software testing. Furthermore, it serves as a concrete gateway into the abstract area of formal methods. Specifically, we focus on students learning PBT methods.
Inquiry: How well do students do at PBT? Our goal is to assess the quality of the predicates they write as part of PBT. Prior work introduced the idea of decomposing the predicate's property into a conjunction of independent subproperties. Testing the predicate against each subproperty gives a "semantic" understanding of their performance.
Approach: The notion of independence of subproperties both seems intuitive and was an important condition in prior work. First, we show that this condition is overly restrictive and might hide valuable information: it both undercounts errors and makes it hard to capture misconceptions. Second, we introduce two forms of automation, one based on PBT tools and the other on SAT-solving, to enable testing of student predicates. Third, we compare the output of these automated tools against manually-constructed tests. Fourth, we also measure the performance of those tools. Finally, we re-assess student performance reported in prior work.
Knowledge: We show the difficulty caused by the independent subproperty requirement. We provide insight into how to use automation effectively to assess PBT predicates. In particular, we discuss the steps we had to take to beat human performance. We also provide insight into how to make the automation work efficiently. Finally, we present a much richer account than prior work of how students did.
Grounding: Our methods are grounded in mathematical logic. We also make use of well-understood principles of test generation from more formal specifications. This combination ensures the soundness of our work. We use standard methods to measure performance.
Importance: As both educators and programmers, we believe PBT is a valuable tool for students to learn, and its importance will only grow as more developers appreciate its value. Effective teaching requires a clear understanding of student knowledge and progress. Our methods enable a rich and automated analysis of student performance on PBT that yields insight into their understanding and can capture misconceptions. We therefore expect these results to be valuable to educators.
△ Less
Submitted 19 November, 2021;
originally announced November 2021.
-
Types for Tables: A Language Design Benchmark
Authors:
Kuang-Chen Lu,
Ben Greenman,
Shriram Krishnamurthi
Abstract:
Context: Tables are ubiquitous formats for data. Therefore, techniques for writing correct programs over tables, and debugging incorrect ones, are vital. Our specific focus in this paper is on rich types that articulate the properties of tabular operations. We wish to study both their expressive power and _diagnostic quality_.
Inquiry: There is no "standard library" of table operations. As a res…
▽ More
Context: Tables are ubiquitous formats for data. Therefore, techniques for writing correct programs over tables, and debugging incorrect ones, are vital. Our specific focus in this paper is on rich types that articulate the properties of tabular operations. We wish to study both their expressive power and _diagnostic quality_.
Inquiry: There is no "standard library" of table operations. As a result, every paper (and project) is free to use its own (sub)set of operations. This makes artifacts very difficult to compare, and it can be hard to tell whether omitted operations were left out by oversight or because they cannot actually be expressed. Furthermore, virtually no papers discuss the quality of type error feedback.
Approach: We combed through several existing languages and libraries to create a "standard library" of table operations. Each entry is accompanied by a detailed specification of its "type," expressed independent of (and hence not constrained by) any type language. We also studied and categorized a corpus of (student) program edits that resulted in table-related errors. We used this to generate a suite of erroneous programs. Finally, we adapted the concept of a datasheet to facilitate comparisons of different implementations.
Knowledge: Our benchmark creates a common ground to frame work in this area. Language designers who claim to support typed programming over tables have a clear suite against which to demonstrate their system's expressive power. Our family of errors also gives them a chance to demonstrate the quality of feedback. Researchers who improve one aspect -- especially error reporting -- without changing the other can demonstrate their improvement, as can those who engage in trade-offs between the two. The net result should be much better science in both expressiveness and diagnostics. We also introduce a datasheet format for presenting this knowledge in a methodical way.
Grounding: We have generated our benchmark from real languages, libraries, and programs, as well as personal experience conducting and teaching data science. We have drawn on experience in engineering and, more recently, in data science to generate the datasheet.
Importance: Claims about type support for tabular programming are hard to evaluate. However, tabular programming is ubiquitous, and the expressive power of type systems keeps growing. Our benchmark and datasheet can help lead to more orderly science. It also benefits programmers trying to choose a language.
△ Less
Submitted 19 November, 2021;
originally announced November 2021.
-
Computing and Authentication Practices in Global Oil and Gas Fields
Authors:
Mary Rose Martinez,
Shriram Krishnamurthi
Abstract:
Oil and gas fields are a critical part of our infrastructure, and vulnerable to attack by powerful adversaries. In addition, these are often difficult work environments, with constraints on space, clothing, and more. Yet there is little research on the technology practices and constraints of workers in these environments. We present what we believe is the first survey of oil- and gas-field workers…
▽ More
Oil and gas fields are a critical part of our infrastructure, and vulnerable to attack by powerful adversaries. In addition, these are often difficult work environments, with constraints on space, clothing, and more. Yet there is little research on the technology practices and constraints of workers in these environments. We present what we believe is the first survey of oil- and gas-field workers located around the world. We establish the presence and status of a variety of computing devices and of the security practices that govern their use. We also determine the working conditions (such as personal protective equipment) under which these devices are used, which impacts usable security aspects like feasible forms of authentication. We extend these basic insights with additional information from a small number of in-depth interviews. Our preliminary work suggests many directions for improving security in this critical sector.
△ Less
Submitted 5 August, 2021;
originally announced August 2021.
-
Using Relational Problems to Teach Property-Based Testing
Authors:
John Wrenn,
Tim Nelson,
Shriram Krishnamurthi
Abstract:
Context: The success of QuickCheck has led to the development of property-based testing (PBT) libraries for many languages and the process is getting increasing attention. However, unlike regular testing, PBT is not widespread in collegiate curricula. Furthermore, the value of PBT is not limited to software testing. The growing use of formal methods in, and the growth of software synthesis, all cr…
▽ More
Context: The success of QuickCheck has led to the development of property-based testing (PBT) libraries for many languages and the process is getting increasing attention. However, unlike regular testing, PBT is not widespread in collegiate curricula. Furthermore, the value of PBT is not limited to software testing. The growing use of formal methods in, and the growth of software synthesis, all create demand for techniques to train students and developers in the art of specification writing. We posit that PBT forms a strong bridge between testing and the act of specification: it's a form of testing where the tester is actually writing abstract specifications.
Inquiry: Even well-informed technologists mention the difficulty of finding good motivating examples for its use. We take steps to fill this lacuna.
Approach & Knowledge: We find that the use of "relational" problems -- those for which an input may admit multiple valid outputs -- easily motivates the use of PBT. We also notice that such problems are readily available in the computer science pantheon of problems (e.g., many graph and sorting algorithms). We have been using these for some years now to teach PBT in collegiate courses.
Grounding: In this paper, we describe the problems we use and report on students? completion of them. We believe the problems overcome some of the motivation issues described above. We also show that students can do quite well at PBT for these problems, suggesting that the topic is well within their reach. In the process, we introduce a simple method to evaluate the accuracy of their specifications, and use it to characterize their common mistakes.
Importance: Based on our findings, we believe that relational problems are an underutilized motivating example for PBT. We hope this paper initiates a catalog of such problems for educators (and developers) to use, and also provides a concrete (though by no means exclusive) method to analyze the quality of PBT.
△ Less
Submitted 30 October, 2020;
originally announced October 2020.
-
1D metallic states at 2D transition metal dichalcogenide semiconductor heterojunctions
Authors:
Sridevi Krishnamurthi,
Geert Brocks
Abstract:
Two-dimensional (2D) lateral heterojunctions of transition metal dichalcogenides (TMDCs) have become a reality in recent years. Semiconducting TMDC layers in their common H -structure have a nonzero in-plane electric polarization, which is a topological invariant. We show by means of first-principles calculations that lateral 2D heterojunctions between TMDCs with a different polarization generate…
▽ More
Two-dimensional (2D) lateral heterojunctions of transition metal dichalcogenides (TMDCs) have become a reality in recent years. Semiconducting TMDC layers in their common H -structure have a nonzero in-plane electric polarization, which is a topological invariant. We show by means of first-principles calculations that lateral 2D heterojunctions between TMDCs with a different polarization generate one-dimensional (1D) metallic states at the junction, even in cases where the different materials are joined epitaxially. The metallicity does not depend upon structural details, and is explained from the change in topological invariant at the junction. Nevertheless, these 1D metals are susceptible to 1D instabilities, such as charge- and spin-density waves, making 2D TMDC heterojunctions ideal systems for studying 1D physics.
△ Less
Submitted 15 August, 2020;
originally announced August 2020.
-
One-dimensional electronic instabilities at the edges of $MoS_2$
Authors:
Sridevi Krishnamurthi,
Mojtaba Farmanbar,
Geert Brocks
Abstract:
The one-dimensional metallic states that appear at the zigzag edges of semiconducting two-dimensional transition metal di-chalcogenides (TMDCs) result from the intrinsic electric polarization in these materials, which for D$_{3h}$ symmetry is a topological invariant. These 1D states are susceptible to electronic and structural perturbations that triple the period along the edge. In this paper we s…
▽ More
The one-dimensional metallic states that appear at the zigzag edges of semiconducting two-dimensional transition metal di-chalcogenides (TMDCs) result from the intrinsic electric polarization in these materials, which for D$_{3h}$ symmetry is a topological invariant. These 1D states are susceptible to electronic and structural perturbations that triple the period along the edge. In this paper we study possible spin density waves (SDWs) and charge-density waves (CDWs) at the zigzag edges of {\MS}, using first-principles density functional theory calculations. Depending on the detailed structures and termination of the edges, we observe either combined SDW/CDWs or pure CDWs, along with structural distortions. In all cases the driving force is the opening of a band gap at the edge. The analysis should hold for all group VI TMDCs with the same basic structure as $MoS_2$.
△ Less
Submitted 31 July, 2020; v1 submitted 30 July, 2020;
originally announced July 2020.
-
The Sign of Three: Spin/Charge Density Waves at the Boundaries of Transition Metal Dichalcogenides
Authors:
Sridevi Krishnamurthi,
Geert Brocks
Abstract:
One-dimensional grain boundaries of two-dimensional semiconducting {\MX} (M= Mo,W; X=S,Se) transition metal di-chalcogenides are typically metallic at room temperature. The metallicity has its origin in the lattice polarization, which for these lattices with $D_{3h}$ symmetry is a topological invariant, and leads to one-dimenional boundary states inside the band gap. For boundaries perpendicular t…
▽ More
One-dimensional grain boundaries of two-dimensional semiconducting {\MX} (M= Mo,W; X=S,Se) transition metal di-chalcogenides are typically metallic at room temperature. The metallicity has its origin in the lattice polarization, which for these lattices with $D_{3h}$ symmetry is a topological invariant, and leads to one-dimenional boundary states inside the band gap. For boundaries perpendicular to the polarization direction, these states are necessarily 1/3 occupied by electrons or holes, making them susceptible to a metal-insulator transition that triples the translation period. Using density-functional-theory calculations we demonstrate the emergence of combined one-dimensional spin density/charge density waves of that period at the boundary, opening up a small band gap of $\sim 0.1$ eV. This unique electronic structure allows for soliton excitations at the boundary that carry a fractional charge of $\pm 1/3\ e$.
△ Less
Submitted 5 May, 2020;
originally announced May 2020.
-
Data Science as a Route to AI for Middle- and High-School Students
Authors:
Shriram Krishnamurthi,
Emmanuel Schanzer,
Joe Gibbs Politz,
Benjamin S. Lerner,
Kathi Fisler,
Sam Dooman
Abstract:
The Bootstrap Project's Data Science curriculum has trained about 100 teachers who are using it around the country. It is specifically designed to aid adoption at a wide range of institutions. It emphasizes valuable curricular goals by drawing on both the education literature and on prior experience with other computing outreach projects. It embraces "three P's" of data-oriented thinking: the prom…
▽ More
The Bootstrap Project's Data Science curriculum has trained about 100 teachers who are using it around the country. It is specifically designed to aid adoption at a wide range of institutions. It emphasizes valuable curricular goals by drawing on both the education literature and on prior experience with other computing outreach projects. It embraces "three P's" of data-oriented thinking: the promise, pitfalls, and perils. This paper briefly describes the curriculum's design, content, and outcomes, and explains its value on the road to AI curricula.
△ Less
Submitted 30 April, 2020;
originally announced May 2020.
-
Event Loops as First-Class Values: A Case Study in Pedagogic Language Design
Authors:
Joe Politz,
Benjamin Lerner,
Sorawee Porncharoenwase,
Shriram Krishnamurthi
Abstract:
The World model is an existing functional input-output mechanism for event-driven programming. It is used in numerous popular textbooks and curricular settings. The World model conflates two different tasks -- the definition of an event processor and its execution -- into one. This conflation imposes a significant (even unacceptable) burden on student users in several educational settings where we…
▽ More
The World model is an existing functional input-output mechanism for event-driven programming. It is used in numerous popular textbooks and curricular settings. The World model conflates two different tasks -- the definition of an event processor and its execution -- into one. This conflation imposes a significant (even unacceptable) burden on student users in several educational settings where we have tried to use it, e.g., for teaching physics. While it was tempting to pile on features to address these issues, we instead used the Scheme language design dictum of removing weaknesses that made them seem necessary. By separating the two tasks above, we arrived at a slightly different primitive, the reactor, as our basis. This only defines the event processor, and a variety of execution operators dictate how it runs. The new design enables programmatic control over event-driven programs. This simplifies reflecting on program behavior, and eliminates many unnecessary curricular dependencies imposed by the old design. This work has been implemented in the Pyret programming language. The separation of concerns has enabled new curricula, such as the Bootstrap:Physics curriculum, to take flight. Thousands of students use this new mechanism every year. We believe that reducing impedance mismatches improves their educational experience.
△ Less
Submitted 2 February, 2019;
originally announced February 2019.
-
Putting in All the Stops: Execution Control for JavaScript
Authors:
Samuel Baxter,
Rachit Nigam,
Joe Gibbs Politz,
Shriram Krishnamurthi,
Arjun Guha
Abstract:
Scores of compilers produce JavaScript, enabling programmers to use many languages on the Web, reuse existing code, and even use Web IDEs. Unfortunately, most compilers inherit the browser's compromised execution model, so long-running programs freeze the browser tab, infinite loops crash IDEs, and so on. The few compilers that avoid these problems suffer poor performance and are difficult to engi…
▽ More
Scores of compilers produce JavaScript, enabling programmers to use many languages on the Web, reuse existing code, and even use Web IDEs. Unfortunately, most compilers inherit the browser's compromised execution model, so long-running programs freeze the browser tab, infinite loops crash IDEs, and so on. The few compilers that avoid these problems suffer poor performance and are difficult to engineer.
This paper presents Stopify, a source-to-source compiler that extends JavaScript with debugging abstractions and blocking operations, and easily integrates with existing compilers. We apply Stopify to 10 programming languages and develop a Web IDE that supports stop**, single-step**, breakpointing, and long-running computations. For nine languages, Stopify requires no or trivial compiler changes. For eight, our IDE is the first that provides these features. Two of our subject languages have compilers with similar features. Stopify's performance is competitive with these compilers and it makes them dramatically simpler.
Stopify's abstractions rely on first-class continuations, which it provides by compiling JavaScript to JavaScript. We also identify sub-languages of JavaScript that compilers implicitly use, and exploit these to improve performance. Finally, Stopify needs to repeatedly interrupt and resume program execution. We use a sampling-based technique to estimate program speed that outperforms other systems.
△ Less
Submitted 15 April, 2018; v1 submitted 8 February, 2018;
originally announced February 2018.
-
Compiling Stateful Network Properties for Runtime Verification
Authors:
Tim Nelson,
Nicholas DeMarinis,
Timothy Adam Hoff,
Rodrigo Fonseca,
Shriram Krishnamurthi
Abstract:
Networks are difficult to configure correctly, and tricky to debug. These problems are accentuated by temporal and stateful behavior. Static verification, while useful, is ineffectual for detecting behavioral deviations induced by hardware faults, security failures, and so on, so dynamic property monitoring is also valuable. Unfortunately, existing monitoring and runtime verification for networks…
▽ More
Networks are difficult to configure correctly, and tricky to debug. These problems are accentuated by temporal and stateful behavior. Static verification, while useful, is ineffectual for detecting behavioral deviations induced by hardware faults, security failures, and so on, so dynamic property monitoring is also valuable. Unfortunately, existing monitoring and runtime verification for networks largely focuses on properties about individual packets (such as connectivity) or requires a digest of all network events be sent to a server, incurring enormous cost.
We present a network monitoring system that avoids these problems. Because traces of network events correspond well to temporal logic, we use a subset of Metric First-Order Temporal Logic as the query language. These queries are compiled down to execute completely on the network switches. This vastly reduces network load, improves the precision of queries, and decreases detection latency. We show the practical feasibility of our work by extending a widely-used software switch and deploying it on networks. Our work also suggests improvements to network instruction sets to better support temporal monitoring.
△ Less
Submitted 15 July, 2016; v1 submitted 12 July, 2016;
originally announced July 2016.
-
The Essence of JavaScript
Authors:
Arjun Guha,
Claudiu Saftoiu,
Shriram Krishnamurthi
Abstract:
We reduce JavaScript to a core calculus structured as a small-step operational semantics. We present several peculiarities of the language and show that our calculus models them. We explicate the desugaring process that turns JavaScript programs into ones in the core. We demonstrate faithfulness to JavaScript using real-world test suites. Finally, we illustrate utility by defining a security prope…
▽ More
We reduce JavaScript to a core calculus structured as a small-step operational semantics. We present several peculiarities of the language and show that our calculus models them. We explicate the desugaring process that turns JavaScript programs into ones in the core. We demonstrate faithfulness to JavaScript using real-world test suites. Finally, we illustrate utility by defining a security property, implementing it as a type system on the core, and extending it to the full language.
△ Less
Submitted 4 October, 2015;
originally announced October 2015.
-
ADsafety: Type-Based Verification of JavaScript Sandboxing
Authors:
Joe Gibbs Politz,
Spiridon Eliopoulos,
Arjun Guha,
Shriram Krishnamurthi
Abstract:
Web sites routinely incorporate JavaScript programs from several sources into a single page. These sources must be protected from one another, which requires robust sandboxing. The many entry-points of sandboxes and the subtleties of JavaScript demand robust verification of the actual sandbox source. We use a novel type system for JavaScript to encode and verify sandboxing properties. The resultin…
▽ More
Web sites routinely incorporate JavaScript programs from several sources into a single page. These sources must be protected from one another, which requires robust sandboxing. The many entry-points of sandboxes and the subtleties of JavaScript demand robust verification of the actual sandbox source. We use a novel type system for JavaScript to encode and verify sandboxing properties. The resulting verifier is lightweight and efficient, and operates on actual source. We demonstrate the effectiveness of our technique by applying it to ADsafe, which revealed several bugs and other weaknesses.
△ Less
Submitted 25 June, 2015;
originally announced June 2015.
-
Automated Fault Localization Using Potential Invariants
Authors:
Brock Pytlik,
Manos Renieris,
Shriram Krishnamurthi,
Steven P. Reiss
Abstract:
We present a general method for fault localization based on abstracting over program traces, and a tool that implements the method using Ernst's notion of potential invariants. Our experiments so far have been unsatisfactory, suggesting that further research is needed before invariants can be used to locate faults.
We present a general method for fault localization based on abstracting over program traces, and a tool that implements the method using Ernst's notion of potential invariants. Our experiments so far have been unsatisfactory, suggesting that further research is needed before invariants can be used to locate faults.
△ Less
Submitted 18 October, 2003;
originally announced October 2003.