Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2489812.2489815acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Type-directed, whitespace-delimited parsing for embedded DSLs

Published: 01 July 2013 Publication History

Abstract

Domain-specific languages improve ease-of-use, expressiveness and verifiability, but defining and using different DSLs within a single application remains difficult. We introduce an approach for embedded DSLs where 1) whitespace delimits DSL-governed blocks, and 2) the parsing and type checking phases occur in tandem so that the expected type of the block determines which domain-specific parser governs that block. We argue that this approach occupies a sweet spot, providing high expressiveness and ease-of-use while maintaining safe composability. We introduce the design, provide examples and describe an ongoing implementation of this strategy in the Wyvern programming language. We also discuss how a more conventional keyword-directed strategy for parsing of DSLs can arise as a special case of this type-directed strategy.

References

[1]
JetBrains MPS -- Meta Programming System. http://www.jetbrains.com/mps/.
[2]
LINQ (Language-Integrated Query). http://msdn.microsoft.com/en-us/library/vstudio/bb397926.aspx.
[3]
M. D. Adams. Principled parsing for indentation-sensitive languages. In Principles of Programming Languages, 2013.
[4]
M. Bravenboer, R. Vermaas, J. Vinju, and E. Visser. Generalized type-based disambiguation of meta programs with concrete object syntax. In Generative Programming and Component Engineering, 2005.
[5]
T. Clark, P. Sammut, and J. S. Willans. Beyond annotations: A proposal for extensible java (XJ). In Source Code Analysis and Manipulation, 2008.
[6]
W. R. Cook, A. Loh, and T. van der Storm. Ensō: A self-describing DSL workbench. http://enso-lang.org/.
[7]
D. de Rauglaudre. Camlp4 - Reference Manual, 2003.
[8]
S. Erdweg, T. Rendel, C. Kästner, and K. Ostermann. SugarJ: library-based language extensibility. In Object-Oriented Programming Systems, Languages, and Applications, 2011.
[9]
M. Fowler and R. Parsons. Domain-Specific Languages. Addison-Wesley, 2010.
[10]
A. Goldberg and D. Robson. Smalltalk-80: the language and its implementation. Addison-Wesley, 1983.
[11]
S. L. P. Jones. Haskell 98 language and libraries: the revised report. Cambridge University Press, 2003.
[12]
L. C. L. Kats and E. Visser. The Spoofax Language Workbench. Rules for Declarative Specification of Languages and IDEs. In Object-Oriented Programming Systems, Languages, and Applications, 2010.
[13]
H. Krahn, B. Rumpe, and S. Völkel. Monticore: Modular development of textual domain specific languages. In Objects, Components, Models and Patterns, 2008.
[14]
E. Möller. SRFI-49: Indentation-sensitive syntax. http://srfi.schemers.org/srfi-49/srfi-49.html, 2005.
[15]
C. Omar, Y. Yoon, T. D. LaToza, and B. A. Myers. Active code completion. In International Conference on Software Engineering, 2012.
[16]
Z. Palmer and S. F. Smith. Backstage Java: Making a Difference in Metaprogramming. In Object-Oriented Programming Systems, Languages, and Applications, 2011.
[17]
T. Sheard and S. P. Jones. Template meta-programming for Haskell. In ACM SIGPLAN workshop on Haskell, 2002.
[18]
M. Tatsubori, S. Chiba, M.-O. Killijian, and K. Itano. OpenJava: A Class-based Macro System for Java. In Reflection and Software Engineering, 2000.
[19]
M. G. J. van den Brand. Pregmatic: A Generator for Incremental Programming Environments. PhD thesis, Katholieke Universiteit Nijmegen, 1992.

Cited By

View all
  • (2017)Reliable and automatic composition of language extensions to C: the ableC extensible language frameworkProceedings of the ACM on Programming Languages10.1145/31382241:OOPSLA(1-29)Online publication date: 12-Oct-2017
  • (2014)Safely Composable Type-Specific LanguagesProceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 858610.1007/978-3-662-44202-9_5(105-130)Online publication date: 1-Aug-2014
  • (2013)GlobalDSL'13Proceedings of the First Workshop on the Globalization of Domain Specific Languages10.1145/2489812.2489813(1-3)Online publication date: 1-Jul-2013

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
GlobalDSL '13: Proceedings of the First Workshop on the Globalization of Domain Specific Languages
July 2013
38 pages
ISBN:9781450320436
DOI:10.1145/2489812
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

  • CNRS: Centre National De La Rechercue Scientifique
  • UM2: University Montpellier 2
  • AITO: Association Internationale pour les Technologies Objets

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 2013

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Funding Sources

Conference

ECOOP '13
Sponsor:
  • CNRS
  • UM2
  • AITO

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2017)Reliable and automatic composition of language extensions to C: the ableC extensible language frameworkProceedings of the ACM on Programming Languages10.1145/31382241:OOPSLA(1-29)Online publication date: 12-Oct-2017
  • (2014)Safely Composable Type-Specific LanguagesProceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 858610.1007/978-3-662-44202-9_5(105-130)Online publication date: 1-Aug-2014
  • (2013)GlobalDSL'13Proceedings of the First Workshop on the Globalization of Domain Specific Languages10.1145/2489812.2489813(1-3)Online publication date: 1-Jul-2013

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media