oracle / graaljs

A high-performance, ECMAScript compliant, and embeddable JavaScript runtime for Java
https://www.graalvm.org/javascript/
Universal Permissive License v1.0
1.8k stars 190 forks source link

GraalJS should support Ahead-of-Time(AOT) compilation to Native binary like GraalPy. #818

Open Foxchandaisuki opened 5 months ago

Foxchandaisuki commented 5 months ago

GraalPy, which is Python implication of the GraalVM, supports AOT compilation to Native binary.

GraalPy is compiled ahead-of-time to a native executable. This means that you do not need a JVM to run GraalPy and it is compact in size.

In time of now, most of main implications of Python and JavaScript do NOT support AOT compilation.

For example, NodeJS , Deno, and even Bun only supports Just-in-Time(JIT) compilation and they have no plan to support AOT.

However, the case of GraalPy shows us that making Script language to be compiled to Native binary is technically possible. And already there is an AOT compiler for Javascript like ChowJS, but unfortunately it is a closed source, and maybe a project NOT free of charge.

Static Hermes, which is being developed by Meta shows us that AOT compiling of JavaScript could be a killer feature of the project.

mio-19 commented 6 days ago

I read that GraalPy only compile python to bytecode? Still it is useful to do parsing on build time. I am trying to integrate a JavaScript library into my JVM application and call it from JVM. It would be better to include bytecode instead of source code in the native image