Skip to content

Proof-Of-Concept

Latest
Compare
Choose a tag to compare
@LouisJenkinsCS LouisJenkinsCS released this 23 Aug 18:56
· 2 commits to main since this release

Release 1.0

Established a clear proof-of-concept implementation of the JVM. It works with very simple Java and Scala programs , which is MUCH more than anticipated.

How To Run

Minimal-JVM.exe, unfortunately, must be ran in a directory with the file structure...

Examples
 |-> Java
       |-> ArithmeticTest.class
       | -> ConditionalTest.class
 |-> Scala
       |-> ArithmeticTest.class
       | -> ConditionalTest.class

One way of doing so is to clone the entire project, or at least checkout Examples folder. If you wish to supply your own, you must be careful with the instructions to use. Currently, only conditionals and arithmetic are supported, but not 'switch...case' statements as they involve jump tables, as well conversion between types aren't supported as I was too lazy. If you look at the the files, those are the ONLY safe instructions, with exception of a few more. Again, this is a toy JVM.

For Scala files, the compiler produces two .class files, a normal one, and one with a '$' suffix before the extension. The former should be deleted, the latter should be renamed to one without that suffix.

Easier Way To Run

An easy way to run is download one of the test files in the source directory (I.E: Examples/Java/ArithmeticTest.class) and run it from the Downloads folder (assuming you use Windows). Of course it should be ran from a command line, you can then specify the name of the '.class' file you downloaded with the Custom option.

How to Run On Linux

Tested on Pop_OS! to run under wine Minimal-JVM.exe

wine-5.0 (Ubuntu 5.0-3ubuntu1)