Hacker News new | past | comments | ask | show | jobs | submit login

Re the startup time: native images are intended to reduce startup time of Java code, as they AOT compile Java. Other languages are not, AFAIK, AOT-compiled, and so reducing startup time is not a goal -- overall performance is.



We get this confusion every time we talk about native compilation. GraalVM can do ahead-of-time compilation of Java code. That Java code could be an interpreter for JavaScript, written in Java. But GraalVM cannot do ahead-of-time compilation of JavaScript. We struggle to always make this clear.

And it's actually more complicated than that:

Of course GraalVM can compile JavaScript to native code, it just only does it at runtime, as a JIT.

GraalVM can run JavaScript during ahead-of-time compilation, so you can run your JavaScript program so far, and then compile it at that point with all its state compiled into the image. We use this to do things like pre-initialise libraries ahead-of-time so when you start to run everything is set up and ready to go.

Finally, the mathematical trick we use to compile JavaScript to native code at runtime, which is called partial evaluation, or more formally, the First Futamura Projection, has a theoretical more advanced variant called the Second Futamura Projection, which could be implemented in GraalVM to, indeed, compile JavaScript ahead-of-time to native code. But implementing this practically is an open problem and not really our goal.


How do you people get this much knowledge about programming and maths?


I wish people stopped using niche terms as a) if they were common knowledge, and b) as if they were crucial to the discussion at hand. It's much more intuitive to explain what's going on and then say that what is described is also known as ___.

The Futamura Projections can be explained in about three lines and is not at all a complex concept to wrap your head around.

Casually inserting these terms in a forum where most people likely haven't had much exposure to partial evaluation terminology makes it sound like you want to either forcefully polularize these terms or make yourself sound more important.

...not saying you intended either.


I think you are wrong about this. Contrary to a normal conversation, specific vocabulary used on the internet can be instantly looked up. This allows for diving more into the topics if they interest you.




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

Search: