[M3devel] Using LLVM (WAS; A question about the M3 licensing...)

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Fri Aug 21 02:04:29 CEST 2009


On Thu, Aug 20, 2009 at 07:48:26PM -0400, hendrik at topoi.pooq.com wrote:
> 
> I looked into LLVM for another language, with the idea of using its 
> in-memory interface and constructing the parse tree directly.  It turns 
> out that it does type calculation during parse tree construction.  THe 
> result is that any type I want to use has to be completely defined 
> before I can use it anywhere in the parse tree I'm trying to build.  For 
> compiler-synthesized records whose fields are invented while generating 
> the intermediate code that uses them, this turned out to be an 
> unacceptable ordering constraint.
> 
> There are ways around this by storing the entire intermediate code in 
> RAM as a kind of insertable-text data structure, and then writing it all 
> to a disk file, and then having the LLVM back end read that file .... 
> but it got messy.

By the way, I ended up using C-- for the project, which looks like a 
better-designed langauge, but with less of an organisation 
backing it for when things go wrong.  I ended uo using the 
insertable-text data structure to generate the C-- code, too.

But at least C-- was designed to have the text file be the primary form 
of inout;  LLVM was designed to have parse trees built in RAM by the 
front end.

-- hendrik.





More information about the M3devel mailing list