In this new post for my blog I will talk about the podcast I just heard which is titled Compile-Time Metaprogramming and Laurence Tratt was the special guest. He is a programmer and researcher of programming languages, so that explains the general idea of the topic using Converge.
Unlike the topics I discussed in the last blog posts, DSL (domain specific language) is not new to me, because in the course of Software Design and Architecture we did a programming practice using this design pattern. What I understand is that focuses on language design and allows you to adapt the syntax used to solve problems of any kind.
The main topic of the podcast is Compile-time metaprogramming. This feature allow the user of a programming language a mechanism to Interact with the compiler. Also it related to the creation of a "domain-specific language" which is a way to improve the programming language and perform a specific task. Lisp, Clojure and many other languages have something called a macro, which allows the compiler to be extended by user code.
Reading a little bit about description of macro-like functionality in Converge. Compile-Time Meta-Programming (CTMP) is described as the most powerful cousin of macros, because unlike traditional macros, Converge works at the abstract syntax tree level.
In conclusion, I believe that if macros are already considered as a highly powerful tool because they modify and adapt the language to our convenience, then to manipulate the abstract syntax tree, is working on a deeper level of the compiler, where it is created a temporary module that is compiled and then injected into what is running at the time. From what I understand, the abstract syntax tree is not only used to check the proper use of language elements but is built at compile time.
References
Guide to compile-time metaprogramming. (n.d) Converge. Retrieved 6 October 2016, from http://convergepl.org/documentation/2.0/ctmp/
No hay comentarios:
Publicar un comentario