Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've never had the opportunity to write code for a compiler but it's something that's always been pretty interesting to me so I decided to write a little toy calculator:

calc("1 + 3 / 5")

It was a pretty fun project as you get to do some parsing/lexing, work out how to execute it (function ordering etc.) and then have lots of fun little avenues you can go down (brackets for specifying execution order, adding more functions, arbitrary precision maths etc.)



This brings me back to my uni days, where in a Programming Languages class we had to develop a project that used any topic covered in the semester, and I chose lexical tokenization thinking to myself "it can't be that hard, right?" and oh boy.

15 years later I still have nightmares about coding in that project, running late and failing class, and dropping out of uni.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: