Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Java bindings for LLVM, now binding to LLVM 3.1 (code.google.com)
7 points by eli_gottlieb on July 12, 2012 | hide | past | favorite | 5 comments


This is awesome! Is there documentation anywhere on how to get this set up?

Also, does this mean you're resuming work on decac?


Fairly quick-and-easy documentation:

Download and untar the archive. You will need a Unix (OS X should work fine) machine with LLVM 3.1 installed (including its library headers in /usr/include/llvm-c). Once you've got those prerequisites, the command "ant build" will build the library and leave you with two files: jllvm.jar and libjllvm.so.

Put those where your Java Native Interface linker/loader can find the .so and your JVM can find jllvm.jar and its classes, and you should be able to link to the library and use the classes.

The classes themselves mirror, as best I could do, those in the official LLVM C++ interface. Method names and behavior should match the official ones.

I never actually stopped work on decac. If you browse the Hg repo, you'll notice a branch called "newsig" where I've been working for the past year. Around exactly a year ago, I noticed that decac could compile code examples, but could not link together different modules properly without crashing and lacked a region/effect system (and thus a way to properly handle memory allocation outside the stack).

Given those two problems were architectural, I rewrote the compiler around a "new signature" system for type, effect, and region signatures. This means I have to update the language report quite a lot, but it also has yielded a cleaner language and much cleaner code inside the compiler. Expressions are now described by one class rather than three, and there's a clean architecture for linking different modules together.


Thank you! I'll make another effort to play with jllvm soon.

Re decac, I had been periodically checking the bitbucket repo, but now I see that development is happening on Google Code. And it looks like this has a working compiler again, which is quite exciting. Can't wait to play with this again.


Thank you for asking this question. I had not heard of this work.

http://decac.googlecode.com/files/Deca%20Thesis.pdf

(and thank you, Eli, for the caveat below)


That file is a year out of date. It's only in the past few months that the language stabilized back down to a state where I can document it without the documentation going out of date.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: