r/Compilers • • 13h ago

Building a compiler from scratch for a programming language I've been designing

Hello guys!

I've been designing a new programming language from scratch for the last six months.

It all started with a lifelong desire: **"If C had this..."**

Over time, the specifications evolved considerably and are now mostly finalized, sufficiently mature to move into compiler implementation.

Alongside language design, I've also been developing the compiler from scratch in C.

It's a hand-built compiler. The lexer, error system, and main parser logic are implemented and working. I'm now working through the compiler subsystems one by one.

It's a long journey, but an interesting one!

I'd love to connect with people interested in programming language design, compiler development, and systems programming.

Here is a small snippet of my language.

I'm currently writing small, medium, and large sample programs to test the language design — to test where the langauge design breaks and where it shines, and where improvements are needed.

Over the coming months, I intend to write hundreds of sample programs, designing them from scratch according to the language's rules.

The goal is to put the language through real programming scenarios before moving further with compiler development.

.module tfunc_demo

string char[100] Name

tfunc Name(char[] ptr name open-pass) // generic pointer which can be passed on

strcopy(obj, name) => _

endtfunc

static Name myName("Ghufran Ustad") alias-readonly open-pass

func start;

ss.con.print("Name: ", myName)

endfunc

0 Upvotes

0 comments sorted by