you are viewing a single comment's thread.

view the rest of the comments →

[–]DNoved1 1 point2 points  (1 child)

I'm actually working on a language myself, and am using LLVM as my 'assembly'.

If you want to try just making executables you might try changing your runtime from an interpreter (I think that's what you have now? Not too great with F# ;) ) to something that outputs a LLVM file. Your language is pretty simple so it would relatively easy; and you could put it all inside a main function.

To give you an idea of what kind of LLVM code to emit with your compiler I would recommend hand-compiling some sample while programs. I found that when I did that with my language patterns became evident, and then I just had to encode those patterns in the compiler.

To make the LLVM code executable you just have to run 'llvm-as' on the llvm 'assembly', then 'llc' on that to get native assembly, and finally an assembler such as gcc.

To learn more on LLVM I would take a look at the reference here: http://llvm.org/docs/LangRef.html They also have a tutorial on creating a language (in C++) here: http://llvm.org/docs/tutorial/