22 comments

[ 11.1 ms ] story [ 364 ms ] thread
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.
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.

What I remember from back in the day was XLISP.
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.

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.
Aw, no call-with-current-continuation?
How much does that really get used?
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.
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.
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.

Coroutines, especially when the runtime is embedded in other applications. I've built one with Erlang-style message-passing.
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.

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.
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.

So long ago, I don't even recall the name.

They had a C++ GUI library, much better than MFC that came later and eclipsed it.

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.

> 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 ♫!

(This example uses scheme for readability, converting to SLED is left as a trivial exercise for the reader.)

    (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))