Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1146841.1146846acmotherconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Compile-time meta-programming in a dynamically typed OO language

Published: 18 October 2005 Publication History

Abstract

Compile-time meta-programming allows programs to be constructed by the user at compile-time. Although LISP derived languages have long had such facilities, few modern languages are capable of compile-time meta-programming, and of those that do many of the most powerful are statically typed functional languages. In this paper I present the dynamically typed object orientated language Converge which allows compile-time meta-programming in the spirit of Template Haskell. Converge demonstrates that integrating powerful, safe compile-time meta-programming features into a dynamic language requires few restrictions to the flexible development style facilitated by the paradigm. In this paper I detail Converge's compile-time meta-programming facilities, much of which is adapted from Template Haskell, contain several features new to the paradigm. Finally I explain how such a facility might be integrated into similar languages.

References

[1]
M. Abadi and L. Cardelli. A Theory of Objects. Springer, 1996.]]
[2]
J. Bachrach and K. Playford. D-expressions: Lisp power, Dylan style, 1999. http://www.ai.mit.edu/people/jrb/Projects/dexprs.pdf Accessed Sep 22 2004.]]
[3]
J. Bachrach and K. Playford. The Java syntactic extender (JSE). In Proc. OOPSLA, pages 31--42, November 2001.]]
[4]
J. Baker and W. C. Hsieh. Maya: multiple-dispatch syntax extension in Java. In Proc. ACM SIGPLAN Conference on Programming language design and implementation, pages 270--281, 2002.]]
[5]
A. Bawden. Quasiquotation in LISP. Workshop on Partial Evaluation and Semantics-Based Program Manipulation, January 1999.]]
[6]
C. Brabrand and M. Schwartzbach. Growing languages with metamorphic syntax macros. In Workshop on Partial Evaluation and Semantics-Based Program Manipulation, SIGPLAN. ACM, 2000.]]
[7]
M. Bravenboer and E. Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In D. C. Schmidt, editor, Proc. OOPSLA'04, Vancouver, Canada, October 2004. ACM SIGPLAN.]]
[8]
J.-P. Briot and P. Cointe. Programming with explicit metaclasses in Smalltalk-80. In Proc. OOPSLA '89, October 1989.]]
[9]
L. Cardelli, F. Matthes, and M. Abadi. Extensible grammars for language specialization. In Proc. Fourth International Workshop on Database Programming Languages - Object Models and Languages, pages 11--31, August 1993.]]
[10]
P. Cointe. Metaclasses are first class: the ObjVLisp model. In Object Oriented Programming Systems Languages and Applications, pages 156--162, October 1987.]]
[11]
K. Czarnecki, J. O'Donnell, J. Striegnitz, and W. Taha. DSL implementation in MetaOCaml, Template Haskell, and C++. 3016:50--71, 2004.]]
[12]
D. de Rauglaudre. Camlp4 - Reference Manual, September 2003. http://caml.inria.fr/camlp4/manual/ Accessed Sep 22 2004.]]
[13]
F.-N. Demers and J. Malenfant. Reflection in logic, functional and object-oriented programming: a short comparative study. In Proc. IJCAI'95 Workshop on Reflection and Metalevel Architectures and Their Applications in AI, pages 29--38, August 1995.]]
[14]
R. K. Dybvig, R. Hieb, and C. Bruggeman. Syntactic abstraction in scheme. In Lisp and Symbolic Computation, volume 5, pages 295--326, December 1992.]]
[15]
M. D. Ernst, G. J. Badros, and D. Notkin. An empirical analysis of C preprocessor use. IEEE Transactions on Software Engineering, 2002.]]
[16]
S. E. Ganz, A. Sabry, and W. Taha. Macros as multi-stage computations: Type-safe, generative, binding macros in macroml. In Proc. International Conference on Functional Programming (ICFP), volume 36 of SIGPLAN. ACM, September 2001.]]
[17]
R. Glück and J. Jrgensen. Multi-level specialization. volume 1706 of LNCS, pages 326 -- 337, 1998.]]
[18]
A. Goldberg and D. Robson. Smalltalk-80: The Language. Addison-Wesley, January 1989.]]
[19]
R. E. Griswold and M. T. Griswold. The Icon Programming Language. Peer-to-Peer Communications, third edition, 1996.]]
[20]
R. Kelsey, W. Clinger, and J. Rees. Revised(5) report on the algorithmic language Scheme. Higher-Order and Symbolic Computation, 11(1):7--105, 1998.]]
[21]
G. Kiczales, J. des Rivieres, and D. G. Bobrow. The Art of the Metaobject Protocol. MIT Press, 1991.]]
[22]
E. Kohlbecker, D. P. Friedman, M. Felleisen, and B. Duba. Hygienic macro expansion. In Symposium on Lisp and Functional Programming, pages 151--161. ACM, 1986.]]
[23]
J. K. Ousterhout. Scripting: Higher-level programming for the 21st century. Computer, 31(3):23--30, 1998.]]
[24]
L. Prechelt. An empirical comparison of seven programming languages. Computer, 33(10):23--29, 2000.]]
[25]
C. Queinnec. Macroexpansion reflective tower. In Proc. Reflection'96, pages 93--104, April 1996.]]
[26]
S. Seefried, M. M. T. Chakravarty, and G. Keller. Optimising embedded DSLs using Template Haskell. In Draft Proc. Implementation of Functional Languages, 2003.]]
[27]
T. Sheard, Z. el Abidine Benaissa, and E. Pasalic. DSL implementation using staging and monads. In Proc. 2nd conference on Domain Specific Languages, volume 35 of SIGPLAN, pages 81--94. ACM, October 1999.]]
[28]
T. Sheard and S. P. Jones. Template meta-programming for Haskell. In Proceedings of the Haskell workshop 2002. ACM, 2002.]]
[29]
K. Skalski, M. Moskal, and P. Olszta. Meta-programming in Nemerle, 2004. http://nemerle.org/metaprogramming.pdf Accessed Oct 1 2004.]]
[30]
G. L. Steele, Jr. Growing a language. Higher-Order and Symbolic Computation, 12(3):221 -- 236, October 1999.]]
[31]
W. Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, October 1999.]]
[32]
D. Thomas and A. Hunt. Programming Ruby: A Pragmatic Programmer's Guide. Addison-Wesley, 2000.]]
[33]
L. Tratt. Converge Reference Manual, September 2004. http://www.convergepl.org/documentation/refmanual/ Accessed Sep 23 2004.]]
[34]
L. Tratt. Model transformations and tool integration. Journal of Software and Systems Modelling, 4(2):112--122, May 2005.]]
[35]
G. van Rossum. Python 2.3 reference manual, 2003. http://www.python.org/doc/2.3/ref/ref.html Accessed Aug 31 2005.]]
[36]
T. Veldhuizen. Using C++ template metaprograms. C++ Report, 7(4):36--43, May 1995.]]
[37]
D. Weise and R. Crew. Programmable syntax macros. In Proc. SIGPLAN, pages 156--165, 1993.]]

Cited By

View all
  • (2020)Funcons for HGMP: the fundamental constructs of homogeneous generative meta-programming (short paper)ACM SIGPLAN Notices10.1145/3393934.327813253:9(168-174)Online publication date: 7-Apr-2020
  • (2020)Transparent replication using metaprogramming in CyanScience of Computer Programming10.1016/j.scico.2020.102531(102531)Online publication date: Aug-2020
  • (2018)Funcons for HGMP: the fundamental constructs of homogeneous generative meta-programming (short paper)Proceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3278122.3278132(168-174)Online publication date: 5-Nov-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Other conferences
DLS '05: Proceedings of the 2005 symposium on Dynamic languages
October 2005
67 pages
ISBN:9781450378161
DOI:10.1145/1146841
  • Program Chair:
  • Roel Wuyts
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 ACM 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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 October 2005

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Acceptance Rates

Overall Acceptance Rate 32 of 77 submissions, 42%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)5
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2020)Funcons for HGMP: the fundamental constructs of homogeneous generative meta-programming (short paper)ACM SIGPLAN Notices10.1145/3393934.327813253:9(168-174)Online publication date: 7-Apr-2020
  • (2020)Transparent replication using metaprogramming in CyanScience of Computer Programming10.1016/j.scico.2020.102531(102531)Online publication date: Aug-2020
  • (2018)Funcons for HGMP: the fundamental constructs of homogeneous generative meta-programming (short paper)Proceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3278122.3278132(168-174)Online publication date: 5-Nov-2018
  • (2015)Zero-overhead metaprogramming: reflection and metaobject protocols fast and without compromisesACM SIGPLAN Notices10.1145/2813885.273796350:6(545-554)Online publication date: 3-Jun-2015
  • (2015)Zero-overhead metaprogramming: reflection and metaobject protocols fast and without compromisesProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2737963(545-554)Online publication date: 3-Jun-2015
  • (2015)An integrated implementation framework for compile-time metaprogrammingSoftware—Practice & Experience10.1002/spe.224145:6(727-763)Online publication date: 1-Jun-2015
  • (2014)LibDSL: a library for developing embedded domain specific languages in d via template metaprogrammingACM SIGPLAN Notices10.1145/2775053.265877050:3(63-72)Online publication date: 15-Sep-2014
  • (2014)LibDSL: a library for developing embedded domain specific languages in d via template metaprogrammingProceedings of the 2014 International Conference on Generative Programming: Concepts and Experiences10.1145/2658761.2658770(63-72)Online publication date: 15-Sep-2014
  • (2013)Extensible LanguagesFormal and Practical Aspects of Domain-Specific Languages10.4018/978-1-4666-2092-6.ch001(1-31)Online publication date: 2013
  • (2013)Submodules in racketACM SIGPLAN Notices10.1145/2637365.251721149:3(13-22)Online publication date: 27-Oct-2013
  • Show More Cited By

View Options

Get Access

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