Ask HN: What piece of code/codebase blew your mind when you saw it?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Apollo-11

    Original Apollo 11 Guidance Computer (AGC) source code for the command and lunar modules.

  • https://github.com/chrislgarry/Apollo-11/blob/a13539c7c5c482...

    My mind was blown that I could read Apollo 11 source code. It was additionally blown that it included comments like, "# TEMPORARY, I HOPE HOPE HOPE"

  • astexplorer

    A web tool to explore the ASTs generated by various parsers.

  • it isn't rocket science, but https://github.com/fkling/astexplorer significantly raised my standard of what a readable, modifiable, nontrivial react/redux codebase could look like. bonus that astexplorer is basically used by everyone in the js tooling ecosystem

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • .NET Runtime

    .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.

  • Well, .NET's garbage collector certainly springs to mind. Not exactly in a good way. You know you have something special on your hands when GitHub refuses to show you a highlighted version of a hand written C++ file (https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/g...).

    Other than that, I remember my mind was blown a few times while watching Jim Weirich's presentation on functional programming all those years ago (https://www.youtube.com/watch?v=FITJMJjASUs).

  • pygments

    Pygments is a generic syntax highlighter written in Python

  • Its been a while since I worked with this lib but I always thought Pygments was pretty.

    https://github.com/pygments/pygments

  • ioccc-obfuscated-c-contest

    IOCCC International Obfuscated C code contest entries

  • IOCCC taught me that form is just as important as function, and often a lot more fun: https://www.ioccc.org/

  • cosmopolitan

    build-once run-anywhere c library

  • quine-relay

    An uroboros program with 100+ programming languages

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Quake-2

    Quake 2 GPL Source Release

  • Idris2

    A purely functional programming language with first class types

  • The Idris codebase is quite beautiful. Given some understanding of how it works underneath, I find that there’s a succinct clarity in everything.

    https://github.com/idris-lang/Idris2

  • mal

    mal - Make a Lisp

  • For me it was the "Make a Lisp" project. Reading the architectural diagram of a Lisp interpreter, and browsing its implementation in many (87) programming languages.

    https://github.com/kanaka/mal

    Especially where the guide explains how tail-call optimization works, my mind was blown.

    https://github.com/kanaka/mal/blob/master/process/guide.md#s...

    Studying the project changed the way I understand code. Since then I've created my own little Lisps in about three or four versions/languages. Next I'd like to write one in WebAssembly Text format, which is already in a Lisp-shaped syntax.

  • protoactor-dotnet

    Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin

  • notcurses

    blingful character graphics/TUI library. definitely not curses.

  • notcurses: https://github.com/dankamongmen/notcurses

    The guy is a literal genius, I hope to forget half the stuff he knows.

    Also Fabrice Bellard (ffmpeg/qemu).

  • primes-cpp

    A compact primes library containing a highly optimized prime sieve and deterministic primality test.

  • Everybody mentions this, and what's great is that it is a pretty natural solution to a lot of problems. I remember coming up with a version of it while writing an optimized prime-sieve[1], and was surprised when I later learned that it was some named technique.

    In addition to just the basic loop-unrolling (which I'm pretty sure you usually don't need to do by hand with modern compilers), it works really well when you need to jump into the middle of a pattern. Like if you're sieving primes in a wheel-factorized array.

    [1] https://github.com/patricksjackson/primes-cpp/blob/master/pr...

      // Here we're only checking possible primes after wheel-factorization

  • scheme

    An R7RS Scheme implemented in WebAssembly

  • learnhaskell

    Learn Haskell

  • https://github.com/bitemyapp/learnhaskell/blob/master/dialog...

    > a transducer is recognizing that the signature of foldl splits

    > type Transducer a b = forall r. (r -> b -> r) -> (r -> a -> r)

    > they compose like lenses

  • lisp-in-life

    A Lisp interpreter implemented in Conway's Game of Life

  • Almost forgot - Lisp In Life. Pretty sure I first saw that on HN. IMO the more amazing thing is the Life-based processor, once you have that, the rest is a matter of adding layers. But it's one thing to know someone could do it, quite another to see it in action.

    https://github.com/woodrush/lisp-in-life

    Run it in your browser here. Definitely worth zooming all the way in to get a sense of scale.

    https://woodrush.github.io/lisp-in-life/

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts