Hello, I'm lately pondering about a possibility to use Vala as embeddable language in applications. The main issue currently is the fact that Vala produces C files, a .so should be created and then loaded. A solution would be to use Clang. CLang offers an API to parse C code and then create a JIT'ed LLVM module that can be used at runtime without producing C files or calling external programs. Proposal: Step 1 - Generalize the Source concept, which is actually only concretized by SourceFile. I'd like to add a Source interface (or abstract class, whatever will fit better) and add a SourceMemory implemetation. This will affect lot of code, especially source references but should be trivial. Source will be based on a simple seekable API (possibly without streams/GIO). This will allow feeding a Vala file at runtime to generate an AST. Step 2 - Generalize the output concept in order to make the CCodeWriter write to a stream rather than a file. This will allow feeding the C output to Clang in order to create an LLVM module. Best regards, -- http://www.debian.org - The Universal Operating System
Attachment:
signature.asc
Description: Digital signature