I have written a JVM in Rust
51–60 of 185 posts
Re: I have written a JVM in Rust
#52Shameless plug of my similar project: https://github.com/tenaf0/rust-jvm3
Re: I have written a JVM in Rust
#53Also note that I cloned the repo and tried to run `cargo test` every test fails with 'should be able to add entries to the classpath: InvalidEntry(".../vm/rt.jar")' vm/tests/integration/real_code_tests.rs:15:10
[1] https://github.com/andreabergia/rjvm/blob/be9c54066c64a82879...
[2] https://manishearth.github.io/blog/2021/04/05/a-tour-of-safe...
[3] https://without.boats/blog/shifgrethor-iii/
[4] https://coredumped.dev/2022/04/11/implementing-a-safe-garbag...
Re: I have written a JVM in Rust
#54Earlier quoted context omitted.
Thanks, makes sense yes. Still if the JVM look up in all cases defers to value after ref mismatch, it should work identically, no? Even if interning is mandatory as per spec, I'm not sure how it'd change the outcome of evaluation.
yeah, I'd assume as much. If it indeed falls back to a by-value comparison it would be slower, but should work.
Re: I have written a JVM in Rust
#55Earlier quoted context omitted.
pretty much this - generics have (rare) implications to the reflection (but it's unsupported as well) but overall they are replaced with the nearest class/interface when compiled. OTOH lack of string interning is super strange [it's trivial to implement], and w/o it JVM is not a thing. String being equal by reference is important, and part of JLS. Lack of thread makes the entire endeavor a toy project.
> Lack of thread makes the entire endeavor a toy project. yeah, as stated by the author in the line that says "I want to stress that this is a toy JVM, built for learning purposes and not a serious implementation."
Re: I have written a JVM in Rust
#56Earlier quoted context omitted.
“I want to stress that this is a toy JVM, built for learning purposes and not a serious implementation.”
The rest of the stuff, incl. I/O is actually on the trivial side - threads do require planning. This is what I meant by being a 'toy' project, threads (and JMM) would be impossible to bolt in later on.
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 implementation."
Thus, absolutely no one disagrees that its a toy JVM. They just want you to stop being dismissive of someone's toy project by repeatedly pointing out its a toy project and not a "not a thing"
Re: I have written a JVM in Rust
#57Earlier quoted context omitted.
Thanks, makes sense yes. Still if the JVM look up in all cases defers to value after ref mismatch, it should work identically, no? Even if interning is mandatory as per spec, I'm not sure how it'd change the outcome of evaluation.
Yes - that is a performance optimisation. I don't think comparing everything by value makes or breaks the implementation.
Nothing much to think -- distinct objects must have distinct references [e.g. new String("a")!=new String("a')], literals must have the same references for the same values [e.g. "a"=="a"].
Re: I have written a JVM in Rust
#58Earlier quoted context omitted.
The rest of the stuff, incl. I/O is actually on the trivial side - threads do require planning. This is what I meant by being a 'toy' project, threads (and JMM) would be impossible to bolt in later on.
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…
Re: I have written a JVM in Rust
#59Earlier quoted context omitted.
The rest of the stuff, incl. I/O is actually on the trivial side - threads do require planning. This is what I meant by being a 'toy' project, threads (and JMM) would be impossible to bolt in later on.
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…
Re: I have written a JVM in Rust
#60Great 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.
Uh, first time hearing mmtk. Thanks for the link!