Compile-time AST manipulation API
Maël
mael.primet at gmail.com
Sun Nov 25 00:45:04 PST 2007
Take a look at OCaml / CamlP4, this is exactly what you are looking for, and this is done in a truely nice and (extremely) fast (as always when it comes to OCaml ...) way.
In my opinion, CamlP4 is one of the biggest advantage of OCaml, because it truly permits to implement full DSL, or to couple a DSL to OCaml code in a transparent way, so for instance you can define a logic DSL, and have things like
<ocaml code...>
let F = Logic( A -> B \/ C ) in
my_solver F ;
<ocaml code again...>
and this would translate to
...
let F = Formula_Or(Formula_Imp(A,B),C) in
my_solver F ;
...
and this certainly is useful in many ways
More information about the Digitalmars-d
mailing list