Acta Informatica Pragensia 2012, 1(1), 1-21 | DOI: 10.18267/j.aip.15680
Will we think in programming languages?
- Department of Informatics, Faculty of Science, Jan Evangelista Purkyne University in Usti nad Labem, Ceske mladeze 8, Usti nad Labem 400 96, Czech Republic
Modern science commonly uses computer modelling. Thousands of scientific model are daily transformed to computers programs and tested. The transformation must overcome the gap between abstract human formal notation and low level semantics of contemporary programming languages. The simultaneous knowledge of specific scientific models and programming languages is an unpleasant necessity for a significant proportion of scientists and practitioners (engineers, economist, etc.). But a solution exists - accommodation of programming languages to mental models of their users. The article discuss one partial solution - implementation of domain specific languages in the heart of existing universal languages by mechanisms of metaprogramming. This mechanism overcomes limitations of classical programming languages and complexity of creation new languages from scratch. However, the support of metaprogramming in contemporary languages is limited to isolated and peripheral constructs in very few languages. These constructs are demonstrated by simplified but real examples (metaobject system of Python, monads in F# and macro-based metaprogramming of Boo language) together with discussion of their advantages and disadvantages. The discussion of examples is aimed to finding requirements for new languages and their implementation in a original (parent) language.
Keywords: Programming languages, Domain-specific languages, Metaprogramming, Python, F#, Boo
Received: October 10, 2012; Revised: December 26, 2012; Accepted: December 29, 2012; Published: December 29, 2012 Show citation
References
- DAHL, O.-J., NYGGARD, K. Simula - A language for programmingt and decription of discrete event systems. Introduction and user's manual. 1967. URL http://www.edelweb.fr/Simula/slp-0.pdf
- DIJKSTRA, E.W. How do we tell truths that might hurt? 1975. URL http://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD498.html
- ICAZA, M. Mono's C# Compiler as a Service on Windows. 2010. URL http://tirania.org/blog/archive/2010/Apr-27.html
- KICZALES, G., ASHLEY, J.M., RODRIGUEZ, L., VAHDAT, A., BOBROW, D.G. Metaobject protocols: Why we want them and what else they can do. Object-Oriented Programming: The CLOS Perspective, pp. 101-118, 1993.
- KUNK, J. 10 Questions, 10 Answers on Roslyn. Visual Studio magazine, 2012. URL http://visualstudiomagazine.com/articles/2012/03/20/10-questions-10-answers-on-roslyn.aspx
Go to original source...
- MCCREA, A. Metaprogramming JavaScript. URL http://s3.amazonaws.com/edgecase/metaprogramming_js.pdf
- O'SULLIVAN, B., GOERZEN, J., STEWART, D. Real World Haskell: Code You Can Believe. In: O'Reilly Media, Incorporated, 2008.
- ODERSKY, M., SPOON, L., VENNERS, B. Programming in Scala. Artima, 2008. 756 p. ISBN: 978-0981-531-601.
- PERROTTA, P. Metaprogramming Ruby: Program Like the Ruby Pros. Pragmatic Bookshelf, 2010. 296 p. ISBN: 978-1-93435-647-0.
- PETRICEK, T., SYME, D. Syntax Matters: Writing abstract computations in F#. In pre-proceedings of TFP, 2012. Draft paper.
- RAHIEN, A. DSLs in Boo: Domain Specific Languages in.NET. Manning Publications, 2010. 352 p. ISBN: 978-1933-988-603.
- PICKERING, R. Beyond Foundations of F# - Workflows. InfoQ, 2008. URL http://www.infoq.com/articles/pickering-fsharp-workflow
- PECINOVSKY´, R., PAVLICˇKOVA´, J., PAVLI´CˇEK, L. Let's Modify the Objects-First Approach into Design-Patterns-First. In: ITiCSE, 2006. URL http://edu.pecinovsky.cz/papers/2006_ITiCSE_Design_Patterns_First.pdf
- SHEARD, T., JONES, S.P. Template meta-programming for Haskell. In: ACM SIGPLAN workshop on Haskell. pp. 1-16, 2002. DOI: http://doi.acm.org/10.1145/581690.581691
Go to original source...
- SUMMERFIELD, M. Advanced Python 3 Programming Techniques. Pearson Technology Group, 2009. 97 p. ISBN: 978-0-321-63772-7.
- TRATT, L. Domain specific language implementation via compile-time meta-programming. ACM Trans. Program. Lang. Syst., pp. 31:1-31:40, 2008. DOI: http://doi.acm.org/10.1145/1391956.1391958
Go to original source...
- VILLAR, J.I. Python as a hardware description language: A case study. In: Programmable Logic, pp. 117-122, 2011. DOI: http://dx.doi.org/10.1109/SPL.2011.5782635
Go to original source...
- WIRTH, N. Algorithms + data structures = Programs. Prentice-Hall, 1976.
This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0), which permits use, distribution, and reproduction in any medium, provided the original publication is properly cited. No use, distribution or reproduction is permitted which does not comply with these terms.