A modern C#-like language that compiles to 8-bit architectures (Z80)
$ dotnet add package RetroSharp.ToolRetroSharp is a modern C#-like language that compiles to 8-bit architectures, created for "The Joy of Learning®".
I'm making this in my free time to learn about compilers and some old-school topics. It combines the familiar syntax of C# with the nostalgic charm of retro computing. It's supposed to make me happier, but more often that not, it's making me get bald faster 🤣
RetroSharp uses a multi-stage compilation pipeline:
The benefit of this architecture is that the IL is generic enough to target virtually any platform by just writing a new backend.
Right now, RetroSharp can compile simple programs with:
ptr<T> syntaxExample program:
int main()
{
return 2 * 3 * 4;
}
Currently, RetroSharp targets the Zilog Z80 processor - one of the most iconic 8-bit CPUs of all time! The Z80 powered legendary systems like:
The modular design makes it relatively straightforward to add support for other 8-bit processors like the 6502, 8080, or even modern microcontrollers.
RetroSharp is distributed as a .NET tool:
dotnet tool install --global RetroSharp
Then use it to compile your programs:
retroSharp myprogram.rs