martes, 11 de octubre de 2016

Compile-Time Metaprogramming

This week we listen to a podcast by Software Engineering Radio with Laurence Tratt as guest. He begin with the idea that the way to express new things is to create new syntax. For that we need to know the relevant issues with DSL.

The DSL is an abstraction relevant to specific domain, in other words, you take a particular problem and see how can you express it in a programming language. That means you move it to a higher level and that's DSL construction.
The reason you want to embed things in a host language is the alternative is making stand alone DSL, and the best example of that is “make” because is a complex stand alone application. We embed to get low level stuff.
The idea of compile-time metaprogramming is that you have a way of adding source code to the program that is not evaluated at run time but rather during the compilation process and the result of evaluating this piece of source code is a syntax tree that is then integrated into the machine code that the compiler create.
Parsing is a two stage process:
1.     You take an input and you tokenize it.
2.     Take the token and try to give it sense.
This converts into an abstract syntaxt tree in terms of the host language.
Converge is a dynamically typed object orientated programming language with compile-time meta-programming facilities - put simply, Converge has a macro-like facility that can embed domain specific languages with arbitrary syntaxes into source files.
In general he recommend us to use Converge language because it's probably that we succeed, because is easy to use and very easy to merge with your source code.

If you are interested in listening this podcast here's the link: Compile-Time Metaprogramming.

No hay comentarios:

Publicar un comentario