Live data from Hacker News

Writing a basic x86-64 JIT compiler from scratch in stock Python

csl.name

1–10 of 52 posts

Re: Writing a basic x86-64 JIT compiler from scratch in stock Python

#4
post #3

That is awesome! Thanks! Does anybody know the easiest way to compile to JVM bytecode? I have a Scheme interpreter written in Kotlin, what is the best way to compile it, instead of interpreting? Where do I start?

The most widely used library for dynamic bytecode generation is asm: http://asm.ow2.org/

Re: Writing a basic x86-64 JIT compiler from scratch in stock Python

#5
post #3

That is awesome! Thanks! Does anybody know the easiest way to compile to JVM bytecode? I have a Scheme interpreter written in Kotlin, what is the best way to compile it, instead of interpreting? Where do I start?

Another possibility is using Truffle & Graal.

Re: Writing a basic x86-64 JIT compiler from scratch in stock Python

#7
post #3

That is awesome! Thanks! Does anybody know the easiest way to compile to JVM bytecode? I have a Scheme interpreter written in Kotlin, what is the best way to compile it, instead of interpreting? Where do I start?

Another alternative to jcdavis answer, is to just output bytecode in text format and use jasmin to compile it.

http://jasmin.sourceforge.net/

Or have a lookt at Kawa.

https://www.gnu.org/software/kawa/

Re: Writing a basic x86-64 JIT compiler from scratch in stock Python

#8
post #5
post #3

That is awesome! Thanks! Does anybody know the easiest way to compile to JVM bytecode? I have a Scheme interpreter written in Kotlin, what is the best way to compile it, instead of interpreting? Where do I start?

Another possibility is using Truffle & Graal.

[deleted]

Re: Writing a basic x86-64 JIT compiler from scratch in stock Python

#9
post #3

That is awesome! Thanks! Does anybody know the easiest way to compile to JVM bytecode? I have a Scheme interpreter written in Kotlin, what is the best way to compile it, instead of interpreting? Where do I start?

Examples of Lisp-2 compiler using Java and ASM:

Shen to JVM bytecode compiler in Java 6 https://github.com/otabat/shen-jvm

Shen to JVM bytecode compiler in Java 8 with indy https://github.com/hraberg/Shen.java

Post reply on HN