• NoSpotOfGround
    link
    fedilink
    English
    185
    edit-2
    1 month ago

    The real meat of the story is in the referenced blog post: https://blog.codingconfessions.com/p/how-unix-spell-ran-in-64kb-ram

    TL;DR

    If you’re short on time, here’s the key engineering story:

    • McIlroy’s first innovation was a clever linguistics-based stemming algorithm that reduced the dictionary to just 25,000 words while improving accuracy.

    • For fast lookups, he initially used a Bloom filter—perhaps one of its first production uses. Interestingly, Dennis Ritchie provided the implementation. They tuned it to have such a low false positive rate that they could skip actual dictionary lookups.

    • When the dictionary grew to 30,000 words, the Bloom filter approach became impractical, leading to innovative hash compression techniques.

    • They computed that 27-bit hash codes would keep collision probability acceptably low, but needed compression.

    • McIlroy’s solution was to store differences between sorted hash codes, after discovering these differences followed a geometric distribution.

    • Using Golomb’s code, a compression scheme designed for geometric distributions, he achieved 13.60 bits per word—remarkably close to the theoretical minimum of 13.57 bits.

    • Finally, he partitioned the compressed data to speed up lookups, trading a small memory increase (final size ~14 bits per word) for significantly faster performance.

  • @ColeSloth@discuss.tchncs.de
    link
    fedilink
    English
    821 month ago

    Old school coding and game programing was magic. The clever tricks that nes game programmers came up with to work around hardware limitations was phenomenal. It went way beyond the bushes and clouds in mario being the same thing but in a different color.

      • VindictiveJudge
        link
        fedilink
        English
        51 month ago

        IIRC, someone got with the author of that bit of code to ask how they came up with it, but they had simply learned it from someone else. So they tracked them down and found that they had also learned it from someone else. They eventually landed on Greg Walsh as the original author, but for a bit the code had no known origin.

    • @General_Effort@lemmy.world
      link
      fedilink
      English
      12
      edit-2
      1 month ago

      nes game programmers

      Were these guys even Real Programmers?

      Here’s a great talk by a guy who worked on a 1982 game for the Atari 2600, a game console first released in 1977. It’s a fascinating insight into the early evolution of computing. They didn’t work around limitations. They used a machine to do whatever it could.

      If anyone has ever wondered by what standard C is a high-level language, this is for you. Or if you want to know how we ever could have developed something to connect the abstract logic of some algorithm with some glowing pixels on a screen.

      Pitfall Classic Postmortem With David Crane Panel at GDC 2011 (Atari 2600)

      There’s an ancient myth that a god created the first pair of tongs. Tongs need to be forged in a smithy. Obviously, you need tongs for that.

    • bobalot
      link
      fedilink
      English
      51 month ago

      Restrictions and boundaries spur innovation.

    • @Valmond@lemmy.world
      link
      fedilink
      English
      41 month ago

      The old scrollers in non-consoles (consoles had hardware scrollers) used funky tech too to reduce overdraw. Fun times.

  • Troy
    link
    fedilink
    English
    591 month ago

    Long article for one sentence of trivia and no info on the algo itself. The death of the internet is upon us.

    • Em Adespoton
      link
      fedilink
      English
      39
      edit-2
      1 month ago

      Doesn’t even name the algorithm, and somehow spells LZMA wrong, despite just having written it out longhand.

      Well, it’s PC Gamer.

      [edit] I still can’t figure out if they’re referencing LZW encoding… the L and Z being the same Lempel and Ziv from LZMA, but with Welch having a different solution for the rest of the algorithm due to size constraints.

    • @GrabtharsHammer@lemmy.world
      link
      fedilink
      English
      161 month ago

      I’d like to imagine they took the short trivia fact and applied the inverse of the compression algorithm to bloat it into something that satisfied the editor.