On Sat, 8 Dec 2007, Basile STARYNKEVITCH wrote:
There is no way to at least work on abstract syntax tree? While generating code as string (or files) is definitely doable, it is not really convenient. Besides, its also have a cost (both in the human developer's coding time and in the machine time to print & reparse it) which I would be interested to avoid.
By delving deeper into Poly/ML internals you should be able to operate on parse trees also, but this is getting very unportable. The source-as-string based approach has the advantage that most SML systems are able to provide such a facility, as we do in Isabelle for SML/NJ, MosML, and Poly/ML.
I don't think you waste much time in printing/parsing the ML sources -- Poly/ML is very fast in this respect. Of course, it depends on the granularity of runtime compilation you have in mind. Ours is relatively coarse.
Makarius