Close

Simple Python Interpreter and Plan

A project log for Kyazuken: a Java-like language

Java is great. Could I roll my own?

Dylan BrophyDylan Brophy 10/26/2020 at 00:330 Comments

The interpreter can run simple programs but is basically a limited C interpreter for now

void main(String[] args) {
	println("Hello World!");
	if (1 + 1 == 2) {
		println("1 + 1 = 2!");
	}
	exit(0);
}

 This executes.  It's not super hard to get running because I had code from the last language I tried to make, written in Python 3 using rply.

I want a compiler that can compile itself.  So my plan:

  1. Write a basic compiler in Kyazuken
  2. Get the interpreter to interpret it
  3. Try to compile the compiler with itself in the interpreter

I want to output some intermediate language like RTL so I can generate machine code with GCC.  This way I could quickly generate compiled code for any processor.

Discussions