Schemy Lisp En DOS

(sled.neocities.org)

78 points | by AlexeyBrin 4 days ago

7 comments

  • jasomill 9 hours ago
    Interesting.

    The simplicity of the build process is inspiring.

    It literally took me less than five minutes to cobble together a build environment from thin air, cross-compile, and test:

    1. Glance at the Makefile, notice that it's a single self-contained C file and that it builds on Open Watcom.

    2. Google Open Watcom, download the latest Linux binary release from GitHub on my Windows PC because that's where I'm sitting but my plan is to run it on the Linux box across the room, currently headless.

    2. Out of habit, I run "file" and "7z l" on what's apparently a self-extracting installer when it finishes downloading.

    3. Realize it contains binaries for multiple platforms, including Windows, so I extract it.

    4. Following the Makefile, set a WATCOM environment variable pointing to the extracted path and add its "binnt64" directory to my path.

    5. Copy/paste the single compilation command from the Makefile into PowerShell. Cross-compiles without error.

    7. Create an ISO image of the source directory containing the binary, mount it on the nearest DOS-alike (an 86Box instance running MS-DOS 6.22 on an emulated Pentium MMX IBM PC), ran the included test program. Tests pass.

  • bitwize 3 days ago
    Fantastic to see the DOS Lisp scene revived again. Back in the day there was PC-Scheme from Texas Instruments, which I believe was R3RS-compliant.
    • shakna 3 days ago
      Gambit-C has also been around since '88 and can compile to fairly portable C.

      Probably been a decade since I tried compiling it for DOS, but I believe getting it up and running shouldn't be difficult.

    • NetMageSCW 3 days ago
      What I remember from back in the day was XLISP.
      • bitwize 2 days ago
        That's going way back, and was portable enough to be used on a variety of operating systems. There was a package of it for the HP Integral!

        An early version of Xlisp was used as the basis for Autolisp, but Autolisp wasn't updated to track Xlisp's capabilities. It's kinda like how Commodore BASIC was a nerfed version of Microsoft BASIC that Commodore licensed back in the 1970s and then never updated since to track later BASIC versions, just added a few commands here and there to support later Commodore machines.

    • cestith 11 hours ago
      It was a little disappointing to me given there were TurboAssembler, Turbo C, Turbo Pascal, Turbo Basic, and Turbo Prolog and that Borland had a trademark for Turbo Lisp that I don't think I ever saw an available version of that.
  • dharmatech 3 days ago
    Super cool to see a new Scheme on DOS.

    I've been messing around with a language that I summarize as:

    ALOE = Scheme + Smalltalk + Types

    Boids implementation:

    https://github.com/dharmatech/2026-09-02-aloe-racket/blob/ma...

    https://github.com/dharmatech/2026-09-02-aloe-racket

  • pmcgoron 3 days ago
    Aw, no call-with-current-continuation?
    • Jblx2 3 days ago
      How much does that really get used?
      • matheusmoreira 7 hours ago
        Delimited continuations are quite useful. They are essentially resumable exceptions. Lots of things can be implemented elegantly in terms of them.

        It's Scheme's default undelimited continations that are bad to the point of uselessness.

      • pmcgoron 3 days ago
        As an escape continuation, more than you'd expect. (Exception handlers, early return.) Full continuations are rarer, but I use them for doing error recovery.
      • jrapdx3 8 hours ago
        I've programmed in Scheme on and off over the last decade or so. callcc comes in handy for "return" or "break" functionality. More sophisticated uses, like threading or coroutines, have been around for a long time. Obviously those operations are harder to implement but they do exist and are widely used.
      • aag 8 hours ago
        I use them for debugging errors in web handlers.

        https://speechcode.local/blog/repl-as-service

  • reddit_clone 11 hours ago
    DOS? Like in MSDOS?

    There is something I haven't heard in a long while. Turbo C was the shit back in the day. Until MS came in and pushed Borland out of the way.

    • wduquette 10 hours ago
      To be fair, Borland pushed MS out of the way first, IIRC. Borland was affordable; Microsoft Pascal and C were not. I miss Borland; they did good work.
      • iLemming 9 hours ago
        Borland was huuuge. The name was so prominent, my college-mate one day (without a hint of irony) said: "All this time I thought the first name of Pascal - the mathematician, was Borland and that's how the company got the name. I just learned I was wrong, it's Blaise..."

        When Hejlsberg left Borland to work at Microsoft and then made C# and .NET, etc., I followed like a blind, newborn kitten. And then I spent years drinking that kool-aid. I regret this decision to this day. What a waste of my youth.

  • anyfoo 8 hours ago
    > The SLED system does not feature numeric types. Yet natural numbers (non-negative integers) can be emulated using lists:

    > '(nil nil nil) ; three

    Pfsh, how pedestrian and unnecessarily high level. What you of course want to use instead is ♫ Church Numerals ♫!

        (define zero (lambda (f) (lambda (x) x)))
        (define (succ n) (lambda (f) (lambda (x) (f ((n f) x)))))
    
        (define one   (succ zero))
        (define two   (succ one))
    
        (define (add m n) (lambda (f) (lambda (x) ((m f) ((n f) x)))))
        (define (mul m n) (lambda (f) (n (m f))))
        (define (pow m n) (n m))          ; n applications of "multiply by m"
    
        ;; escape hatch back to the host numbers
        (define (church->int n) ((n (lambda (x) (+ x 1))) 0))
    
    (The "escape hatch" at the end is in Scheme, and only shown for illustration. Converting it into SLED and its documented "list numbers" is left as an exercise for the reader. It's really trivial, try it.)
  • tug2024 4 days ago
    [dead]