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

"breaking things down into the right primitives" is the real key to programming. There are many books and web pages about algorithms, but I wish there were more searchable and browsable resources for how to approach problems through primitives.




The process of breaking a complex problem down into the right primitives requires great understanding of the original problem in the first place.

Whats blocking me during programming usually are edge cases I had no idea about. Its still hard to find good material on compilers if you are not into reading dry ass books. Thats a me problem though, I simply cant force myself to read boring factual only content (one of the reasons as to why I love beejs guides).


> The process of breaking a complex problem down into the right primitives requires great understanding of the original problem in the first place.

Yes, but with experience that just becomes a matter of recognizing problem and design patterns. When you see a parsing problem, you know that the simplest/best design pattern is just to define a Token class representing the units of the language (keywords, operators, etc), write a NextToken() function to parse characters to tokens, then write a recursive descent parser using that.

Any language may have it's own gotchas and edge cases, but knowing that recursive descent is pretty much always going to be a viable design pattern (for any language you are likely to care about), you can tackle those when you come to them.


There is a good body of literature that is distinct from the academic compiler literature.

https://t3x.org/

https://compilerbook.com/

https://interpreterbook.com/

https://www.craftinginterpreters.com/

R. G. Loeliger Threaded Interpretive Languages Their Design And Implementation https://news.ycombinator.com/item?id=43973544

https://github.com/IUCompilerCourse/Essentials-of-Compilatio...

And check out Andy Keep's Nanopass Compiler work, https://nanopass.org/




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

Search: