very neat! this seems like the sort of thing that racket should be really good at doing (and there are llvm bindings)
ideally you could have something that just takes an AST represented as s-expressions and transforms it directly into an AST in LLVM’s internal representation by walking the tree and calling the appropriate API functions - closer in spirit to an assembler than a compiler, but with a nice textual representation to work with and the ability to write racket code to generate it.
Clasp does this, among other things, to interface with MPS
ej. Using Common Lisp to refactor C++
Yeah, agreed; I had a similar thought that s-exprs would be a good fit for this.