Remix.run Logo
bluedino 8 hours ago

I've seen a few things called 'Zork source code' in various places over the years (even on a CD that came with a game programming book of some sort), and copies like this:

https://github.com/MITDDC/zork

What's the lineage here?

jsnell 8 hours ago | parent | next [-]

Zork was originally written at MIT for PDP-10s in an obscure Lisp dialect (MDL). The authors then later formed a company to sell the game on micro-computers. To do it, they built a virtual machine optimized for this purpose, a new Lisp dialect (ZIL) that could compile to the virtual machine, and the ported the game over to that new dialect. Even so, they had to split the game into three parts to fit.

The source you're linking to is the original MDL source. This is about the ZIL source for the three games that the original Zork was split into.

fsckboy 8 hours ago | parent | next [-]

MDL was a dialect of lisp invented by/in part/under Sussman, the originator of Scheme and SICP; what you're calling an obscure dialect was was part of the continuum of a research trajectory, one of a number of experimental languages designed to test out ideas. Sussman got his PhD in 1973 so we're talking about his later work as a student/early work as a postdoc/assistant professor, and Abelson was in the same timeframe, and Guy Steele a half decade junior, and many others in the lab whose names you would also recognize.

dboreham 7 hours ago | parent [-]

Was go to say - MIT, dec-10: probably not obscure.

msla 2 hours ago | parent [-]

PDP-10, rather.

ErroneousBosh 6 hours ago | parent | prev | next [-]

This is about the fourth article I've read that mentions Lisp today on here.

Okay, I get it. Lisp is great.

Where should I start? It wasn't like I was planning on doing anything else at work next week...

CobrastanJorji 6 hours ago | parent | next [-]

You're kind of in luck. For a while, it was trendy (because MIT was doing it) to teach Intro to Programming with Lisps, especially Scheme. Because of this, there are quite a few "learn programming with Lisp" books and resources. The famous "SICP" book was the textbook for the MIT course and all of the examples were Lisp (there's a newer version that uses JavaScript, I think). There are loads of fine online books and guides. Here's a random online book: https://gigamonkeys.com/book/

In no time you'll be putting up "my other car is a cdr" bumper stickers!

ErroneousBosh 6 hours ago | parent [-]

> In no time you'll be putting up "my other car is a cdr" bumper stickers!

Yeah but then learning Lisp is going to get in the way of welding up new bumper brackets, and the bumper will still be lying in the pile of things beside the shed waiting to be reattached... ;-)

rmunn an hour ago | parent | prev | next [-]

Everyone's recommending books; I'm going to do the opposite and recommend a specific dialect.

Install Clojure. Read https://clojure.org/guides/getting_started and choose an editor. If you don't have a favorite editor, I recommend NeoVim with the LazyVim package (clone https://github.com/LazyVim/starter and follow instructions), then run the :LazyExtras command and install the Clojure package. If you haven't used LazyVim before, https://lazyvim-ambitious-devs.phillips.codes/ is a good book; you can read it online for free, then if you find it useful, purchase a copy to reward the author for his hard work.

Once you've installed an editor, you'll want to install https://leiningen.org/ which is the de facto (if not de jure) package manager for Clojure. Makes compiling your Clojure code to an .exe (for distribution to other machines where Clojure isn't installed) about as simple as it can be.

Once you've got an editor and a package manager installed, you're ready to read https://clojure.org/guides/learn/clojure as well as the various books on Lisp others are recommending. Depending on which book it is, the functions may have different names (e.g., some languages use `first` and `rest` while others stick with the historical `car` and `cdr` names, but they're the same functions), but you should find that the concepts translate perfectly well from one dialect of Lisp to another and the only challenge is having to look up what name the function has in the dialect you're using.

jasaldivara 6 hours ago | parent | prev | next [-]

I suggest: A Gentle Introduction to Symbolic Computation

https://www.cs.cmu.edu/~dst/LispBook/book.pdf

WorldMaker 4 hours ago | parent | prev | next [-]

In Grad School I started with an "AI in Lisp Textbook" (which was still the most common at the time in the late oughts, I hear many have moved to Python since) and searched for a Common Lisp interpreter that felt right. I think I ended up with SBCL [0], but this was obviously a while back so my memory is slippery about it.

(The professor I had for that AI course in Grad School didn't know Lisp and wanted to learn it better, especially because so much of the textbook was in it, so asked us for volunteers to learn it as well and I took that as an excuse/challenge to do every project with a language choice that semester in Common Lisp.)

[0] https://www.sbcl.org/

SteveJS 5 hours ago | parent | prev | next [-]

The summer before i took 6.001 i read “The little LISPer”. It is a good intro.

This is the version i read:

https://www.abebooks.com/9780023397639/Little-LISPer-Third-E...

mghackerlady 6 hours ago | parent | prev | next [-]

With lisp? Honestly I'd start by installing emacs and messing with elisp. It comes with a beginners guide to elisp with the docs iirc

jsdalton 6 hours ago | parent | prev [-]

Start with SICP!

DonHopkins 4 hours ago | parent | prev [-]

The MDL Programming Language Primer; Michael Dornbrook, Marc Blank:

https://donhopkins.com/home/archive/MDL_Programming_Primer.p...

Introduction

Over the years the original MDL (pronounced "Muddle") Primer by Greg Pfister [Pfister 72] became more and more a reference manual and less a Primer from which a novice could learn the language. Some of the text of the original has been re-used in this document, but much has been eliminated, changed, or re-ordered, and a reasonable amount of new material has been added. In particular, a number of figures and many more examples have been added to make some of the more difficult concepts easier to understand.

This Primer is intended as an introduction to MDL. After assimilating the information contained herein, you should be able to write very good programs. However, for any individual topic in the MDL Primer there is likely to be more information available in The MDL Programming Language [Galley 79] and The MDL Programming Environment [Lebling 80], and there are many topics in these documents which are not addressed in the Primer. Anyone who plans to do any serious work with MDL should read these documents.

One of the difficulties in writing a Primer is to make it useful to those who don't know anything at all about programming without boring those who know a lot of the basics. Hopefully those at both extremes will find this to be easy to read. If you are a complete novice, however, there may be some unfamiliar references and some material which doesn't make sense on your first reading.

Why MDL?

Many people ask this. It is often hard for those who use MDL to put into words their reasons for liking it. Those of us who use MDL are convinced that it is a better language than any other we've encountered. Unfortunately, very little has been done to convince others of this and spread the use of this marvelous tool.

MDL was created in the early 1970's by a group at the Dynamic Modelling/Computer Graphics division of MIT's Project MAC (later renamed the Laboratory for Computer Science). It is an offshoot of the original Lisp. There have been quite a few offshoots of Lisp in the past 10 years MacLisp, InterLisp, Lisp Machine Lisp, Lisp1.5, UCI Lisp, Franz Lisp, etc., etc. but none of them are like MDL.

Since MDL is a distant relative of Lisp and many of those first learning MDL have some familiarity with Lisp, a short comparison of the two languages follows. If you are not familiar with Lisp (or, better still, with any other languages) count your blessings (you don't have any bad habits to unlearn) and skip the following discussion.

MDL's similarities to Lisp: MDL shares the advantages of Lisp over the more popular languages such as Basic, Fortran, Cobol, Algol, Pascal, etc.

It has an interpreter which allows real-time interaction and allows you to define and test individual functions separately.

Its syntax is very simple.

- Any data object or function can be passed as an argument or returned as a value.

- It has list structures equivalent to Lisp's.

- Recursive functions can be written quite easily.

The similarities between MDL and Lisp are such that in many cases a few minor changes to Lisp code will convert it into working MDL code. Given the other features of MDL, no MDL programmer would write the program in the same Lisp style.

MDL's dissimilarities to Lisp: Many objections to Lisp are answered in MDL.

-Strongly typed languages provide much better error detection tools than Lisp. MDL allows declarations of all variable types to whatever level of complexity is desired. A variable can be declared to be one of several types.

- Recursion is a useful tool, but often is not a very efficient way to solve the problem. Lisp's motto "To iterate is human, to recurse divine," is not one of MDL's tenets. MDL allows recursion, but provides excellent facilities for iteration.

- MDL has a very powerful set of data structures Lists, Strings, Vectors, and Uniform Vectors. Although lists are a very useful and flexible form of structure, they are certainly not optimal in all cases. MDL's various structures allow the user to save space and access time. MDL's structures are also "first class," in that the standard functions for manipulating data structures can be used on all of them equivalently.

Probably the biggest complaint against Lisp-like languages is that they are unsuitable for "production programming" because they are too slow. MDL has an excellent compiler which as far as we know is the best compiler for a Lisp-like language. It produces machine code equivalent in efficiency to Fortran and Cobol, which are considered very efficient.

-MDL has a rich library of useful program aids. The editing and debugging functions are among the best. The package system allows building of very large programs from small sections, usually written by different people, without worrying about variable name conflicts.

Probably the most distinctive feature of MDL is its mechanism for user-defined types, which is the best of any language with which we are familiar. User-defined types have been retrofitted on some of the newer versions of Lisp, but in most cases they can be used only with special functions and cannot be used in the same general way that Lists can.

Hopefully some of your questions have been answered and you have some ready answers when you get flak from your non-MDL programming friends. Learning MDL should be an enjoyable and worthwhile experience. Your reactions to this Primer and suggestions for changes are always welcome. Good luck!

Warning! You are about to embark on an undertaking fraught with peril. MDL programming has been proven to be habit-forming. Once you begin, you may find the habit hard to kick!

Acknowledgments

We are deeply indebted to our predecessors for their work on this topic: Greg Pfister, who wrote the original A Muddle Primer [Pfister 72], and Stuart Galley, who updated that document and added significantly to it to create The MDL Programming Language [Galley 79] document. Some of the text and examples of the original documents survive here, and some other material was simply rewritten in an order and style which we consider more comprehensible.

Special thanks to Chris Reeve, Dave Lebling, Stu Galley, Poh Lim, Thomas Michalek, Dave Scrimshaw, Tim Anderson; Mark Plotnick, and Prof. J.C.R. Licklider for their many comments and suggestions.

No document on MDL would be complete without acknowledging the "original implementors." If not for their inspiring work, this fine language would not exist. We are forever grateful to Gerald Sussman, Carl Hewitt, Chris Reeve, Dave Cressey, and Bruce Daniels. Thanks are also extended to the many unnamed hackers who have improved the language and the programming environment over the years.

This work was supported by the Advanced Research Projects Agency of the Department of Defense and was monitored by the Office of Naval Research under contract N00014-75-C-0661.

This document was prepared using Scribe and printed on the Xerox Dover printer.

(c) Copyright 1981 Massachusetts Institute of Technology. All rights reserved.

musicale an hour ago | parent | prev | next [-]

Original MDL version: https://github.com/MITDDC/zork

DECUS fortran version: https://www.ifarchive.org/if-archive/games/source/dungeon-3....

f77 version for Unix: https://github.com/videogamepreservation/zork-fortran

(GNU fortran port: https://github.com/GOFAI/dungeon)

f2c translation (basis of many versions): https://github.com/devshane/zork

(See README for history of this version)

ndiddy 5 hours ago | parent | prev | next [-]

Zork was originally a public-domain mainframe game called Dungeon developed at MIT. Its authors founded Infocom, split the game into 3 pieces, added more content, and released it for microcomputers as the 3 Zork games. The source code that's been floating around since the 80s is for the original Dungeon game. Between the early 80s and the early 90s, the source was translated from MDL to DEC FORTRAN to Unix f77 to C, so you can find a variety of copies of the source at different steps of that translation process. This is also why the C version doesn't look like idiomatic C code.

When Infocom shut down, one or more of the employees took home backups of the Infocom file server. Various partial releases have been leaked publicly from those backups, including tooling/language documentation and the ZIL source code for every Infocom game. The ZIL source code has been public since 2019. The notable thing that Microsoft is doing here is clearing up the rights to the 3 Zork games (but none of the rest of the Infocom titles).

an hour ago | parent | next [-]
[deleted]
m463 2 hours ago | parent | prev | next [-]

I played it as dungeon on a dec vax, probably using a vt100.

anthk 4 hours ago | parent | prev [-]

Not PD, but free as a free ber and non-commercial.

fsckboy 8 hours ago | parent | prev | next [-]

i'm not a complete expert on this, but the dates entailed here trigger clear memories.

the date on the Zork archive you linked to is 1977. in 1977 there was not really yet a notable software market for personal computers based on microcomputer chips, and software development at MIT in that timeframe would have been on Multics or DEC-10 or 20's and (probably not quite) the dawn of Vax-750s

just a couple years later the names on the archive you linked to went on to found infocom to sell this software ported to personal computers, Apple II 6502's or CPM S-100 bus 8080 and Z80s.

the Colossol Cave Adventure game for the PDP-10 had been released (to other institutions that had PDP-10's) just a couple years before and had caught fire in popularity at universities. These people at MIT took the same idea and reimplemented it with embellishments.

CobrastanJorji 8 hours ago | parent | prev [-]

Good question, I'm also curious. A quick search shows that there are some differences. The one in this new historicalsources folder has the PLUGH easter egg, but the other one doesn't seem to have it.

But the older version has a "Tomb of the Unknown Implementor," which this new version seems to lack.