Back to front pageView on Hacker News (opens in a new tab)Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years agoPreferably an elegant snippet rather than an entire (well engineered) codebase.Comments (380) 116 threadsShow all commentsShowing thread 14 of 116[-]numlock867 years ago1 reply#I think c4 (a C compiler in four functions, hence the name) is pretty neat.https://github.com/rswier/c4/blob/master/c4.cuserbinator7 years ago#That's my choice too. It's a C-subset, but more than a compiler; it includes a bytecode VM interpreter too. The best part about it is that it's tiny, yet very readable for its size and functionality.
Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years ago
numlock867 years ago1 reply#I think c4 (a C compiler in four functions, hence the name) is pretty neat.https://github.com/rswier/c4/blob/master/c4.c
userbinator7 years ago#That's my choice too. It's a C-subset, but more than a compiler; it includes a bytecode VM interpreter too. The best part about it is that it's tiny, yet very readable for its size and functionality.
Comments (380) 116 threads
Show all comments
Showing thread 14 of 116
https://github.com/rswier/c4/blob/master/c4.c