10 ms·
Ask HN: “Write your own” or “Build your own” software projects
I am looking for writings/tutorials/videos which describe a specific technology or feature by implementing them, ideally in no more than few thousands lines of code (and not just 10-20 line code snippets). Idea is to teach about underlying technology by a hands-on project, which is not overwhelming like trying to implement full-feature game engine and yet captures the essence of technology. Some examples are -
* 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.
- brudgers 9y agoBuilding a Modern Computer from First Principles http://nand2tetris.org/ http://nand2tetris.org/
- n_t 9y agoIt certainly is a good course and I recommend it too. However, this is a full-fledged class requiring many weeks instead of few hours or days.
- SilasX 9y agoI was on the fence about whether to suggest it, but I don't think you should dismiss it as being a weeks-long course. 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 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.
- otras 9y agoI worked through most of this tutorial on building a simple text editor in C and greatly enjoyed it. Highly recommend it! https://viewsourcecode.org/snaptoken/kilo/ https://viewsourcecode.org/snaptoken/kilo/
- herbstein 9y agoIt's still very early days, but Bitwise is interesting (https://github.com/pervognsen/bitwise https://github.com/pervognsen/bitwise) There's also Handmade Hero (https://handmadehero.org/ 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-ebook/dp/B01B5AODD8/ref=sr_1_1?ie=UTF8&qid=1521122179&sr=8-1&keywords=raytracing+in+one+weekend https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-eb...) And lastly there's Crafting Interpreters (http://www.craftinginterpreters.com/ http://www.craftinginterpreters.com/)
- abhishekjha 9y agoI am following bitwise very closely, particularly to get better at C. Any companion text/resource that I should follow along?
- herbstein 9y agoThe Oberon book by Wirth is something Per references quite often, and is also linked in the README. I think that is the only companion text you'll really find. Other than that it's reading up on the concepts in general from different sources.
- jeffreyrogers 9y agoNAND to Tetris[0] has similar goals, but is probably significantly different in terms of implementation that it's only helpful to explain the concepts. [0]: http://nand2tetris.org/ http://nand2tetris.org/
- runevault 9y agoI'm not quite through part 1 yet, but I highly recommend Crafting Interpreters to anyone who wants to see what it is like writing a recursive decent parser and building a language out of it from scratch.
- msangi 9y agoThe second part (not finished yet) shows you how to build a VM and compile Lox (the toy language used in the book) too run on it.
- methyl 9y agoBuild your own React (https://github.com/hexacta/didact https://github.com/hexacta/didact).
- slaydemons 9y agoRequest: Build a JVM (java virtual machine)
- zombieprocess 9y agoThis is the closest that I could find - https://github.com/lihaoyi/Metascala https://github.com/lihaoyi/Metascala Need to find some time to look more and actually try and work thru it.
- n_t 9y agoJVM might be much more involved project but here is a simple virtual machine - https://github.com/skx/simple.vm https://github.com/skx/simple.vm
- stevekemp 9y agoThat's my project, and it seems to be surprisingly popular, yet something I've never really received any feedback on. 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".)
- msangi 9y agohttp://craftinginterpreters.com/ http://craftinginterpreters.com/ part 2 (still a work in progress) will show you how to write a VM and compile a language to its bytecode. It won't be the JVM but it could be a good start
- runevault 9y agoMAL (Make a Lisp) is a good one around building a lisp. https://github.com/kanaka/mal https://github.com/kanaka/mal Lots of examples across 72 languages.
- pootsbook 9y agoThis describes the purpose of the (paid) resource available at “The Great Code Club” [1]. 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. [1] http://www.greatcodeclub.com http://www.greatcodeclub.com [2] http://owningrails.com http://owningrails.com
- n_t 9y agoVery nice! These days think of something and someone somewhere has not just thought about it already but also making money out of it :)
- reacweb 9y agoI think building a web server is a good way to learn (teach) HTTP protocol.
- lovekush1235 9y agosdessdsd
- zaarn 9y agoI recommend the interpreter book [https://interpreterbook.com/ https://interpreterbook.com/], which isn't entirely free of charge however. 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.
- misternugget 9y agoAs the author of the mentioned book I just want to add that I specifically wrote it because I'm also a huge fan of the technical writings the author is looking for: from the ground up, all code shown, no toys and shortcuts, capturing the essence in a few thousand lines. And just FYI, the interpreter we build in the book ends up with ~3900 lines, including the full test suite.
- n_t 9y agoGreat stuff! Thanks for it.
- zaarn 9y agoI think I'm atm at around 2500 lines, of which the parser and lexer is probably about 1200 lines. I mostly ~~stole~~ used the lexer from the book as inspiration for my own and then rolled a LISP-like language from there (which is rather easy given that a LISP AST is simple in nature)
- dmytrish 9y agoRedox OS has `orbutils`, a bunch of simplistic GUI utilites written in Rust and somewhat cross-platform (it's possible to build and run them on other platforms) [0]. 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/6764004b9f6f386af17031d302430a89057ba77e/src https://github.com/redox-os/orbutils/tree/6764004b9f6f386af1...
- nogridbag 9y agoCame across this website some time ago: The Architecture of Open Source Applications 500 Lines or Less http://aosabook.org/en/index.html http://aosabook.org/en/index.html
- agentultra 9y agoI know some of the people behind that book. It's a very interesting take on the craft of programming. I highly recommend it.
- n_t 9y agoIt's great book. I liked it too.
- perlgeek 9y ago"Let's Build a Compiler" by Crenshaw: https://compilers.iecc.com/crenshaw/ https://compilers.iecc.com/crenshaw/ 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 https://github.com/lotabout/Let-s-build-a-compiler
- perlgeek 9y agoA pretty concise regex engine, along with the explanation: https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html https://www.cs.princeton.edu/courses/archive/spr09/cos333/be...
- gkya 9y agoThere is the famous Linux From Scratch [1] which teaches how to build a functioning GNU Linux system from the grounds up. [1] http://www.linuxfromscratch.org/ http://www.linuxfromscratch.org/
- cweagans 9y agoNot my project, but Writing An Interpreter in Go is excellent: https://interpreterbook.com/ https://interpreterbook.com/
- agentultra 9y agoI enjoyed https://viewsourcecode.org/snaptoken/kilo/ https://viewsourcecode.org/snaptoken/kilo/ and http://www.buildyourownlisp.com/ http://www.buildyourownlisp.com/
- swyx 9y agoThis guide to Build Your Own React is great and even includes React Fiber. well worth it. https://github.com/hexacta/didact https://github.com/hexacta/didact
- oblosys 9y agoBefore switching to React, I learned a lot about Angular from https://teropa.info/build-your-own-angular/ https://teropa.info/build-your-own-angular/
- acemarke 9y agoI've got a bunch of "Build a mini React" [0] and "Build a mini Redux" [1] articles referenced in my React/Redux links list. I particularly recommend the "Didact: a DIY guide to build your own React" post series [2] and "Build Yourself a Redux" [3]. [0] https://github.com/markerikson/react-redux-links/blob/master/react-implementation.md#miniature-react-implementations https://github.com/markerikson/react-redux-links/blob/master... [1] https://github.com/markerikson/react-redux-links/blob/master/redux-tutorials.md#redux-implementation-walkthroughs https://github.com/markerikson/react-redux-links/blob/master... [2] https://engineering.hexacta.com/didact-learning-how-react-works-by-building-it-from-scratch-51007984e5c5 https://engineering.hexacta.com/didact-learning-how-react-wo... [3] https://zapier.com/engineering/how-to-build-redux/ https://zapier.com/engineering/how-to-build-redux/
- doughj3 9y agoThe "Getting Started with Redux" course on egghead.io, from Dan Abramov, developer of Redux, basically has you write Redux from scratch to learn how it works: https://egghead.io/courses/getting-started-with-redux https://egghead.io/courses/getting-started-with-redux
- tarmstrong 9y ago"500 Lines or Less" is an entire book of articles just like this. Each chapter guides you through a small (500 loc or less) implementation of a common component (eg a web server). http://aosabook.org/en/index.html http://aosabook.org/en/index.html
- e12e 9y agoCame here to say this. Also; the other books in the series are interesting.
- e12e 9y agoOn a related note, I just became aware of hitch, 2nd generation stud(?) - a real-world, modern, high performance proxy server: https://hitch-tls.org/ https://hitch-tls.org/
- teej 9y agoThis is the first generation stud project - https://github.com/bumptech/stud https://github.com/bumptech/stud
- zabana 9y agoThank you so very much for this resource !
- harlanji 9y agoI built a live streaming system with VoD constrained to RasPi+CDN with minimal code in a few weeks, fully FLOSS and offline capable. All design and hours of live hacking are online, comparison here: https://ispooge.com/2018-03-14-video-platforms-compared.html https://ispooge.com/2018-03-14-video-platforms-compared.html lmk if you want specifics — tutorials being produced on tinydatacenter.com. I am documenting as I learn, given I have no background in vid nor feature list in mind. 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.
- tmoreton 9y ago'How to Build Tinder with React Native & Expo' It's a bit longer and more complex than what your asking for but I just finished building out a course learning React Native & Expo by building a Tinder clone https://www.udemy.com/how-to-build-tinder/?couponCode=LEARNREACT https://www.udemy.com/how-to-build-tinder/?couponCode=LEARNR...
- dochtman 9y agoTake a look at Gary Bernhardt's From Scratch series: https://www.destroyallsoftware.com/screencasts/catalog https://www.destroyallsoftware.com/screencasts/catalog Not free, but very good.
- msangi 9y agoThey are great. Currently the 'A compiler from scratch' episode is free to watch in case you want to have a preview
- badosu 9y agoI've programmed my own simple synthesizer [1] by following along "The Audio Programming Book" [0]. It gives a concise explanation for the techniques and theories for signal processing while showing practical code examples. [0]: https://mitpress.mit.edu/books/audio-programming-book https://mitpress.mit.edu/books/audio-programming-book [1]: https://github.com/badosu/sine_synth.lv2 https://github.com/badosu/sine_synth.lv2
- n_t 9y agoThis looks like much more involved and longer project. But still I'll get your book, looks very interesting :)
- k2052 9y agoBuild Your Own React https://github.com/hexacta/didact https://github.com/hexacta/didact Create Your Own Programming Language http://createyourproglang.com/ http://createyourproglang.com/ Build Your Own Sinatra: https://getgood.at/build-your-own/sinatra https://getgood.at/build-your-own/sinatra (disclaimer: I'm the author of this) Vanilla JS series https://javascript30.com/ https://javascript30.com/ Super Tiny Compiler https://github.com/jamiebuilds/the-super-tiny-compiler https://github.com/jamiebuilds/the-super-tiny-compiler
- murkle 9y agoThis is properly hands-on as you have to make something :) http://www.technoblogy.com/show?NMX http://www.technoblogy.com/show?NMX Click on the ATTiny85 tag for more projects. I've made / adapted quite a few of those. Great fun and challenging!
- _diyu 9y agoWriting a garbage collector http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/ http://journal.stuffwithstuff.com/2013/12/08/babys-first-gar...
- limedaring 9y agoI wrote Hello Web App to teach Django + Python web app development by talking readers through creating a unique project (using a project template described in the tutorial): https://hellowebbooks.com/learn-django https://hellowebbooks.com/learn-django I'm actually fundraising for the new edition of the book, updated for Python3+Django2.0: https://www.kickstarter.com/projects/1868398473/hello-web-app-20-build-your-first-web-app-with-dja https://www.kickstarter.com/projects/1868398473/hello-web-ap...
- jordanlev 9y agoI bought Tracy's "Hello Web Design" book and it's fantastic! I would assume the Hello Web App book is also quite good.
- gt_ 9y agoIf this were available right now, I would likely buy it! I am tasked with learning Django in the next couple of weeks. 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.
- billconan 9y agoImplementing a Key-Value Store http://codecapsule.com/2012/11/07/implementing-a-key-value-store-part-1-what-are-key-value-stores-and-why-implement-one/ http://codecapsule.com/2012/11/07/implementing-a-key-value-s... Let's Make a Voxel Engine https://sites.google.com/site/letsmakeavoxelengine/ https://sites.google.com/site/letsmakeavoxelengine/
- deleted 9y ago[deleted]
- 3pt14159 9y agoI know it isn't quite what you're asking for, but I recommend writing a static site compiler from scratch for a static site you actually use. Buy a nice HTML / CSS template (I found this one https://html5up.net/story https://html5up.net/story then modified it) and build yourself a nice personal site from scratch. 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.
- emeraldd 9y agoOne of my favorites: http://peter.michaux.ca/articles/scheme-from-scratch-introduction http://peter.michaux.ca/articles/scheme-from-scratch-introdu...
- chown 9y agoWriting a full-featured multi-tenant web app from scratch: https://medium.com/@ashokgelal/writing-a-full-featured-multi-tenant-laravel-app-from-scratch-a0e1a7350d9d https://medium.com/@ashokgelal/writing-a-full-featured-multi...
- citeguised 9y agoThis Tutorial shows how to create a full game (Asteroids-Like) with Love2D and Lua. The game itself is available on Steam. The course is free, and you can pay to get the full source code and the solutions to the tasks. Doing it right now, about halfway through. Really engaging and interesting so far. https://github.com/SSYGEN/blog/issues/30 https://github.com/SSYGEN/blog/issues/30
- kzisme 9y agoSo with these sort of tutorials/guides is it generally a good practice to build on extra functionality to learn more? 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.
- badtuple 9y agoAlways a good idea! Another thing is to CONSTANTLY question what the article is having you do. Try to disprove rationale given and think of alternative paths. Almost in a playful devil's advocate way. 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!
- sedzia 9y agoA series on building modern business apps https://www.voucherify.io/blog/building-an-online-marketplace-from-scratch-introduction https://www.voucherify.io/blog/building-an-online-marketplac...
- jonjacky 9y agoHere is a Javascript program that implements the basics of the git version control system. It is a literate program with a prose explanation in side-by-side format: http://gitlet.maryrosecook.com/docs/gitlet.html 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. http://khamidou.com/compilers/lisp.py/ http://khamidou.com/compilers/lisp.py/
- gunnihinn 9y agoBuild your own really shitty Redis. Then make it less shitty. 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.
- jventura 9y agoLots of good stuff already in the comments! Here are some examples/tutorials I wrote on my blog: - A TDD approach for building a simple microprocessor model in Python: http://joaoventura.net/blog/2017/simple-microprocessor/ http://joaoventura.net/blog/2017/simple-microprocessor/ - Building a basic HTTP Server from scratch in Python: http://joaoventura.net/blog/2017/python-webserver/ http://joaoventura.net/blog/2017/python-webserver/
- nimblegorilla 9y agoUnity's roll-a-ball tutorial is pretty good for starting out with their IDE and also gives some decent exposure to C# basics. https://unity3d.com/learn/tutorials/s/roll-ball-tutorial https://unity3d.com/learn/tutorials/s/roll-ball-tutorial
- hugja 9y agoThere's a Github repo[1] with a collection of project based tutorials. 1. https://github.com/tuvtran/project-based-learning https://github.com/tuvtran/project-based-learning
- wespiser_2018 9y agoWrite You A Scheme, Version 2: https://github.com/write-you-a-scheme-v2/scheme https://github.com/write-you-a-scheme-v2/scheme Use Haskell to write a Scheme!
- bsrppp 9y agoThanks Dued Vary intresting <a href="www.hack-exploits.com">Post</a>
- bsrppp 9y agoBuy latest zeroday exploits | FUD hacking tools | Hacking Hardwares | Gsm skimming device | Gsm ATM/POS skimming Device | Latest BOTNET | Jpg exploit | Doc exploits | office exploits | pdf exploit | Keyloggers | or any types of hacking services . https://www.hack-exploits.com https://www.hack-exploits.com https://www.hack-exploits.com/shop https://www.hack-exploits.com/shop
- cweagans 9y agoI started an awesome list with the content from this discussion: https://github.com/cweagans/awesome-diy-software https://github.com/cweagans/awesome-diy-software
- OddEssay 9y ago"Write Yourself a Roguelike" is an Open Source project that started as a ebook by a former Thoughtbot employee. https://github.com/thoughtbot/write-yourself-a-roguelike https://github.com/thoughtbot/write-yourself-a-roguelike It's very much still in progress, but certainly fits the brief.
- ccajas 9y agoWrite your own software renderer, and learn how the principles of computer rendering work: https://github.com/ssloy/tinyrenderer https://github.com/ssloy/tinyrenderer The wiki has lessons in detail: https://github.com/ssloy/tinyrenderer/wiki/Lesson-1:-Bresenham%E2%80%99s-Line-Drawing-Algorithm https://github.com/ssloy/tinyrenderer/wiki/Lesson-1:-Bresenh...
- arjbah 9y ago'Write your own Operating System' by tuhdo https://github.com/tuhdo/os01 https://github.com/tuhdo/os01