Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It is a matter of implementation and tooling, not language.

Anyone is free to create a native AOT compiler for Clojure.

In fact many attempted to do so, but have given up due to the effort it means bringing a full eco-system up to speed to what Clojure already enjoys in JVM, .NET and JS runtimes, libraries and tooling.

Specially in quality of generated native code and GC implementations.



sort by: page size:

Any JVM based language can in theory be AOT compiled to native code.

There are quite a few commercial JDKs with option to AOT compile to native code.

Of course, if one wants to stay in the realm of free, the existing options aren't that great.


You missed the part that AOT native compilers for JVM languages already exist today, but I accept that people don't want to pay for them.

There are quite a few AOT native compilers available for Java, actually all commercial JDK ones.

Since 2000 AOT compiling into native code has been available to Java developers, no different from using something like Go.

That many didn't want to buy those compilers and settled with the free beer that could get hold of is another matter.


Obviously not if you are comparing it to the OCaml bytecode compiler, now doing a full AOT compilation to native code depends pretty much how those 3rd party libraries are delivered and optimization levels being used.

Not really, Java always had AOT compilers to native code, they just happened to be commercial and we all know how modern developers love to pay for their tools.

Scala, Clojure, F# also allow it, with the added benefit of industrial strength JIT/AOT compilers.

Java bytecode is what we mean when we say 'compile'. AOT is 'ahead of time' with regard to clojure, since it compiles to bytecode at run-time normally.

Thanks for taking the time to respond!

I'd love a Java AOT compiler that produces native binaries with no additional dependencies. (I'd even be okay if, as a side effect, some Java features were not supported, making it technically not-Java.)

For small tools and utilities, the JVM requirement is quite onerous, especially when one does not know if the end user has Java installed, or if they do, what version.

Alas, the company I work for will not budget for a Java AOT compiler, and for my hobby programming, the commercial Java AOT compilers are far too expensive to justify.

I'll just keep hoping a good and free (or inexpensive) Java AOT compiler becomes available some day. I would even donate money and/or code if a serious project started.


Yes, there were AOT compilers availbe for Java since 2000. But more recently, Graal creates very nice binaries.

Actually, there used to be GCJ which was a free AOT compiler for Java

Because plenty of managed languages do support AOT compilation to native code, including Java.

Yes, the fact being that there are a few commercial native AOT compilers for Java and all FOSS alternatives for AOT compilation fail to get any community support.

The free AOT compilers have atrocious compile times (far, far worse than even Rust or Scala) and don't support all of the features so library support is extremely fragile. A lot of extremely popular Java libraries make extensive use of runtime reflection and none of the AOT compilers handle it well without a lot of extremely error prone manual configuration.

I actually like Java and the JVM but if AOT compilation and efficient memory usage is what you want Java is definitely not the language to use.


Sure there is, all commercial JVMs support AOT compilation to native code.

That most don't want to pay for them is another matter.


if you mean clojure AOT, it precompiles clojure to jvm bytecode. Usually the term JIT in this context is used to describe the native code generated by the VM on the flight, not the on the flight VM bytecode generation performed by a higher level language like clojure.

EDIT: sorry, probably your referred to http://publib.boulder.ibm.com/infocenter/java7sdk/v7r0/topic...


I believe there are relatively many AOT-compiled-to-native-code languages other than C.

Java has always been native to those that knew where to buy native code AOT compilers.

Unless you mean D, Go, Haskell, OCaml aren't native.


Well, you could already AOT compile with NGEN, even though it isn't an optimizing compiler and requires dynamic linking.

Or Mono.

But I am with you, when Java and .NET came out, in both cases I thought it was a missing opportunity not having a full set AOT/JIT options similar to other languages.

You could get them, but NGEN required the framework to be present anyway and on Java's case the only good AOT compilers have always been commercial.

So I would remember Turbo Pascal, Delphi, Eiffel and many others with some envy.

next

Legal | privacy