Live data from Hacker News

Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

graalvm.org

11–20 of 141 posts

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#11
post #8
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Java isn't as performant as C++. BTW, how do you implement a garbage collector with a garbage-collected language?

> BTW, how do you implement a garbage collector with a garbage-collected language?

You write it carefully so the garbage collector itself doesn't also need to allocate objects.

Here's a GC for Java written in Java https://github.com/oracle/graal/tree/master/substratevm/src/....

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#12
post #5
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Maybe it's my ignorance of the Java ecosystem or a lack of imagination but how could a language that requires a heavy runtime be written in itself? Wouldn't you need a runtime for the runtime, and then a runtime for the runtime for the runtime and then...? I can't quite imagine how you'd bootstrap something like that.

It's no different to writing any other compiler for Language X in Language X, and that's a really common thing to do. The Java compiler emits files containing Java Bytecode which are subsequently run by a different invocation of the JVM.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#13
post #8
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Java isn't as performant as C++. BTW, how do you implement a garbage collector with a garbage-collected language?

You carefully avoid allocation.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#14
post #8
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Java isn't as performant as C++. BTW, how do you implement a garbage collector with a garbage-collected language?

[deleted]

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#15
post #5

Earlier quoted context omitted.

Maybe it's my ignorance of the Java ecosystem or a lack of imagination but how could a language that requires a heavy runtime be written in itself? Wouldn't you need a runtime for the runtime, and then a runtime for the runtime for the runtime and then...? I can't quite imagine how you'd bootstrap something like that.

You implement the runtime itself in Java, and you use that runtime to run your runtime.

Exactly, implementing the runtime is the bootstrapping (apart from the compilation of course). There is no implementing the runtime that implements the runtime that implements the runtime.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#17
post #16
post #4

somehow I'm in disbelief. as in - why is this news #1?

Java isn't cool and most HN'ers aren't interested in it.

Even though majority of HN'ers write Java code (judging by the numerous developer surveys from various companies).

It may not be hot and cool like some hip new language, but Java work is very important and quite literally makes the world work.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#18
I don't say nice things about Oracle very often, but they deserve some praise here. Graal is a very, very ambitious project, and Oracle has been funding it for years. It's still rough around the edges, but it promises to enable new programming languages to run on a high-performance JVM, compiled to native code. Write-once, run anywhere, at native speed. And now they're donating it. It's very decent of them.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#19
post #8
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Java isn't as performant as C++. BTW, how do you implement a garbage collector with a garbage-collected language?

This is kinda diving into the deep end, but this is a great overview - https://mitp-content-server.mit.edu/books/content/sectbyfn/b...

the gist is you treat memory as a big array, then write a program to manipulate that array. it's really just a decision about what you want to "take as primitive" in your implementation. could be brk, could be malloc and free, or something higher level.

Re: Oracle Contributing GraalVM Community Edition Java Code to OpenJDK

#20
post #5
post #3

Earlier quoted context omitted.

It's a good point, after so long why the JVM is not written in Java actually? For example the Go runtime and I think C# as well are written in their respective language. https://github.com/golang/go/tree/master/src/runtime https://github.com/dotnet/runtime

Maybe it's my ignorance of the Java ecosystem or a lack of imagination but how could a language that requires a heavy runtime be written in itself? Wouldn't you need a runtime for the runtime, and then a runtime for the runtime for the runtime and then...? I can't quite imagine how you'd bootstrap something like that.

You can write a C compiler in Java. The output of the C compiler doesn't depend on the JVM, it would be a regular old program written in C. Writing a Java runtime would be similar, the output would be an executable that doesn't depend on the JVM.
Post reply on HN