r/Compilers • u/TheIndieBuildr • May 25 '26
I built my own interpreted programming language in C from scratch
Hey r/Compilers,
I’ve been exploring interpreter and language implementation recently, so I started building Curio — a statically typed interpreted programming language written entirely from scratch in C.
One of the main goals behind the project was to design a language with syntax that feels as close to natural English as possible while still remaining relatively simple to tokenize and interpret procedurally.
English-like syntax design tradeoffsGitHub:
https://github.com/kashyap-devansh/curio
Example syntax:
make whole age
set age = 25
if age > 18 then
print "Access granted.<nl>"
endifThe current implementation uses:
- a handwritten tokenizer / lexer
- a direct-dispatch interpreter
- a custom symbol table
- forward-scanning block resolution (
endif,endwhile, etc.) - static type checking
- runtime diagnostics/error reporting
One design decision that became surprisingly interesting was intentionally avoiding AST generation for now and instead executing statements directly through a dispatcher-driven execution model.
That made the implementation much simpler initially, but it also introduced interesting tradeoffs around:
- expression handling
- operator precedence
- nested control flow
- future extensibility
Another interesting challenge was balancing:
- English-like readability vs
- keeping the grammar simple enough for a handwritten tokenizer/interpreter architecture.
Everything is implemented manually:
- no LLVM
- no parser generators
- no Flex/Bison
- no VM/runtime libraries
Future directions I want to explore:
- Pratt / recursive descent parsing
- AST generation
- bytecode + VM architecture
- function calls and stack frames
- better diagnostics and expression parsing
I’d especially appreciate feedback around:
- interpreter architecture
- parser/tokenizer design
- direct-dispatch vs AST tradeoffs
- language grammar decisions
- English-like syntax design tradeoffs
GitHub:
https://github.com/kashyap-devansh/curio
Attached a small demo GIF of the language running.
View all comments
Show parent comment
0
u/TheIndieBuildr May 26 '26 edited May 26 '26
Bro, Don't know why people on internet can't believe that I person can still code today without the need of ai
Surely i have used ChatGPT but it was only for clearing doubts but the entire code is written by me
And for your info I am just a first year student going in second year And this language Curio I made in the end of my first sem ( sem break ) and it took me about 20 days to build and i was so into this i when got eye strain and i can feel my nerve in my head because I was whole coding this language
And for the statement don't know git and markdown, it is now like i coding from childhood that i know everything from.. I know there is alot to learn .. I am learning in the way
If you still don't believe, I don't how can u believe that I wrote my language code on my own