Live data from Hacker News

I have written a JVM in Rust

andreabergia.com

61–70 of 185 posts

Re: I have written a JVM in Rust

#61
post #58

Earlier quoted context omitted.

The reason you're being downvoted is you keep dismissing this as a "toy" project, and pointing out that it would be hard to make a real project. But, as the previous commenter attempted to point out to you this project is a *self-described* toy project. On the very page that is linked, the author of the JVM specifically says: "I want to stress that this is a toy JVM, built for learning purposes and not a serious impl…

Right, just because something is a "toy" doesn't mean it's not still impressive. If someone implemented a "toy" database that could parse and execute SQL queries, distribute data across nodes, etc., you would probably not want to use that in production, but it's still a very impressive project for a single person to pull off, even if it's riddled with bugs. Getting a very complex system to "just barely functional" is…

Being impressing or otherwise is very subjective.

SQL (ACID) over multiple non-cache-coherent nodes is extremely difficult to pull with regards to consistency, though.

Re: I have written a JVM in Rust

#62
post #59

Earlier quoted context omitted.

The reason you're being downvoted is you keep dismissing this as a "toy" project, and pointing out that it would be hard to make a real project. But, as the previous commenter attempted to point out to you this project is a *self-described* toy project. On the very page that is linked, the author of the JVM specifically says: "I want to stress that this is a toy JVM, built for learning purposes and not a serious impl…

I've pointed the only part that makes it a toy project is the lack of Threading support, the rest is not hard to add. So the items in list of things missing after 'toy' thing should have totally different weights (with Threads being the added to the last).

You're still missing the point—it was always intended to be a toy project, and the author has explicitly declared that they are completely done with it and won't be doing any more work. What does it matter how they sort the list of missing items? It's not a todo list in need of prioritization, it's just an "FYI, these are some of the things I never got to".

Re: I have written a JVM in Rust

#65
post #16

How often will this post be reposted on HN ? Recent posts: https://news.ycombinator.com/item?id=36735344 - 6 days ago https://news.ycombinator.com/item?id=36717967 - 7 days ago https://news.ycombinator.com/item?id=36710803 - 7 days ago (OP) Btw. nice project!

Getting the attention needed for front page is a huge chance. I've seen great stuff get posted 5 or more times before it makes it out of obscurity. HN is highly non-deterministic in these things.

Re: I have written a JVM in Rust

#66
post #44

Earlier quoted context omitted.

He's not saying that. What he is saying is that are simple, non-production quality implementation in Scala is much more amenable to experimentation than a sophisticated, production-quality implementation in C++ that weighs in at 300x the LOC.

But a simple non-production quality implementation in C++ would also be amenable to experimentation and not have the bootstrapping issues as well as provide an easier starting point to incorporate more of the existing optimizations as desired.

That is true, but the author of Metascala wanted to write it in Scala. Other people are free to write a simple C++ implementation of the JVM themselves.

Re: I have written a JVM in Rust

#67

Great learning project, I'm glad the author is having fun. Implementing a VM from scratch is a blast, and I have learned so much in the past doing that kind of thing. If they're interested in bolting on a GC, it couldn't hurt to look at MMtk. ( https://www.mmtk.io/ ) Some high quality collection algorithms, written to be pluggable to various VMs, and written in Rust.

Note that MMTK is x86 only. I was going to use it for a toy project but I have a Mac.

That's a bummer -- I guess I never noticed that, when I played with it before it was on an M1 Mac, but compiled into an x86 Julia executable & running through Rosetta (which surprisingly did not suck).

Haven't read, but I bet it's likely related to expectations around the x86_64 memory model & atomics. In the long run I see no reason why it couldn't be made portable, but I imagine the authors efforts are elsewhere for now.

Re: I have written a JVM in Rust

#68

I have a few questions about the garbage collection. One of the hard parts of implementing a garbage collector is making sure everything is properly rooted (especially with a moving collector). you have the `do_garbage_collection` method marked unsafe[1], but don't explain what the calling code needs to do to ensure it is safe to call. How do you ensure all references to the heap are rooted? This is not a trivial pro…

It's pretty straightforward. Their VM maintains its own notion of a callstack instead of using the native callstack. That lets them iterate over it and find all of the parameters and locals on the VM's callstack and use them as roots.

There is a performance cost for a VM having its own virtual callstacks like this, but it makes GC tracing much simpler. (It also makes implementing interesting concurrency and control flow primitives like coroutines or continuations much easier too.)

Re: I have written a JVM in Rust

#69
post #44

Earlier quoted context omitted.

He's not saying that. What he is saying is that are simple, non-production quality implementation in Scala is much more amenable to experimentation than a sophisticated, production-quality implementation in C++ that weighs in at 300x the LOC.

But a simple non-production quality implementation in C++ would also be amenable to experimentation and not have the bootstrapping issues as well as provide an easier starting point to incorporate more of the existing optimizations as desired.

Probably not, because JVM users are much more likely to be more proficient in Scala/Java than in C++.

Re: I have written a JVM in Rust

#70
post #7

See also https://jacobin.org/ for JVM 17 written in Go.

That is a very interesting name for a programming project lol. The Jacobins were a revolutionary political club during the French Revolution in the 1790's. It's also the name of a magazine at https://jacobin.com
Post reply on HN