Get Your Lisp On With The Dune Shell

Lisp is one of those programming languages that seems to keep taunting us for not learning it properly. It is still used for teaching functional languages today. [Adam McDaniel] has an obvious fondness for this fifty-year-old language and has used it in several projects, including their own shell, Dune.

Dune is a shell designed for powerful scripting. Think of it as an unholy combination of bash and Lisp.

Dune is designed to be highly customisable, allowing you to create a super-optimised workstation for your admin and programming tasks. [Adam] describes the front end for Dune as having turned up the cosiness dial to eleven, and we can see that. A cosy home is personalised, and Dune lets you customise everything.

Dune is a useable functional programming environment with a reasonably complete standard library to back it up, which should simplify some of the more complicated sysadmin tasks. [Adam] says the language also supports a few metaprogramming concepts, such as a quote operator, operator overloading, and macro programming. It’s difficult to describe much more about what you can do with Dune, as it’s a general-purpose programming language wrapped in a shell. The possibilities are endless, and [Adam] is looking forward to seeing what you lot out there do with his project!

The shell can be personalised by editing the prelude file, which allows you to overload functions for the prompt text, the incomplete prompt text (so you can implement intelligent completion options), and a function that deals with the formatting of the command response text. [Adam] gives us his personal prelude file, which defines many helper functions displaying useful things such as the current weather, a calendar, and an ASCII art cat. You never know when that might come in handy. This file is written in Lisp, so we reckon that’s where many people will start as they come up the Lisp (re)learning curve before embarking on more involved automation. Dune was written in Rust, so you need that infrastructure to install it with Cargo.

As we said earlier, Lisp is not a new language. We found a hack for porting a Lisp interpreter to any old language and also running Lisp bare metal on a Lisp machine. Finally, [Al] takes a look at some alternative shells.

9 thoughts on “Get Your Lisp On With The Dune Shell

    1. Save your breath, the guys that post about software here are enamored with Rust. I think it’s a neat language that the authors have kneecapped by choosing a bizarre syntax. So yeah, C or C++ is the better route.

  1. As a “C” programmer, I read “Practical Common Lisp” by Peter Siebel. It’s interesting, but not practical. Common Lisp is heavy, consider using a small language like Lua for scripting.

    1. Common Lisp being heavy is a pretty outdated cliché. SBCL’s default image (compiler, runtime,
      REPL, and standard library) weighs in around 35MB, same as a modern gcc–just the compilers–without including the C, C++, etc libraries. Lua as used for general purpose scripting needs the C compiler and library it’s built with, too, so technically larger in whole, though that’s certainly no argument against Lua, which is another of my favorites.

  2. I still have a lot of LISP code in my home server, albeit the AutoDesk’s AutoLISP flavor for AutoCAD. This was very useful when I was early in my automotive tool design days: many of the workstations were using AutoCAD or Mechanical Desktop, and there was a demand of applets to create extrusion forms and mechanical fasteners. I wrote those 2 applets and design shops productivity soared, whilst errors dropped off. And to think this was 25 years ago.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.