Hacker News new | ask | show | jobs
by snovymgodym 142 days ago
No offense, but the source code for this is wild. It's almost like outsider art. https://github.com/pouyathe/glang/blob/main/source/dub/sourc...

Still, I have to respect the dedication it must have taken to get this working. I'm sure you'll go far.

My advice to you would be to read Crafting Interpreters by Bob Nystrom (it's free online) and try to apply some of the techniques from it to your project.

https://craftinginterpreters.com/

4 comments

"Outsider art" - that's one of the best descriptions I've heard! You're absolutely right.

Thank you for the book recommendation. I've just downloaded "Crafting Interpreters" and will study it properly. I've been coding in isolation (due to circumstances I can't easily explain), so learning from established resources like this is exactly what I need.

The messiness comes from years of solo experimentation without mentorship. I'm now committed to cleaning it up using proper techniques.

I appreciate both the kind words and the tough love.

Oh, we’re talking to an llm. Gross.
It hurts my eyes to see spelling mistakes in error messages. I know English is not your first language, but, dude, in the age of autocorrect and AI, it is sloppy and screams incompetence. Not what you want anybody to see when using your interpreter.

Otherwise, what a cluster*uck of a code this is.. I am amazed and appalled at the same time.

Man this is art
Everything was going reasonably OK until I got down to that gigantic rat's nest of if-else statements and embedded for loops. OMG
Yowza! Lines 1566-1637 consist entirely of closing braces. That's 70 closing braces in a row. Beyond the nightmare of maintenance, it's got to be a performance drag on the compilation.
Almost lisp-like, isn't it?)))))))