Dyla'14Pub Date : 2014-06-09DOI: 10.1145/2617548.2617553
André Murbach Maidl, Fabio Mascarenhas, R. Ierusalimschy
{"title":"Typed Lua: An Optional Type System for Lua","authors":"André Murbach Maidl, Fabio Mascarenhas, R. Ierusalimschy","doi":"10.1145/2617548.2617553","DOIUrl":"https://doi.org/10.1145/2617548.2617553","url":null,"abstract":"Dynamically typed languages trade flexibility and ease of use for safety, while statically typed languages prioritize the early detection of bugs, and provide a better framework for structure large programs. The idea of optional typing is to combine the two approaches in the same language: the programmer can begin development with dynamic types, and migrate to static types as the program matures. The challenge is designing a type system that feels natural to the programmer that is used to programming in a dynamic language.\u0000 This paper presents the initial design of Typed Lua, an optionally-typed extension of the Lua scripting language. Lua is an imperative scripting language with first class functions and lightweight metaprogramming mechanisms. The design of Typed Lua's type system has a novel combination of features that preserves some of the idioms that Lua programmers are used to, while bringing static type safety to them. We show how the major features of the type system type these idioms with some examples, and discuss some of the design issues we faced.","PeriodicalId":304379,"journal":{"name":"Dyla'14","volume":"20 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-06-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127847375","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Dyla'14Pub Date : 2014-06-09DOI: 10.1145/2617548.2617551
W. Vanderbauwhede
{"title":"List-based Monadic Computations for Dynamically Typed Languages","authors":"W. Vanderbauwhede","doi":"10.1145/2617548.2617551","DOIUrl":"https://doi.org/10.1145/2617548.2617551","url":null,"abstract":"In this paper we propose a flexible and elegant design for list-based monadic (\"karmic\") computations in dynamically typed languages. Our approach is applicable to any dynamically typed language that supports lists, maps and higher-order functions. The design results in a clear, concise and largely language-independent syntax.\u0000 We prove that our design adheres to the laws governing monads. We illustrate the use of the list-based monads with three examples: error handling in computations, stateful computations and parser combinators. We provide examples in the popular multi-paradigm language Perl, the object-oriented language Ruby and the functional dynamically typed language LiveScript.","PeriodicalId":304379,"journal":{"name":"Dyla'14","volume":"72 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-06-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124488675","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Dyla'14Pub Date : 2014-06-09DOI: 10.1145/2617548.2617550
Chris Seaton, M. L. V. D. Vanter, M. Haupt
{"title":"Debugging at Full Speed","authors":"Chris Seaton, M. L. V. D. Vanter, M. Haupt","doi":"10.1145/2617548.2617550","DOIUrl":"https://doi.org/10.1145/2617548.2617550","url":null,"abstract":"Debugging support for highly optimized execution environments is notoriously difficult to implement. The Truffle/Graal platform for implementing dynamic languages offers an opportunity to resolve the apparent trade-off between debugging and high performance.\u0000 Truffle/Graal-implemented languages are expressed as abstract syntax tree (AST) interpreters. They enjoy competitive performance through platform support for type specialization, partial evaluation, and dynamic optimization/deoptimization. A prototype debugger for Ruby, implemented on this platform, demonstrates that basic debugging services can be implemented with modest effort and without significant impact on program performance. Prototyped functionality includes breakpoints, both simple and conditional, at lines and at local variable assignments.\u0000 The debugger interacts with running programs by inserting additional nodes at strategic AST locations; these are semantically transparent by default, but when activated can observe and interrupt execution. By becoming in effect part of the executing program, these \"wrapper\" nodes are subject to full runtime optimization, and they incur zero runtime overhead when debugging actions are not activated. Conditions carry no overhead beyond evaluation of the expression, which is optimized in the same way as user code, greatly improving the prospects for capturing rarely manifested bugs. When a breakpoint interrupts program execution, the platform automatically restores the full execution state of the program (expressed as Java data structures), as if running in the unoptimized AST interpreter. This then allows full introspection of the execution data structures such as the AST and method activation frames when in the interactive debugger console.\u0000 Our initial evaluation indicates that such support could be permanently enabled in production environments.","PeriodicalId":304379,"journal":{"name":"Dyla'14","volume":"71 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-06-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126920444","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Dyla'14Pub Date : 2014-06-09DOI: 10.1145/2617548.2617552
G. Barany
{"title":"Python Interpreter Performance Deconstructed","authors":"G. Barany","doi":"10.1145/2617548.2617552","DOIUrl":"https://doi.org/10.1145/2617548.2617552","url":null,"abstract":"The Python programming language is known for performing poorly on many tasks. While to some extent this is to be expected from a dynamic language, it is not clear how much each dynamic feature contributes to the costs of interpreting Python. In this study we attempt to quantify the costs of language features such as dynamic typing, reference counting for memory management, boxing of numbers, and late binding of function calls.\u0000 We use an experimental compilation framework for Python that can make use of type annotations provided by the user to specialize the program as well as elide unnecessary reference counting operations and function lookups. The compiled programs run within the Python interpreter and use its internal API to implement language semantics. By separately enabling and disabling compiler optimizations, we can thus measure how much each language feature contributes to total execution time in the interpreter.\u0000 We find that a boxed representation of numbers as heap objects is the single most costly language feature on numeric codes, accounting for up to 43% of total execution time in our benchmark set. On symbolic object-oriented code, late binding of function and method calls costs up to 30%. Redundant reference counting, dynamic type checks, and Python's elaborate function calling convention have comparatively smaller costs.","PeriodicalId":304379,"journal":{"name":"Dyla'14","volume":"60 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-06-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125622021","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Dyla'14Pub Date : 2014-02-28DOI: 10.1145/2617548.2617549
Erdal Mutlu, S. Tasiran, B. Livshits
{"title":"I Know It When I See It: Observable Races in JavaScript Applications","authors":"Erdal Mutlu, S. Tasiran, B. Livshits","doi":"10.1145/2617548.2617549","DOIUrl":"https://doi.org/10.1145/2617548.2617549","url":null,"abstract":"Despite JavaScript runtime's lack of conventional threads, the presence of asynchrony creates a real potential for concurrency errors. These concerns have lead to investigations of race conditions in the Web context. However, focusing on races does not produce actionable error reports that would at the end of the day appeal to developers and cause them to fix possible underlying problems.\u0000 In this paper, we advocate for the notion of observable races, focusing on concurrency conditions that lead to visually apparent glitches caused by non-determinism within the runtime scheduler on the network. We propose and investigate ways to find observable races via systematically exploring possible network schedules and shepherding the scheduler towards correct executions. We propose crowd-sourcing both to spot when different schedules lead to visually broken sites and also to determine under what environment conditions (OS, browser, network speed) these schedules may in fact happen in practice for some fraction of the users.","PeriodicalId":304379,"journal":{"name":"Dyla'14","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2014-02-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115765784","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}