Try the online LLVM demo to compile bits of C code into LLVM intermediate representation. Also you can meet Bitter Melon, one of the smartest cats I have been introduced to. Most cats are not very good programmers, because they are too easily distracted.
Thanks Kristy for the tip.
Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts
Wednesday, February 17, 2010
Tuesday, February 16, 2010
llvm travails
I am now zero for three on compiles of llvm + Clang on ix. It seems that the nearness to a new release is indeed causing difficulties ... every time I do "svn update" I get several newly updated files. The first compile took 3+ hours; subsequent compiles have been a little faster. I'll give it a couple more tries before I admit defeat and either pull an older version from SVN or try put together a binary-only set.
Friday, December 18, 2009
Tools
If you want to get a head start looking at tools, here are some that we are (almost certainly) going to use in winter 2010:
A couple of you have said you would like to build the compiler project using ML (OCaml?) rather than Java. JFlex and Cup are Java tools, and you'll be on your own to find equivalent ML tools. LLVM has an API with an OCaml binding, so you may actually have an advantage there, because as far as I know there is no Java binding. With Java, we will simply be printing LLVM intermediate assembly code into a text file, which we will then run the LLVM assembler on. I'll probably ask the MLaniacs to also produce a textal IR file, so I have something I can look at for grading.
Know what's missing? The whole middle piece, static semantic analysis, including type checking. For that we are probably just grinding out code by hand. Maybe someday we'll have good tools for that, too, but at present I don't know of any. The only way to keep that effort reasonable is to keep the language we compile as simple and regular as possible. I'm considering a couple of candidates, and have not made a final choice yet, but it's certain to be a small object-oriented language that is something like a tiny subset of Java (though perhaps with a couple non-Java-ish features).
- JFlex (lexical analyzer generator, aka scanner generator)
- CUP (parser generator)
- LLVM (code generator). We will generate intermediate code, and LLVM will either interpret it directly (acting as a just-in-time compiler, similar to a JVM) or generate assembly language for a particular target machine (e.g., Intel x86 or Sparc) that we can then assemble into binary object code and execute.
A couple of you have said you would like to build the compiler project using ML (OCaml?) rather than Java. JFlex and Cup are Java tools, and you'll be on your own to find equivalent ML tools. LLVM has an API with an OCaml binding, so you may actually have an advantage there, because as far as I know there is no Java binding. With Java, we will simply be printing LLVM intermediate assembly code into a text file, which we will then run the LLVM assembler on. I'll probably ask the MLaniacs to also produce a textal IR file, so I have something I can look at for grading.
Know what's missing? The whole middle piece, static semantic analysis, including type checking. For that we are probably just grinding out code by hand. Maybe someday we'll have good tools for that, too, but at present I don't know of any. The only way to keep that effort reasonable is to keep the language we compile as simple and regular as possible. I'm considering a couple of candidates, and have not made a final choice yet, but it's certain to be a small object-oriented language that is something like a tiny subset of Java (though perhaps with a couple non-Java-ish features).
Subscribe to:
Posts (Atom)
