Paolo Amoroso's Journal

lisp

Although I used several Lisp systems over a couple of decades, I never tried structure editing.

The chance finally came when I encountered Medley Interlisp, the Lisp system that pioneered structure editing. In particular I use SEdit which is the most advanced and user-friendly Interlisp structure editor.

I really like structure editing. It feels easier than I expected, natural, and productive. Plus it's a lot of fun.

The Medley Interlisp project is rehosting and modernizing the system to run on contemporary operating systems and computers but there are still a few rough edges, such as missing or broken keystrokes. Most notably the arrow keys don't work. I assumed this would severely limit coding with SEdit, but it turns out the tool can still be used productively and with very little friction.

Despite the issue, mouse operation in SEdit may be faster than the equivalent keystrokes of traditional text editors.

For example, once the cursor is at the destination, selecting and moving a complex list structure can be done with a single mouse click while holding down the Shift and Ctrl keys. Text editors typically require delimiting the code block to move, which takes a few keystrokes to go to and mark the end points, and executing the move command with an additional keystroke or more.

Where structure editing shines is with rearranging code. The structure-aware commands to select expressions and lists make it fast to copy, move, adjust the nesting level of, or delete large code blocks with a few mouse clicks or keystrokes.

Text editors allow inserting characters almost anywhere, while SEdit enforces the Lisp syntax and lets me type code only where allowed. But thinking in terms of structures instead of character sequences is less constraining that I thought. I enter Lisp expressions in a fill-in-the-blanks kind of way, in which the blanks are the spots where the syntax allows something. Sometimes it helps to type the code in a top-down way, from the outer list structures to the inner ones.

After relatively little practice with SEdit the awareness of structure editing is fading away, thus letting me focus on the code. It's now second nature and I no longer pay attention to how to perform editing tasks, as my muscle and action memory kicks in.

I had a similar early experience with Lisp's parentheses. They “disappeared” very soon and never were a source of friction.

#Interlisp #Lisp

Discuss... Email | Reply @amoroso@fosstodon.org

The post on my encounter with Medley Interlisp ended up on the front page of Hacker News, receiving over 34K views and a lot of attention.

Larry Masinter, one of the original Medley Interlisp designers and current maintainers, invited me to join the project. I'm really honored and happy to have accepted, as I'm meaning to explore Medley Interlisp and use it as my main development environment. Also, I hope to give something back to this incredible retrocomputing project.

My first pull request was merged. It's a trivial change that adds a new section, written by another maintainer, to a page of the project website. But I'm pleased as it helped me familiarize with the development process, the code base, and the toolchain.

I'll initially focus on documentation and outreach, a byproduct of my learning journey. In the long term I may venture into contributing some fixes or additional Lisp code.

#Interlisp #Lisp #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org

My first Medley Interlisp blog post was shared on Hacker News, got over a hundred upvotes, and ended up on the front page, where it still is a day later after climbing up to number 5. So far my post received over 24K views, and counting.

I'm really glad Medley Interlisp is gaining some very well deserved attention.

#blogging #Interlisp #Lisp

Discuss... Email | Reply @amoroso@fosstodon.org

Imagine someone let you into an alien spaceship they landed in your backyard, sat you at the controls, and encouraged you to fly the ship. This is the opportunity Medley Interlisp offers.

The project

Medley Interlisp is a project aiming to restore the Interlisp-D software environment of the Lisp Machines Xerox produced since the early 1980s, and rehost it on modern operating systems and computers. It's unique in the retrocomputing space in that many of the original designers and implementors of major parts of the system are participating in the effort.

The project started slightly over three years ago and is little known, so I stumbled upon it by chance. I was immediately drawn to Medley Interlisp for two reasons.

My experience with Lisp

First, I have a soft spot for Lisp. Since the early 1990s, for a couple of decades I extensively used several Lisp dialects and systems such as Scheme, Common Lisp, and Emacs Lisp.

I read a lot about Lisp Machines and their lost wonders but never got a chance to use one.

Although I always wanted to try such a system, hardware solutions are impractical and there are only a handful of Lisp Machine emulators, usually limited or difficult to set up. So the second reason Medley Interlisp caught my attention is, unlike similar efforts, it offers a complete environment that's easy to install and run. It can even run in the cloud and be accessed in a browser, here it is on my Chromebox:

Medley Interlisp running in a browser on chromeOS.

Why Medley Interlisp is different

The Medley Interlisp project is significant because it provides access to the full Interlisp-D software system. Working with a Lisp Machine environment feels like an encounter with an advanced civilization, so the spaceship metaphor is fitting.

A number of features make the image-based environments of Lisp Machines unique and still largely unparalleled by traditional file-based development environments and tools, where code is stored in source files and the environments are separate from the systems being built.

In an image-based environment, the developer builds programs by directly adapting and extending the running image of a system that consists of system software and development tools. The programs under development and the tools they're built with share the same space.

Everything is an API. Pretty much everything — system services, functions, user code, data structures, libraries, tools, GUI components and graphics, files, and resources — can access, inspect, call, and modify everything else. The environment provides a myriad of such building blocks that can be easily and quickly combined in countless ways to create more complex systems.

All these features transform Medley Interlisp into a productive, controlled creative chaos that encourages and supports prototyping and exploration.

The challenges

Medley Interlisp has some key strenghts, such as a rich environment and the ability to run in a browser. But the restoration and rehosting work is still under way, which makes using the system even more challenging.

The learning curve of such a complex system is steep, almost vertical.

This is less of an issue than it seems as I overcome these hurdles by diving deep into the documentation. I read everything I come across and at first not much makes sense. Eventually, my brain processes in the background all the information and the pieces start to fall into place.

Medley Interlisp comes with a dozen thousand pages worth of manuals, books, and academic papers, not to mention Lisp's built-in documentation and introspection facilities. I hope this knowledge will eventually help me contribute to the project in some way.

Also, due to the many layers of modern software the system now runs on, some of the original keybindings are broken or not properly mapped.

For example, pressing the arrow keys has no effect and doesn't move the text cursor. The keys are important for controlling system tools such as code and text editors. But, for the time being, there are good mouse-based alternatives that don't introduce too much friction when coding.

How I'll use Medley Interlisp

Despite some issues, my interest in Medley Interlisp goes beyond studying a significant software artifact of the history of computing. This decades old environment still has great practical value.

I'd like to use Medley Interlisp as my primary development environment for exploring problem domains, prototyping, and learning computer science. The problem understanding and design insights gained by experimenting with Medley Interlisp can be transferred to the projects I choose to implement with modern programming languages and tools.

The performance of the rehosted Medley Interlisp is pretty good. On my Chromebox it even runs faster in the browser than in the Crostini Linux container.

And I love the timeless, clean design of the black and white Medley Interlisp GUI, a style that evokes the elegance of printed paper. Only some pixelation gives away the historical roots of Medley Interlisp in an era predating the wide support for anti-aliasing.

As a hobby programmer I get to decide what tools to use and what projects to work on. I highly enjoy this complete creative freedom. The freedom to play with the tools I love, no matter how old or weird.

#Interlisp #Lisp #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org