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

I love all the series about writing your own X in 100 lines of code. It gives you the understanding of technology and removes a lot of unnecessary details.

The great examples of this are 'A from-scratch tour of Bitcoin in Python' https://karpathy.github.io/2021/06/21/blockchain/ and 'Let's build GPT: from scratch, in code, spelled out' https://youtu.be/kCc8FmEb1nY from Andrej Karpathy

I wonder if anybody tried to collect all such projects together and built his own 'Internet in just 100 lines of code'



I just submitted this as its own post, because I thought it was so cool, but here's a complete operating system in 2000 lines of code: https://github.com/yhzhang0128/egos-2000


Egos is really neat, and super approachable. I did some documentation work for it last fall, and despite only having a weak grasp of operating systems I could easily understand the whole thing. I only needed to figure out a few common acronyms and magic numbers that weren’t explained.


Another one: Write yourself a Git: https://wyag.thb.lt/

I've enjoyed doing stuff like this myself. I wrote an IP stack up to being able to ping an IP address. I had learnt all of this in university, but doing it myself really cemented the knowledge. Using a notebook and doing literate programming is a must. I pretend that I'm teaching someone else, even though I don't plan on ever sharing it really.


Adding Liz Rice's superb "Containers from scratch" to the list. https://www.youtube.com/watch?v=_TsSmSu57Zo


Bocker is in this same category...docker clone in bash that's helpful in seeing what's really happening underneath with nsenter, namespaces, network bridging, cgroups, etc.

https://github.com/p8952/bocker


Check out the book "500 Lines or Less: Experienced programmers solve interesting problems"

I especially like the chapter "A Python Interpreter Written in Python": https://aosabook.org/en/500L/a-python-interpreter-written-in...


Plug: I am a big fan of Build Your Own X educational projects. I have a build your own KV Store project. I have set up this project in TDD fashion with the tests. So, you start with simple functions, pass the tests, and the difficulty level goes up. There are hints if you get stuck (e.g. link). When all the tests pass, you will have written a persistent key-value store.

go - https://github.com/avinassh/go-caskdb

python - https://github.com/avinassh/py-caskdb


Maybe not only 100 lines of code though, I think of Code Crafters. https://github.com/codecrafters-io/build-your-own-x


i subscribed to codecrafters for a bit. it was ok, but it was super annoying to have to use their tooling around git and ci. too much hand holding.


> I love all the series about writing your own X in 100 lines of code.

Me too, they're a really good resource.

What are some other ones you've come across?


The series is great, wish I had more time to try out the projects!




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

Search: