r/programming • • Jul 05 '15

Fast as C: How to write really terrible Java

https://vimeo.com/131394615
1.1k Upvotes

394 comments sorted by

View all comments

Show parent comments

33

u/__Cyber_Dildonics__ Jul 05 '15

I've been hearing promises like this from Java for literally two decades, so I'll believe it when I see it.

I wonder how they will get around the array bounds checking if it is going to work the same?

9

u/mike_hearn Jul 05 '15

Intel has been directly implementing the support in recent times, e.g.

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2015-April/017631.html

I think people always overestimate how quickly compilers can get better though. It does seem to take forever.

One interesting project in the JVM world right now is Graal. It rewrites the HotSpot compilers, in Java (boggle). The app starts with the compiler compiling itself. They plan to have AOT compilation as part of it to avoid this overhead at some point. But the idea is that it becomes a lot easier to implement new fancy compiler technologies and refactorings when you aren't writing it in C++.

6

u/[deleted] Jul 06 '15

It rewrites the HotSpot compilers, in Java (boggle).

What is with the boggle? Most things are written in themselves. C is written in C. Java is written in Java. Scala is written in Scala.

1

u/mike_hearn Jul 06 '15

Sure, I know how it works, but bear in mind Graal compiles itself on the fly at runtime.

1

u/Chii Jul 06 '15

without having done any research, i assume it's running an interpreted version of itself, but passing itself as the target for optimization/JIT'ing?

3

u/mike_hearn Jul 06 '15

Yeah, it starts out by interpreting itself. A few manually chosen methods are then inserted into the compile queue at the start to kick things off and speed it up, and the rest goes from there.

3

u/headius Jul 05 '15

Look into Project Sumatra. It's real and it works now. The next step is figuring out how it should look in a production JVM release.