Close

Python compiler

A project log for Schön Core

Schön Core is a series of Central Processing Units ( CPU ) based on the Scott Architecture by J. C. Scott

kim-chemnitz-chemnitzKim Chemnitz Chemnitz 04/11/2019 at 17:060 Comments

For some months ago I began to program in python to try to make a compiler for my CPU, and after many days and hours in trying to make it, I am finally done, I've made a simple compiler which is somewhat equivalent to assembly (mind You I've never made something like that before, and it was quite hard to begin, but got done in the end), then I made a relatively higher level compiler which can create a for loop in the first compilers language.

I made a simple nested for loop where to check if any number from 2 to 9 is prime, and after compiling the program, I got the results:

2 is prime,

3 is a prime,

4 is not a prime,

5 is prime,

6 is not a prime,

7 is prime,

8 is not prime and

9 is not prime

Discussions