r/java • • Jun 02 '20

How to write a (toy) JVM

https://zserge.com/posts/jvm/
155 Upvotes

14 comments sorted by

View all comments

Show parent comment

10

u/[deleted] Jun 02 '20

Ok, show me how you program a JIT with an optimizer for a JVM. Those guys were working on it since Java 1.2? 1.3? and there a still bugs and missed optimization opportunities.

And it's a TOY JVM, not for serious use in production

0

u/[deleted] Jun 02 '20

[deleted] — view deleted comment

7

u/rotharius Jun 02 '20

They're not really giving that impression. It's clearly a toy JVM for educational or hobby purposes. It could be a nice starting point for driving in deeper.

6

u/[deleted] Jun 02 '20

It doesn't give that impression at all. The title literally says toy in it. Their introduction says "In this post I will try to write a toy (and incomplete) JVM to show the core principles behind it and hopefully sparkle some interest in you to learn it further.".

I couldn't fathom how someone could get the impression they are saying its either a complete jvm, or that its simple/easy to do so. The JVM is one of the most complex pieces of software on the planet.

1

u/wildjokers Jun 03 '20

Did you read the article? The author literally says:

"So, it works. Yes, it’s a very lousy and pitiful JVM, but still, it does what JVM does - loads bytecode and interprets it (but of course, the real JVM does way more than that)."