6 ms·
You might want to add (obfuscated) to the title. The actual source code, while small, is much larger [1]. (edit: at 589 lines it's still impressive!) For peopl
by mettamage 5y ago
You might want to add (obfuscated) to the title. The actual source code, while small, is much larger [1]. (edit: at 589 lines it's still impressive!)
For people who like this kind of thing and/or for people who want to be able to understand what is going on at all, you might like the course NAND2Tetris [2]. It's a good prerequisite to understanding this blog post if computer systems isn't a topic that one has explored before.
[1] https://gist.github.com/binji/395669d45e9005950232043ab4378abe https://gist.github.com/binji/395669d45e9005950232043ab4378a... -- the author notes this in the article.
[2] https://www.nand2tetris.org/ https://www.nand2tetris.org/
- ngokevin 5y agoThe obfuscated one is awesome though, the code is in the shape of pokeballs!
- nighthawk454 5y agoStill, the unbofuscated one is only 589 lines including formatting, a copyright header, and what looks to be an 80-char line limit. Seems sufficiently interesting either way
- Aachen 5y agoSee, the truth is just as impressive to me, but knowing it's not a lie and a more than fair line length makes me appreciate it.
- userbinator 5y agoI think instead of line count, either final binary size or source code size in bytes should be more common in claims of minimalism; the demoscene, for example, always uses binary size.
- Blikkentrekker 5y agosource code size can still be manipulated by using very small identifiers or reusing them. There should rather be a normalization metric where all identifiers are treated as eight characters long Resulting binary will be different depending on the compiler and type of optimization and would simply be manipulated by optimizing heavily for size.
- binji 5y agoI got kinda dragged about this on reddit/twitter. Afterwards I posted on r/tinycode with the size in bytes: https://www.reddit.com/r/tinycode/comments/nn5djb/pokegb_a_gameboy_emulator_that_only_plays_pokemon/ https://www.reddit.com/r/tinycode/comments/nn5djb/pokegb_a_g...
- kzrdude 5y agowould it be possible to push it down to IOCCC size? Would be fun to see it there, of course.
- binji 5y agoI think so, when I was doing the write-up I noticed a few things I could have improved (and a few bugs!)
- iampims 5y agoDon’t let any of these comments take away from how great this is, _especially_ with the in-depth blog post.
- IgorPartola 5y agoNumber of nodes in the AST or number of machine instructions might be more meaningful.
- deathanatos 5y agoThat metric is game-able, too: you just implement a VM, and only count the instructions to to VM. The rest is one big binary blob of "data", occupying a single node in the AST of the host language. Now, of course, that's basically cooking the books, but there's a wide gulf between a full VM & smaller, domain specific ones that might not look like VMs. (All or most of data-driven programming, really.)
- Ekaros 5y agoFinal binary size including all external dependencies is probably fairest metric. With heavy use of libraries things get messy.
- account42 5y ago> including all external dependencies The OS too?
- smithza 5y ago68 lines of code is pretty much arbitrary. It could have been far less, he just put it all to fit his poke ball pattern.
- dheera 5y agoThat, and obfuscation is also relative. You could call the 589 lines obfuscated as well.
- anonymousiam 5y agoThe author's tweet claimed 62 lines.
- binji 5y agoYep, I made a mistake it's actually 68.