[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2814228.2814240acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Slimming languages by reducing sugar: a case for semantics-altering transformations

Published: 21 October 2015 Publication History

Abstract

Splitting a language into a core language and a desugaring function makes it possible to produce tractable semantics for real-world languages. It does so by pushing much of the language's complexity into desugaring. This, however, produces large and unwieldy core programs, which has proven to be a significant obstacle to actual use of these semantics. In this paper we analyze this problem for a semantics of JavaScript. We show that much of the bloat is *semantic bloat*: a consequence of the language's rich semantics. We demonstrate how assumptions about language use can confine this bloat, and codify these through several transformations that, in general, do not preserve the language's semantics. We experimentally demonstrate the effectiveness of these transformations. Finally, we discuss the implications of this work on language design and structure.

References

[1]
G. Bernhardt. Wat. A lightning talk from CodeMash, 2012. https://www.destroyallsoftware.com/talks/wat.
[2]
S. Bishop, M. Fairbairn, M. Norrish, P. Sewell, M. Smith, and K. Wansbrough. Rigorous specification and conformance testing techniques for network protocols, as applied to TCP, UDP, and sockets. In Special Interest Group on Data Communications, 2005.
[3]
M. Bodin, A. Chargéraud, D. Filaretti, P. Gardner, S. Maffeis, D. Naudˇzi¯unien˙e, A. Schmitt, and G. Smith. A trusted mechanised JavaScript specification. In Principles of Programming Languages, 2014.
[4]
R. Bruce Findler, J. Clements, C. Flanagan, M. Flatt, K. Shriram, P. Steckler, and M. Felleisen. DrScheme: A programming environment for scheme. Journal of Functional Programming, 12:159–182, 2002.
[5]
R. C. Holt and D. B. Wortman. A sequence of structured subsets of PL/I*. In Special Interest Group on Computer Science Education, 1974.
[6]
S. Chang. Laziness by need. In European Symposium on Programming Languages and Systems, 2013.
[7]
D. Crockford. JavaScript: The Good Parts. O’Reilly Media, 2008.
[8]
ECMA International. ECMAScript Language test262. http://test262.ecmascript.org/.
[9]
ECMA International. ECMAScript Edition 5.1, 2011. http://www.ecma-international.org/publications/ files/ECMA-ST/Ecma-262.pdf.
[10]
M. Felleisen, R. B. Findler, M. Flatt, and S. Krishnamurthi. How to Design Programs. MIT Press, 2001.
[11]
D. Filaretti and S. Maffeis. An executable formal semantics of PHP. In European Conference on Object-Oriented Programming, 2014.
[12]
Google Chrome V8 development team. Experiments with strengthening JavaScript, 2015.
[13]
https://developers.google.com/v8/experiments.
[14]
A. Guha, C. Saftoiu, and S. Krishnamurthi. The essence of JavaScript. In European Conference on Object-oriented Programming, 2010.
[15]
A. Guha, C. Saftoiu, and S. Krishnamurthi. Typing local control and state using flow analysis. In European Symposium on Programming Languages and Systems, 2011.
[16]
J. K. Ousterhout. Scripting: Higher level programming for the 21st century. IEEE Computer Magazine, 31:23–30, Mar. 1998.
[17]
S. Krishnamurthi and J. Vitek. Viewpoint: The real software crisis: Repeatability as a core value. Communications of the ACM, 58(3):34–36, Mar. 2015.
[18]
P. J. Landin. The mechanical evaluation of expressions. The Computer Journal, 6(4):308–320, 1964.
[19]
B. S. Lerner, M. J. Carroll, D. P. Kimmel, H. Q. la Vallee, and S. Krishnamurthi. Modeling and reasoning about DOM events. In USENIX Conference on Web Application Development, June 2012.
[20]
S. Maffeis and A. Taly. Language-based isolation of untrusted JavaScript. In Computer Security Foundations Symposium, 2009.
[21]
J. Matthews and R. Bruce Findler. Operational semantics for multi-language programs. Transactions on Programming Languages and Systems, 31(12), 2009.
[22]
R. Milner, R. Harper, D. MacQueen, and M. Tofte. The Definition of Standard ML, revised edition. The MIT Press, 1990.
[23]
J. G. Politz, M. Carroll, B. S. Lerner, J. Pombrio, and S. Krishnamurthi. A tested semantics for getters, setters, and eval in JavaScript. In Dynamic Languages Symposium, 2012.
[24]
J. G. Politz, A. Martinez, M. Milano, S. Warren, D. Patterson, J. Li, A. Chitipothu, and S. Krishnamurthi. Python: The full monty: A tested semantics for the python programming language. In ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, 2013.
[25]
J. Regehr, Y. Chen, P. Cuoq, E. Eide, C. Ellison, and X. Yang. Test-case reduction for C compiler bugs. In Programming Languages Design and Implementation, 2012.
[26]
A. Sampson, W. Dietl, E. Fortuna, D. Gnanapragasam, L. Ceze, and D. Grossman. EnerJ: Approximate data types for safe and general low-power computation. In Programming Languages Design and Implementation, 2011.
[27]
P. Sewell and S. Zdancewic. Principles in Practice (PiP), 2014. Co-located with Principles of Programming Languages.
[28]
E. Tilevich and Y. Smaragdakis. J-Orchestra: Enhancing Java programs with distribution capabilities. Transactions on Software Engineering and Methodology, 19(1):1–40, 2009.
[29]
E. M. Westbrook and S. Chaudhuri. A semantics for approximate program transformations. CoRR, abs/1304.5531, 2013.
[30]
X. Zhang, L. Koved, M. Pistoia, S. Weber, T. Jaeger, G. Marceau, and L. Zeng. The case for analysis preserving language transformation. In International Symposium on Software Testing and Analysis, 2006.

Cited By

View all
  • (2021)One down, 699 to go: or, synthesising compositional desugaringsProceedings of the ACM on Programming Languages10.1145/34854995:OOPSLA(1-29)Online publication date: 15-Oct-2021

Index Terms

  1. Slimming languages by reducing sugar: a case for semantics-altering transformations

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    Onward! 2015: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward!)
    October 2015
    307 pages
    ISBN:9781450336888
    DOI:10.1145/2814228
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 21 October 2015

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. JavaScript
    2. optimization
    3. semantic complexity
    4. semantics altering transformations
    5. syntactic sugar

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    SPLASH '15
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 40 of 105 submissions, 38%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)8
    • Downloads (Last 6 weeks)2
    Reflects downloads up to 13 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2021)One down, 699 to go: or, synthesising compositional desugaringsProceedings of the ACM on Programming Languages10.1145/34854995:OOPSLA(1-29)Online publication date: 15-Oct-2021

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media