HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Project Sulong: an LLVM bitcode interpreter on the Graal VM with Matthias Grimmer @grimmer_m

Java · Youtube · 2 HN points · 1 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Java's video "Project Sulong: an LLVM bitcode interpreter on the Graal VM with Matthias Grimmer @grimmer_m".
Youtube Summary
Although the Java platform has been used as a multi-language platform, most of the low-level languages (such as C, Fortran, and C++) cannot be executed efficiently on the JVM. We propose
Sulong, a system that can execute LLVM-based languages on the JVM. By targeting LLVM IR, Sulong is able to execute C, Fortran, and other languages that can be compiled to LLVM IR. Sulong
comprises an LLVM IR interpreter based on the Truffle language implementation framework, that uses the Graal compiler to compile frequently executed functions to machine code, which combines LLVM's static optimizations with dynamic compilation.
The presentation is structured into three parts:
- Part I: Architectural Overview
- Part II: Native interface implementations with Sulong
- Part III: Memory safe execution of C/C++ code

Project https://github.com/graalvm/sulong
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Graal only knows about JVM bytecodes, and there isn't any emulation of pointer arithmetic.

You need first to understand the role of Truffle in this.

It is a framework to generate AST interpreters, that plugs into Graal.

So an interpreter for LLVM gets written in Truffle, which while running a specific LLVM application, generates an interpreter for that specific code, so after awhile the JIT comes into the picture optimizing the generated interpreter that is processing that LLVM code.

This goes a few rounds until it becomes almost indistinguishable from generating the code straight from LLVM.

It is the same principle behind using PyPY and RPython to add new languages into PyPy.

JRuby is one of the projects making use of this infrastructure to run C extensions.

Naturally due to the slow startup until everything is finally converted into native code, this approach is only usable for long lived server based applications.

You can get more information about it in some of these links, mostly outdated though.

https://llvm.org/devmtg/2016-01/slides/Sulong.pdf

"Using LLVM and Sulong for Language C Extensions - LLVM Cauldron 2016"

https://www.youtube.com/watch?v=bJzMfYX6n9A

"Project Sulong: an LLVM bitcode interpreter on the Graal VM"

https://www.youtube.com/watch?v=yyDD_KRdQQU

int_19h
Regardless of how it gets there in the end - from an interpreter or otherwise - if it produces pure JVM bytecode, that means that the memory model is also JVM. How does that accommodate the C memory model? Emulating heap with giant arrays?
pjmlp
Most likely yes, which doesn't matter, because Graal will eventually optimize bounds check away anyway, as it does for regular Java code.

The links that I provided go into detail about all of this.

Aug 03, 2017 · 2 points, 0 comments · submitted by pjmlp
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.