I have recently worked quite a bit with the language workbench MPS and I think it's about time to note the experiences I have made and the background knowledge I have collected.
Showing posts with label review. Show all posts
Showing posts with label review. Show all posts
Saturday, October 23, 2010
Monday, November 9, 2009
meta level debugging
One of the challenges in meta programming is the ability to debug on the meta level. It is not satisfying to have to step through the generated code in order to figure out what is wrong in the model. And indeed many meta programming toolchains have poor support for proper debugging.
But wait, this problem has in principle actually been solved since ages. When we reduce meta programming to code transformation and realize that a C compiler in that sense is a code transformer this becomes apparent. Almost nobody steps through the assembler code in order to find a bug in the C source. Instead the toolchain has support for so called source level debugging, which is exactly what we want: debugging on the meta level. So it seams advisable to understand the concepts of source level debugging so that we can copy or adapt them to meta programming. That's why I decided to explore the GCC and the GDB together with its graphical frontend DDD which are the tools I am most familiar with.
But wait, this problem has in principle actually been solved since ages. When we reduce meta programming to code transformation and realize that a C compiler in that sense is a code transformer this becomes apparent. Almost nobody steps through the assembler code in order to find a bug in the C source. Instead the toolchain has support for so called source level debugging, which is exactly what we want: debugging on the meta level. So it seams advisable to understand the concepts of source level debugging so that we can copy or adapt them to meta programming. That's why I decided to explore the GCC and the GDB together with its graphical frontend DDD which are the tools I am most familiar with.
Wednesday, September 16, 2009
Rats!
Rats! is an "easily extensible parser generator for C-like languages" written by Robert Grimm. The main idea of Rats! is to exploit the extensibility of PEGs by providing support for parametrizable grammar modules which can use, instantiate, extend and modify each other. Grimm describes version 1.8.2 of Rats! in Better Extensibility through Modular Syntax. More documentation can be found in the Rats! intro. It is part of the the extensive Javadoc of the xtc project, which is the framework project of Rats!. Here comes what I consider the main design principles, features and properties of Rats!.
Thursday, August 20, 2009
Language Oriented Programming: The Next Programming Paradigm
As mentioned previously the term language-oriented programming (LOP) today mainly refers to the underlying paradigm of JetBrains's Meta Programming System. This is due to a publication from Sergey Dmitriev entitled Language Oriented Programming: The Next Programming Paradigm. There he proclaims the next technology revolution which leads us from the Stone Age to "a new age of invention and an explosion of new technologies". The paper is very stirringly written but while smiling at this I agree with him in many points. Here is what I consider his main statements.
Wednesday, August 5, 2009
Worlds: Controlling the Scope of Side Effects
Worlds is "a language construct that reifies the notion of program state, and enables programmers to control the scope of side effects." Alessandro Warth investigaged this idea together with Alan Kay in a paper entitled Worlds: Controlling the Scope of Side Effects. Chapter 4 of Warth's dissertation Experimenting with Programming Languages obsoletes this paper. Worlds/JS is an extension of JavaScript implementing worlds.
The basic idea is to turn program state into first-class objects, allowing them to co-exist in the same program and enable them to inherit and delegate state to and from each other. Warth calls such a program state object a world. "All computation takes place inside a world, which captures all of the side effects [...] that happen inside it".
The basic idea is to turn program state into first-class objects, allowing them to co-exist in the same program and enable them to inherit and delegate state to and from each other. Warth calls such a program state object a world. "All computation takes place inside a world, which captures all of the side effects [...] that happen inside it".
Thursday, July 23, 2009
language-oriented programming
The term "language-oriented programming" (LOP) is these days mainly used by JetBrains and refers to the underlying paradigm of their Meta Programming System. I will blog about that later. For now I want to focus on Martin Ward, because the LOP term was actually coined by him in 1994 with a paper entitled Language Oriented Programming. There he describes what I consider the core idea of meta-programming. And in fact he names many of the benefits, problems, guidelines and other insights that one can find in today's discussions about MDSD. Here is an extraction of these:
Sunday, July 12, 2009
OMeta
OMeta is an object-oriented language for pattern matching based on Parsing Expression Grammars (PEG). It makes some valuable extensions to standard PEGs which I want to summarize here. My main source of information is the paper OMeta: an Object-Oriented Language for Pattern Matching by Alessandro Warth and Ian Piumatra.
Thursday, July 9, 2009
Stratego/XT
Stratego/XT is the first meta programming system I had a closer look at. The project defines itself as "a language and tool set for program transformation". By program transformation they mean "programming tasks using some form of automatic program generation or transformation, such as code generation from a domain-specific language, aspect weaving, optimization, or specialization of a generic program to a particular context." So Stratego/XT follows a more generalized approach then what MDE needs.
Subscribe to:
Posts (Atom)