• davel [he/him]
    link
    fedilink
    English
    445 months ago

    Assembly code is for writing C compilers, and C compilers are for writing Lisp interpreters.

        • @[email protected]
          link
          fedilink
          English
          4
          edit-2
          5 months ago

          There’s actually good reasons for this design. It’s easy to write a Scheme interpreter in assembly, but it’s hard to write a C compiler in assembly that handles everything correctly. Much rather write it in higher level language if possible and Scheme lowers the bar to getting there, so you can get away from using assembly as quickly as possible. Or you can copy somebody else’s Scheme implementation of a C compiler because now you’re platform independent.

          Then you can write your C compiler in C (or steal a better compiler already written in C) and close the loop. For your final step, you use the C compiler to compile itself.

    • @RestrictedAccount
      link
      45 months ago

      Back in High School in the 80’s me and a buddy wrote a Z-80 editor assembler in TRS-DOS BASIC.

      It was not rocket science.

      • davel [he/him]
        link
        fedilink
        English
        5
        edit-2
        5 months ago

        I never did get very far with the TRS-80 Editor Assembler, but that was my first exposure to such things.

        I also remember the BASIC code for the Dancing Daemon which was replete with PEEKs and POKEs, such that much of it was written in machine code.

        • @RestrictedAccount
          link
          28 days ago

          Exactly how we did it too. We created the editor/assembler that peeked to see what was there and display it in Assembly, Hexadecimal, and ASCII.

          You could edit whichever version you wanted and it would Poke it into RAM.

          You could also save swaths to a file.