Feel like you want to sneer about something but you donā€™t quite have a snappy post in you? Go forth and be mid!

Any awful.systems sub may be subsneered in this subthread, techtakes or no.

If your sneer seems higher quality than you thought, feel free to cutā€™nā€™paste it into its own post, thereā€™s no quota here and the bar really isnā€™t that high

The post Xitter web has spawned soo many ā€œesotericā€ right wing freaks, but thereā€™s no appropriate sneer-space for them. Iā€™m talking redscare-ish, reality challenged ā€œculture criticsā€ who write about everything but understand nothing. Iā€™m talking about reply-guys who make the same 6 tweets about the same 3 subjects. Theyā€™re inescapable at this point, yet I donā€™t see them mocked (as much as they should be)
Like, there was one dude a while back who insisted that women couldnā€™t be surgeons because they didnā€™t believe in the moon or in stars? I think each and every one of these guys is uniquely fucked up and if I canā€™t escape them, I would love to sneer at them.

    • self@awful.systems
      link
      fedilink
      English
      arrow-up
      2
      Ā·
      1 year ago

      sure! there was a little bit about it in the first stubsack and I posted a bit more about it in this thread on masto (with some links to papers Iā€™ve been reading too, if youā€™d like to dig into the details on anything)

      overall what Iā€™m working on is a hardware implementation of a Krivine machine, which uses Trompā€™s prefix code bitstream representation of binary lambda calculus as its machine language and his monadic IO model to establish a runtime environment. it isnā€™t likely to be a very efficient machine by anyoneā€™s standard, but I really like working with BLC as a pure (and powerful) form of computational math, and thereā€™s something pleasant about the way it reduces down to a HDL representation (via the Amaranth HDL in this case). thereā€™s a few subprojects Iā€™ve been working on as part of this:

      • the basic HDL implementation targeting open source FPGA synthesis and simulation
      • a hardware closure allocator and garbage collector
      • an assembler to convert lambda calculus expressions into their binary form (which starts to resemble ML with a bunch of high level capabilities, with very little code either in the assembler or in ROM on the device ā€” thatā€™s one part of what makes the work interesting)
      • a lazy version (Krivine machines are call-by-name, which is almost there, and the missing pieces needed for lazy evaluation look a lot like a processor cache but with more structure)
      • I have the intuition that the complete Krivine machine will be fairly light on FPGA resources, so Iā€™d like to see how many I can synthesize onto one core with parallelism primitives, FIFOs, and routing included
      • lambda calculus machines can do arithmetic and high-level logic without an ALU, which is neat but extremely inefficient. I have some basic plans sketched up for an arithmetic unit thatā€™d allow for a much more cycle and memory efficient representation of integers and strings, and a way to derive closures from them

      Iā€™ve been working on some of this on paper as a sleep aid for a while, but Iā€™m finally starting on whatā€™s feeling like a solid HDL implementation. let me know if you want more details on any of it! some of the more far off stuff is really just a mental sketch, but writing it out will at least help me figure out what ideas still make sense when theyā€™re explained to someone else

      • self@awful.systems
        link
        fedilink
        English
        arrow-up
        3
        Ā·
        edit-2
        1 year ago

        for anyone whoā€™s fucking lost reading the above (I canā€™t blame ya), lambda calculus is the mathematical basis behind functional programming. this is a fun introduction. the only things you can do in lambda calculus are define functions, name variables, and apply functions to other functions or variables (which substitutes the variables for whatever theyā€™re being applied to and eliminates the function). thatā€™s all you need to represent every possible computer program, which is amazing

        a Krivine machine is a machine for doing what the alligators in that intro are doing, automatically ā€” that is, reducing down lambda functions until they canā€™t be reduced anymore and produce a final value. that process is computation, so a Krivine machine is a (rather strange) computer

      • sinedpick@awful.systems
        link
        fedilink
        English
        arrow-up
        2
        Ā·
        edit-2
        1 year ago

        I have a scattered interest in lambda calculus too so Iā€™d love to follow this project. Trompā€™s BLC definitely hits a sweet spot of complexity/size when it comes to describing computation in a way thatā€™s deeply satisfying.

        Have you looked into interaction nets/other optimal beta-reduction schemes (thereā€™s a project out there called HVM)? Probably way too high level for now though. I am fascinated by the possibility of these algorithms making church-representations more asymptotically efficient (or even balanced ternary)

        • self@awful.systems
          link
          fedilink
          English
          arrow-up
          2
          Ā·
          1 year ago

          I have a scattered interest in lambda calculus too so Iā€™d love to follow this project. Trompā€™s BLC definitely hits a sweet spot of complexity/size when it comes to describing computation in a way thatā€™s deeply satisfying.

          exactly! itā€™s such a cool way to write a program, and itā€™s so much more satisfying than writing assembly for a von Neumann (or any load/store) machine. have you checked out LambdaLisp? itā€™s one of my inspirations for this project ā€” itā€™s amazing that you can build a working Lisp interpreter out of BLC, and understanding how that was done taught me so much about Lispā€™s relationship with lambda calculus.

          I plan to release my HDL as a collaborative project once Iā€™ve got enough done to share out. currently Iā€™ve got the HDL finished for the combinational circuit that makes bitstream BLC processing efficient with word-oriented memory hardware, and Iā€™m doing debugging on the buffer that grabs words from memory and offsets them if they represent a term that isnā€™t word-aligned (which is a pretty simple circuit so Iā€™m surprised Iā€™ve managed to implement so many bugs). thereā€™s quite a bit left to go! IO is still a sticking point ā€” I know how I want to do it, but I canā€™t quite imagine how memory and runtime state will look after the machine reads or writes a bit.

          Have you looked into interaction nets/other optimal beta-reduction schemes (thereā€™s a project out there called HVM)?

          that seems awesome! I really like that it can do auto-parallelization, and I want to check out how it optimizes lambda terms. for now my machine model is a pretty straightforward Krivine machine with some inspiration taken from the Next 700 Krivine Machines paper, which seems likely to yield a machine that can be implemented as circuitry. that paper decomposes Krivine-like machine models down into combinators, which can be seen as opcodes, microinstructions, or (in my case) operations that that need to be performed on memory during a particular machine state.

          once Iā€™ve got the basic machine defined, Iā€™d like to come back to something like HVM as a higher performance lambda calculus machine and see what can be adopted. one of their memory invariants in particular (the guarantee that each closure is only used once) maps really well to my mental model of what I imagine a hardware parallel lambda calculus machine would be like

          • sinedpick@awful.systems
            link
            fedilink
            English
            arrow-up
            2
            Ā·
            1 year ago

            I found LambdaLisp from your mastodon post and was immediately intrigued. Iā€™m going to try and run it to get a better understanding of how the IO system works, and maybe even cook up my own BLC interpreter to run it! The hardware stuff is definitely out of my depth, but this may be a great chance to learn.

            • self@awful.systems
              link
              fedilink
              English
              arrow-up
              2
              Ā·
              1 year ago

              thatā€™s a great idea! the only BLC VMs I know of are written in a very obscure style (Trompā€™s especially ā€” his first interpreter was an entry into the International Obfuscated C Code Contest and he only posted the (relatively) unobfuscated one later) and I think thereā€™s plenty of room for something written to be more comprehensible. Iā€™m also not aware of any VM that implements call-cc from Krivineā€™s original paper, which has interesting applications. and of course, all the Krivine machines I know are relatively slow and very memory-inefficient ā€” but thereā€™s low hanging fruit here that can make things better.

              one thing I might take on is implementing a visual krivine machine ā€” something with a GUI that shows its current state and a graph of all the closures in memory. that would be a big boon for my current work, and I might see if I could graft something like that onto the simulation testbench for my HDL implementation.