platypusguy / jacobin

A more than minimal JVM written in Go and capable of running Java 17 classes.
http://www.jacobin.org
Mozilla Public License 2.0
677 stars 28 forks source link

Implementation idea of the verifier #199

Open Thihup opened 3 weeks ago

Thihup commented 3 weeks ago

Hello!

I'd like to suggest an idea for the implementation of the verifier. As it is one of the most complex areas to implement fully, I was thinking that maybe it would be possible to include the Prolog code that is in the specification (https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.10) and use some Prolog interpreter, like https://github.com/ichiban/prolog to run it.

This way it can both simplify the implementation and also help validate that the Prolog source code provided in the specification works as expected :)

platypusguy commented 3 weeks ago

Hello Thiago!Thank you for this suggestion and thank you also for your longstanding interest in Jacobin. We're finishing up the interpreter at the moment and haven't given much thought to how to translate the Prolog validation definitions in the JVM spec. So, I really appreciate you pointing us to this project, especially because it is written in go, which allows us to continue with our goal of a JVM written entirely in go. I'll save your suggestion for when we get into the validation phase. Again, thank you!