archives

Metaprogramming and Heron : Five Years Later

I just realized that I first posted about my programming language Heron here on Lambda-the-Ultimate.org over five years ago. Kind of funny to think that at the time then I didn't even know where the name "Lambda the Ultimate" came from. I have learned a lot since, and in no small part thanks to the insights of the brilliant and helpful people at this site!

I have spent the last year, completely redesigning Heron and I have come up with a language which is inspired by a slew of other languages. It is still a curly brace language, with a run-of-the-mill Java style object-oriented approach (minus virtual functions) plus some functional features. In fact it looks a lot like JavaScript 4.0 without prototypes. However, I think that the potentially most interesting feature is the new meta-programming system. Or is it a macro system? I don't actually know, which is why I am writing here.

The idea behind the Heron metaprogramming system is quite simple: a Heron program has two entry points. One for run-time execution, and another for compile-time execution. The only difference between the two entry points, is that the compile-time execution is passed a reference to the abstract syntax tree. At run-time, the modified version of the abstract syntax tree is what gets executed.

You can see this article for a more detailed description if you want, or just look at this Quine demo which prints its own source code out at compile-time.

So I have a couple of questions for the members here:

  1. Is it more accurate to call this a metaprogramming system, a macro system, or a compile-time reflection system?
  2. What other programming language metaprogramming facilities most resemble the one I describe here?
  3. Am I confused or being unintentionally confusing or misleading in some ways on this topic? I find this whole subject area a bit murky with regards to correct usage of the terminology.

embedding forth

I embedded jones forth in C programs on windows using masm and/or visual studio.

I am interested to make evolve this forth.
I want to use it as dynamic interpreter to modify C program dynamically. This interpreter has a very small footprint suitable to join it to html files.

is anyone interested to make evolutions to this forth?