from Hacker News

A digital circuit simulator written in sed

by curiousfab on 3/13/22, 11:11 AM with 9 comments

  • by elteto on 3/13/22, 2:10 PM

    I once saw an article about something similar, where the author had written a primitive circuit simulator but using shell pipes and /dev/null and /dev/zero as a current sink/source (or something like that). It was very cool, but I never managed to find the article again.

    Edit: found it [0]! and it's from Linus Akesson, a total legend.

    [0] https://www.linusakesson.net/programming/pipelogic/index.php

  • by nonrandomstring on 3/13/22, 1:18 PM

    Hats off! It's like watching someone tie shoelaces with their teeth while juggling plates. Today a flip-flop, tomorrow the NSO emulating a LISP machine to crack your phone passwords in situ.
  • by czx4f4bd on 3/13/22, 3:35 PM

    I just recently decided to skim the GNU Sed manual and it honestly doesn't surprise me one bit that this is possible. Sed is basically a bytecode VM that only does string manipulation.