Skip to content

SuperJMN/SomeCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8fd630c · Apr 15, 2024

History

72 Commits
Dec 28, 2022
Apr 15, 2024
Jan 19, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Apr 15, 2024
Jan 19, 2024
Jan 19, 2024
Jan 19, 2024
Apr 15, 2024
Jan 19, 2024
Jun 8, 2022
Jun 8, 2022
Dec 28, 2022
Nov 18, 2022
Apr 15, 2024
Jul 18, 2022

Repository files navigation

Welcome!

This is "SomeCompiler", a little C-like compiler created for "The Joy of Learning®".

I'm making this in my free time to learn about compilers and some old-school topics. It's supposed to make me happier, but more often that not, it's making me get bald faster 🤣

How does it work?

Currently, it's able to compile very simple programs into a sort of intermediate language (IL for short) that is nothing more than 3-Address Code. The benefit of this IL, is that it's so generic that it can virtually be translated to any platform.

Then, the IL is targeted to a specific platform with a code generator. It basically converts IL into the actual binary format (or aseembly code).

What can it do?

Right now, it can compile a few simple programs like this:

int main() 
{ 
    return 2 * 3 * 4; 
}

Which platforms does it compile for?

It can compile for the Zilog Z80 processor only. I'm using it as a real platform to test the compiler 😊 But truth is that I almost know nothing about it apart from it being one of the most widely used processors of all time and part of systems like Nintendo Gameboy, Apple II, Commodor 64 and many others.

About

A little C-like compiler created for The Joy of Learning

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published