576 points · by n_t · 8y ago · 82 comments
* Build a simple database (https://cstack.github.io/db_tutorial/)
* Containers in 500 lines (https://blog.lizzie.io/linux-containers-in-500-loc.html)
* Malloc tutorial (https://danluu.com/malloc-tutorial/)
* Nativecoin - build your own crypto-currency (https://lhartikk.github.io/)
I'm sure there are great such projects/tutorials in domains like networking, filesystem, databases, compiler, web design, messaging, game design, fintech, etc. If you have come across such writings/projects, kindly share.
There's also Handmade Hero (https://handmadehero.org/)
The Raytracing books by Peter Shirley are also very interesting, starting with "Raytracing in one weekend" (https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-eb...)
And lastly there's Crafting Interpreters (http://www.craftinginterpreters.com/)
Peter also uses area lighting derived from the surroundings, whereas my implementation uses point lights that result in sharp specular highlights. There are no surroundings in my image, only the lights.
No doubt Peter's materials look great. I wish I had time to cover more in my course, but I wanted to make sure I covered the prerequisite vector math as well for students without strong mathematical backgrounds.
Create Your Own Programming Language http://createyourproglang.com/
Build Your Own Sinatra: https://getgood.at/build-your-own/sinatra (disclaimer: I'm the author of this)
Vanilla JS series https://javascript30.com/
Super Tiny Compiler https://github.com/jamiebuilds/the-super-tiny-compiler
It gives a concise explanation for the techniques and theories for signal processing while showing practical code examples.
[0] https://github.com/markerikson/react-redux-links/blob/master...
[1] https://github.com/markerikson/react-redux-links/blob/master...
[2] https://engineering.hexacta.com/didact-learning-how-react-wo...
Marc-André Cournoyer has put together several different projects: - 2D/3D Game - Database Engine - Virtual Machine - Backend + Frontend Framework - Neural Network - Language - Server - Real-Time Web Engine
Full Disclosure: I am a happy customer of Marc Andre’s “Owning Rails” [2] workshop. No other affiliation.
Tldr: all you need to make your own scalable Twitch without coding (but with patience). It’s a <2mo old so feedback appreciated, but my live vlog has been going strong for weeks and syndicating to 4+ other networks.
Lots of examples across 72 languages.
The Architecture of Open Source Applications
500 Lines or Less
You'll be surprised at how nice it is to just fully understand everything without a mess of libraries getting in the way and the resulting project will be perfectly tailored to your needs.
On the other hand, it was enough to get me off the ground for my lexer and write a parser that wasn't entirely dumb.
And just FYI, the interpreter we build in the book ends up with ~3900 lines, including the full test suite.
Instead, think of it as 12 mostly-independent projects implementing a small part of a computer's functionality: the set of logical gates, the ALU, the CPU, the computer hardware, the assembler, assembly programming, stack op implementation, a compiler, and and OS. Any one of those will be only a few days.
(I'm in the middle of the Coursera course for it and have done 1-5 and 7-10.)
http://www.nand2tetris.org/course.php
It only has up to chapter 6 online, but there's an old version of the book available for free but I don't have the link handy.
It's an old classic, using somewhat outdated technologies, but there are more moderns versions floating around, for example a C + x86 one: https://github.com/lotabout/Let-s-build-a-compiler
I'm actually fundraising for the new edition of the book, updated for Python3+Django2.0: https://www.kickstarter.com/projects/1868398473/hello-web-ap...
This got me realizing that I usually purchase and consume tutorials on an as-needed basis and I usually want to start right away. I used to collect them but found it wasn’t very optimal because when I found the time to do the learning, I wanted something a little different. For what it’s worth, I don’t think your Kickstarter numbers would account for people like myself.
http://gitlet.maryrosecook.com/docs/gitlet.html
Here is another side-by-side example. It is a Python program that implements a very simple interpreter for the Lisp programming language.
A really shitty Redis/HTTP can be built in around 100 lines in many languages (assuming the language stdlib helps you out a bit -- Python, Go, Clojure would all fit).
The fun begins when you make a concentrated effort into making it less shitty. What tradeoffs will you make to what gain? It's a fun space to explore.
https://www.destroyallsoftware.com/screencasts/catalog
Not free, but very good.
- A TDD approach for building a simple microprocessor model in Python: http://joaoventura.net/blog/2017/simple-microprocessor/
- Building a basic HTTP Server from scratch in Python: http://joaoventura.net/blog/2017/python-webserver/
The most interesting and educational one for me is `browser`, which crudely shows web pages and is written in less than a thousand lines of Rust from scratch.
[0] https://github.com/redox-os/orbutils/tree/6764004b9f6f386af1...
http://journal.stuffwithstuff.com/2013/12/08/babys-first-gar...
The wiki has lessons in detail: https://github.com/ssloy/tinyrenderer/wiki/Lesson-1:-Bresenh...
http://codecapsule.com/2012/11/07/implementing-a-key-value-s...
Let's Make a Voxel Engine
At the time I wrote it I was modeling the opcodes on the Z80, but I guess I simplified once I'd got it working enough to make myself happy. (Lots of toy-virtual machines, of which this definitely is one, don't implement labels or "decompilers".)
It won't be the JVM but it could be a good start
Need to find some time to look more and actually try and work thru it.
Click on the ATTiny85 tag for more projects. I've made / adapted quite a few of those. Great fun and challenging!
I always feel like it's too much hand holding, or I'm just copying/re-building the wheel and not learning enough, but I do very much enjoy them.
As the project progresses you'll get more context on why things are what they are than is explicitly written. Eventually you'll hit on something that actually is better and now you're a what-the-article-teaches developer!
Use Haskell to write a Scheme!
It's very much still in progress, but certainly fits the brief.