Paolo Amoroso's Journal

Tech projects, hobby programming, and geeky thoughts of Paolo Amoroso

Now that I'm back to Lisp I'm actively exploring Interlisp as a Common Lisp environment too.

But to code in Common Lisp also on my Crostini Linux system, the Linux container of chromeOS I use on a Chromebox, I'm setting up a suitable development environment. In addition to console programs I want to write GUI applications with McCLIM.

The Common Lisp implementation I chose, SBCL, is a no brainer given its features, performance, and active maintenance. As for the development environment I won't go with the default on Linux, Emacs. Although I used Emacs for years and loved it, now it feels overkill and I'd prefer not to re-learn its intricacies.

Instead I'm using Lem, a great Emacs-like IDE written in Common Lisp with a user interface and keybindings similar to those of Emacs and SLIME. Thus my familiarity with Emacs is enough to get me up to speed. A nice side effect of Lem's implementation language is the IDE can be configured and extended in Common Lisp, which I feel more at home with than Emacs Lisp.

Despite some initial installation issues Lem works well on Crostini, is fast, and has a nice SDL2 backend. I really like the IDE.

If I need to write or run some Common Lisp code on my Raspberry Pi 400 I can easily replicate this setup there.

#CommonLisp #Lisp

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

Forty years ago these days, in November of 1983, my book Saturno: nubi, anelli e lune was released by the small Italian publisher Italy Press. Early that year I had started writing this astronomy book about the planet Saturn.

The paperback book "Saturno: nubi, anelli e lune" (Saturn: clouds, rings, and moons) by Paolo Amoroso, Italy Press, 1983.

Such a traditional publishing deal, my first and only one, was a stroke of luck.

While most debut writers collect dozens or hundreds of rejections before landing a deal, I got mine easily at the first try. I was a kid almost old enough to sign a contract and, when I pitched the idea, the publisher agreed with no objections. What's even more remarkable is the publisher trusted not just one kid at his first book writing experience, but four.

Along with three friends of similar age we pitched the idea of a series of astronomy books. I picked the one on Saturn and my friends did the others.

The book proved a success as the print run of 4,000 copies was distributed throughout Italy and sold well. It earned me roughly one fifth of what top science writers were paid for for similar work at the time.

#publishing #books #astronomy

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

A few days ago I blogged on why I cancelled my paid plan to Replit.

It was a short personal note to record my decision as I often do to document my experiences with tools and products, possibly of interest to the few dozen regulars per day who read my blog.

A day on the home page of Hacker News, over 170 votes, almost 150 comments, and nearly 20,000 views later, it became clear I underestimated the impact of the post. I should have expected mixing parting ways with a product by a red hot startup like Replit, and a red hot technology like AI, could generate some attention.

The discussion in the comments on Hacker News is pretty interesting and I can't do more than reply to a few. But I'd like to address a couple of issues raised in the comments.

Some readers wondered whether I feel entitled to great products at little or no cost, thus making it difficult for companies to survive and innovate. I'd actually be happy to pay for Replit at the new higher price. But my shift to Lisp, and the diverging direction of Replit's evolution, widen a gap between cost and benefits that reduces the value of Replit to me, possibly even at the old lower price.

Others pointed out I'm a niche user while Replit caters to an audience of mainstream developers with different needs. This is true. Replit's features make it a great value for those users such as web developers. For example, deploying a web app by just listening to a port is beyond magical. But this is not what I need.

Replit cofounder Faris Masad also read my post and invited me to a video call. He gave me the opportunity — thanks! — to elaborate on the issues raised in the post and share my feedback on what Replit is missing for Lisp. Faris listened carefully, as he said improving Lisp support can improve the experience also with other languages.

This conversation and the other feedback convinced me to follow more closely the evolution of Replit and reevaluate my decision.

#development #Lisp

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

I cancelled my annual Replit Hacker plan and I'll let it lapse at the end of December of 2023.

Replit is a popular and growing multi language development environment in the cloud. I've been subscribing to the Hacker plan for the past few years and it worked well for my Python projects, as such an online environment is a good match for my chromeOS lifestyle. But two changes made me reconsider the value of the product.

The first is Replit changed its paid tiers by raising the price of my plan and removing some features. I actually saw it coming when Replit began receiving massive funding by major investors, who are likely pressuring the company to reduce costs and turn profits. Still, this left a sour taste as it felt like a bait and switch.

The other change is my shift of focus back to Lisp, the programming language I love most and know best.

Replit doesn't work well with a highly interactive language like Lisp. It doesn't directly support any Lisp dialects and its default code editor provides little or no integration with a running Lisp image. Moreover, the files created or uploaded outside of the editor are often not preserved across sessions. If I have to install and maintain a full Lisp system in the Linux shell of a Replit workspace, I might as well install it locally on my desktop computer.

Finally, like other development tool vendors, Replit is doubling down on AI coding features which affect the cost of paid plans. But I'm not interested in this as the whole point of my hobby programming is to write all the code myself and learn from the experience.

Update

This post was shared on Hacker News and I blogged about the reactions.

#development #Python #Lisp

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

Medley is the first Lisp system I experimented with on my new Raspberry Pi 400, here is the AArch64 version on the Raspberry Pi OS desktop:

SDL version of Medley Interlisp on a Raspberry Pi 400 under Raspberry Pi OS.

The online version of Medley runs well and smoothly enough in Chromium. There are no major or unexpected performance differences between the Pi 400 and my Chromebox.

But the AArch64 .deb package of the prebuilt Medley distribution is really, really slow on the Pi 400. For example, when launching the program I can see the characters being printed one by one to the Exec window. The problem is the AArch64 release is built for X-Windows, which on the Wayland based Raspberry Pi OS Bookworm goes through Xwayland with degraded performance.

Therefore I built from source the SDL version of Medley that doesn't rely on X-Windows.

Building everything, i.e. compiling Maiko and making the loadups, takes less than five minutes on the Pi 400. Although the process is simple, it took me some trial and error to figure the exact steps from the limited documentation. Nick Briggs helped me troubleshoot the build and advised on how to create a missing makefile.

The SDL version is snappier than the default AArch64 Debian package. Now Medley starts up almost instantly. The only inconvenience common to both versions is they don't recognize my Italian keyboard as they work only with the English US layout.

#Interlisp #pi400

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

I bought a lovely little computer, a Raspberry Pi 400, and two accessories, a 64 GB Samsung Pro Endurance microSD card to hold the file system and a very cheap Full HD webcam for video calls.

Raspberry Pi 400, Samsung Pro Endurance 64 GB microSD card, and Full HD webcam product boxes.

I always wanted a Raspberry computer but assumed the components and cables would take up too much space at my work station.

Recently though I carefully inspected the layout of my desk, the HDMI ports of my HP Pavillon 23cw monitor, and the nearby electrical sockets. Researching the Raspberry Pi 400 convinced me I could set the device on the desk with minimal inconvenience and little space.

This is not a full review but a collection of early impressions and usage notes after working with the device for a week.

Motivations

Although I have possible uses for the Pi 400, one of the reasons why I got it is not technical: the computer has a delightful form factor.

My daily driver, an ASUS Chromebox 3, is a high end desktop system. But the opportunity of using a different device with a nice form factor is a welcome and refreshing context switch that helps productivity and makes things fun. It's like writers spending time at Starbucks to get some work done instead of sitting and typing at their desk at home.

Another reason for getting the Pi 400 is I always loved Linux. Since switching to chromeOS in 2015 I've been thinking of how to set up a Linux box as a secondary computer within the constraints of my work station. The Pi 400 finally enabled this possibility.

Another major consideration that drew me to the Pi 400 is it's a full, native Linux system specifically designed as a combination of hardware and software to run Linux. Raspberry Pi OS is tightly integrated with the hardware and well supported, which will hopefully spare me the nightmares of Linux updates frequently breaking X-Windows back in the day.

Finally, I wanted a computer for experimenting with various computing technologies, such as ARM on the desktop. And, of course, I wanted an extra computer to play with Medley and other Lisp systems.

The Pi 400 is a member of the Raspberry family at the heart of countless electronics and IoT projects. But, since I'm not a hardware guy, I'll use it mostly as a desktop productivity and software development environment.

Reviews

I extensively researched the Pi 400 and a key theme of what I learned is performance.

The reviews describe and evaluate performance through a wide range of experiences that doesn't make it easy to figure what to expect. Perhaps because the specs place the device at a spot of the performance spectrum along the transition between realizing responsiveness is suboptimal, and not noticing anything unusual about the way the system reacts.

Therefore, given the affordable price, I accepted the small risk of disappointment and went with the Pi 400.

What I think the reviews don't highlight enough is that, even at the lower end of the performance spectrum, Raspberry absolutely nailed the combination of form factor and price of the Pi 400. It sits at a local maximum in the product space that delivers tremendous value for the money.

Hardware

The Italian keyboard of my Pi 400, which makes up the entire device, has nearly the same size as the TedGen keyboard of my Chromebox. The keys of the Pi 400 are actually slightly larger than those of the TedGen and support well my typing speed, which is not much.

I feel at ease with the Pi 400 keyboard because I prefer short-travel chicklet units. The plastic feel and feedback aren't an issue for me as, again, the mechanics and build don't interfere with my relatively slow typing.

Although not as smooth and precise as the Logitech mouse of my Chromebox, the Pi 400 one is acceptable despite the occasional lower than average responsiveness.

The Pi 400 instantly recognized the new Full HD webcam as well as my Mixcoder E9 Bluetooth headphones and Brother HL-L2340DW wireless printer. The webcam delivers a smooth feed with Google Meet and good image quality for the price.

Software

I've been using Unix since the early 1990s and Linux since the mid 1990s, so the Raspberry Pi OS desktop and system look mostly familiar.

I personalized the desktop environment to make it look similar to my Chromebox. I set a similar background color, moved the taskbar to the botton like the chromeOS shelf, and set Chromium as the default browser with a matching tab layout.

This is what my Raspberry Pi OS desktop looks like:

Raspberry Pi OS desktop on a Raspberry Pi 400.

Since my daily driver on the desktop is a Chromebox I mostly live in the browser, with a number of tabs often open on Google products. On the Pi 400 Chromium works well enough with Google web apps. But I can't synchronize my extensions and settings with chromeOS as Google removed the functionality from Chromium.

Although most of the programs I need are available, I haven't found an easy to install screencasting tool with Wayland support.

Usage

I don't leave the Pi 400 permanently on the desk but set it up on demand.

Whenever I need the device I bring it out, set it on the desk, and connect the cables. One of the cables goes into the HP monitor which the Pi 400 shares with the Chromebox. I can use either computer by switching the monitor input signal with a button.

The only Ethernet wall socket close to the desk is permanently hooked to the Chromebox. The Pi 400 accesses the network over Wi-Fi at up to 70-80 Mbps.

Setup and configuration

To initially set up the Pi 400 I connected it to the Ethernet socket so the required large file downloads and system updates could go faster.

For installing the operating system on the microSD card I originally planned to run the Raspberry Pi Imager tool on my Chromebox under the Debian based Crostini Linux. But, although Raspberry Pi OS is derived from Debian, the only binaries of such an essential tool are available only for Ubuntu. Raspberry does provide instructions for building a package for Debian but network installation on the Pi 400 seemed simpler.

I selected the 64-bit version of Raspberry Pi OS Bookworm desktop and recommended software.

Despite the simplicity of the process, which can complete in less than a quarter of an hour, it took me three reinstallations and a couple of hours because of a subtle Raspberry Pi Imager bug.

I also configured SSH and headless access to the Pi 400 from my Chromebox with the recommended VNC client TigerVNC, the only one that supports Wayland on Raspberry Pi OS Bookworm. But the Pi 400 is just too slow and laggy over VNC with my setup, which makes it viable in a pinch.

Performance

The Pi 400 is no gaming rig but delivers enough performance for most ordinary tasks without the feel of constant wait and lag.

This supports well the kinds of tasks I ordinarily carry out such as running a browser with half a dozen tabs, a terminal, and another program or two. I don't consume much media.

The most noticeable manifestation of performance limitations is that programs don't start up instantaneously. For example, Chromium comes up in about 4 seconds. But once programs start, they run with mostly instantaneous responsiveness for common tasks.

YouTube streams consistently smoothly over Wi-Fi at 1080p and full screen, but entering or leaving full screen mode freezes the browser for a few seconds.

I don't mind the overall experience as I'm used to systems with similar architecture like cheap Android tablets and Chromebooks. The Pi 400 actually feels snappier than my Lenovo Yoga N26 Chromebook.

Although not architecturally similar to the Pi 400, the 8-bit single board computers I use for my retrocomputing projects, such as the Z80-MBC2, deliver a comparable feel that's part of the expected experience.

Speaking of retrocomputing, one the reason I got the Pi 400 is to run Medley, other historical Lisp systems, and emulated classic computers at a level of performance closer to the originals. Running Medley on powerful desktop systems or in the cloud is much faster, thus limiting the appreciation of certain design decisions, features, or workflows the systems imposed back in the day.

The more I use the Pi 400, the more the perception of not operating a powerful computer is fading away as I focus on the tasks I use it for.

An example can express and synthesize this perception. As I said earlier, I configured the desktop environment of the Pi 400 to look similar to that of my Chromebox. The Pi 400 often feels so smooth I forget I'm not on the Chromebox.

Conclusions

it's been a week since I unboxed the Pi 400 and I love it.

The product has the perfect combination of features, form factor, and price for my needs. This surprisingly capable little computer is one of the rare lovely products that encourage to use it, be productive, and have fun.

#pi400 #linux

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

Although Medley's documentation and published material is scattered across several archives and sources, and doesn't cover all the system facilities, once I find the right document I get most of the information I need on a specific feature.

But sometimes the information is not up to date because Medley is still under development after so many decades.

I bumped into such a case when experimenting with TableBrowser, Medley's tabular data browser tool on which the system file browser is built. Other applications can access and control from Lisp TableBrowser, which is a reusable component with an API.

Before program development with the API, TableBrowser requires setting up a specific environment by loading a source file with some declarations, which are not needed when running compiled applications. The Lisp Library Packages manual explains how to set up the environment in section “Installation” of the “TABLEBROWSER” chapter on page 283 of the PDF. Here the manual provides the File Manager commands to add to the source file of an application that uses TableBrowser:

(FILES (SYSLOAD) TABLEBROWSER)
(DECLARE: EVAL@COMPILE DONTCOPY
     (FILES (SOURCE) TABLEBROWSERDECLS)

But in spite of following these instructions I got an error when calling TableBrowser functions.

It turns out that, as a result of the recent modernization work the Medley Interlisp Project is doing, some source files were rearranged and moved. So now all it takes to set up the Lisp environment for development with TableBrowser is the form (LOADCOMP 'TABLEBROWSER), for example in the coms of the program under development.

#Interlisp #Lisp

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

The short ebooks on Intel 8086 Assembly programming Oscar Toledo self published are some of the best 8086 resources I've seen.

After introducing the 8086 instruction set and Assembly, Programming Boot Sector Games describes the source code of several games each of which fits into the boot sector of a PC, 512 bytes. The sequel, More Boot Sector Games, covers more games.

The introduction to 8086 insructions in the first book is short and to the point. It's enough to code fairly advanced programs without overwhelming with information as processor manuals and full length books typically do. But Oscar also shares his considerable experience and insight by discussing many 8086 tricks, idioms, practical advice, and optimization techniques.

The books cover not only games but also other interesting 8086 programs such as a BASIC interpreter and a tiny operating system.

Since some of the code is dense and advanced, reading it once may not be enough for a full understanding. But a great feature of these programs is they fit into 512 bytes, so there's an upper bound to complexity which rereading the code and the text helps overcome.

The only downside of the books is they are password-protected PDF files. It's an annoyance when opening them in ereading apps but is easy to overcome.

#assembly #books

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

Since encountering Medley I gained considerable experience with Interlisp. Medley Interlisp is a project for preserving, reviving, and modernizing the Interlisp-D software development environment of the Lisp Machines Xerox created at PARC.

Nine months later I know enough to find my way around and confidently use most of the major system tools and features.

I read all the available documentation, books, and publications, so I know where to look for information. And I undertook Interlisp programming projects such as Stringscope, Braincons, Sysrama, and Femtounit.

Now I'm ready to explore Medley as a Common Lisp development environment.

Although most of the system, facilities, and tools are written in and designed around Interlisp, the companies that maintained and marketed Medley over time partially implemented Common Lisp and integrated it with the environment. The completion level of the implementation is somewhere between CLtL1 and CLtL2, plus CLOS via Portable Common Loops (PCL).

Motivation

I want to widen this experience to Common Lisp.

I'll leverage the more advanced Lisp dialect and interface with Interlisp's facilities as an application platform that comprises a rich set of libraries and tools such a window system, graphics primitives, menu facilities, and GUI controls for building applications. Each world can interoperate with the other, so Common Lisp functions can call Interlisp ones and the other way around.

Developing Common Lisp programs with Medley is both my goal and a way of achieving it through practice. Medley is an ideal self-contained computing universe for my personal projects and Common Lisp greatly enchances its toolbox.

Tools

The main tools for developing Common Lisp code are the same as for Interlisp: the SEdit structure editor for writing code; the File Manager, a make-like tool for tracking changes to Lisp objects in the running image and saving them to files; and the Executive (or Exec), the Lisp listener.

However, the workflow is subtly different.

In some cases taking advantage of the integration with Medley involves different steps for Common Lisp code. For example, defining and changing packages so that the File Manager notices and tracks them needs to be done in a certain order. And there are Medley extensions to the package forms.

When working with Common Lisp I open at least two Execs, a Common Lisp and an Interlisp one. The former is for testing, running, and evaluating Common Lisp code.

The Interlisp Exec is for launching system tools and interacting with the File Manager. Since all the symbols of SEdit, the File Manager, and other system tools are in the IL Interlisp package, in an Interlisp Exec it's not necessary to add package qualifiers to symbols all the time.

Exec commands such as DIR and CD work the same in both Execs.

Documentation

Medley's Common Lisp features aren't documented in the Interlisp Reference Manual, the main information source about the system. The reason is the companies that distributed and maintained the product ceased operations before the work on implementing and documenting Common Lisp was completed.

I found only a couple of good sources on Common Lisp under Medley.

The implementation notes and the release notes of Lyric, the music-themed codename of one of Interlisp-D's versions, provide an overview of the integration between Common Lisp and Medley. The release notes of Medley 1.0, a later version, expand on this. Issue 5 of HOTLINE!, a newsletter Xerox published for its Lisp customers, has useful step by step examples of creating and managing Common Lisp packages the Medley way.

Some of the system code of Medley is written in Common Lisp and may be a source of usage examples and idioms. I'm also writing Common Lisp code snippets to test my understanding of the integration with Medley.

#CommonLisp #Interlisp #Lisp

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

Planet Python carried out my request to remove my blog from the aggregator. Now their feed no longer syndicates my posts about Python, which I'll no longer write much about.

Planet Python is an aggregator of blogs, podcasts, and other resources of interest to the Python community. In late 2019 I submitted the feed of Python posts of my old blog, later updating it to point to my new blog.

I was learning the language and sharing on the blog my experience with coding projects and other experiences. But although I had great fun with Python and accomplished a lot I'm proud of, my interest waned as I rediscovered my old love Lisp.

I encountered Scheme in the early 1990s at an introductory computer science class based on Structure and Interpretation of Computer Programs, fell in love with the Lisp family of languages, and learned Common Lisp and Emacs Lisp. Lisp became my only language until the early 2010s when real life claimed my time and attention. Near the end of the decade, intrigued by Python and its massive ecosystem, I decided to learn it.

At the beginning of 2023 I discovered Medley Interlisp and got hooked.

Using Interlisp and its environment made me realize Lisp is the language that comes most natural to me, I'm most productive with, and gives me joy and not just fun. I never mastered and enjoyed other languages to the level of Lisp. And my projects turned out not to need Python's batteries.

I'll still maintain a reading knowledge of Python and keep up with its ecosystem. But this journey made me readjust my focus on Lisp, now my only language.

It's good to be back home.

#Interlisp #Python #Lisp #blogging

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

Enter your email to subscribe to updates.