Home

When you program, you spend more time reading code than writing it... a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor. - Paul Graham


The goal of this "Readable Lisp s-expressions" project is to develop, implement, and gain widespread adoption of more readable format(s) for the S-expressions of Lisp-based languages (such as Common Lisp, Scheme, Emacs Lisp, and Arc).

The [Problem] is that traditional Lisps don't support infix notation, don't support the standard math notation f(...), and require an excessive number of parentheses. Our [Solution] has three tiers that add additional abbreviations to existing Lisp readers. Put briefly:

  1. Curly-infix-expressions (c-expressions): Lists surrounded by {...} are interpreted as infix notation, in a Lispy way. For example, {a + b} represents (+ a b).
  2. Neoteric-expressions (n-expressions): An e(...) is interpreted as (e ...), an e{...} is interpreted as (e {...}). For example, sin(x) represents (sin x).
  3. Sweet-expressions (t-expressions): Parentheses are deduced from indentation:
    • An indented line is a parameter of its parent.
    • Later terms on a line are parameters of the first term.
    • A line with exactly one term and no child lines is simply that term.
    • Empty lines end the previous expression. Just type ENTER ENTER to execute what you've typed.

These are just additional abbreviations - normally-formatted s-expressions continue to work correctly.

You do not need to use all three tiers. You could use neoteric-expressions, for example, which automatically include c-expressions.

Here's one of our [Examples] of sweet-expressions (the top notation tier):

(Awkward) S-expression (Improved) Sweet-expression
(define (factorial n)
  (if (<= n 1)
    1
    (* n (factorial (- n 1)))))
define factorial(n)
  if {n <= 1}
    1
    {n * factorial{n - 1}}

User information

  • [Problem] - more information on the problem we're trying to solve
  • [Solution] - a more detailed description of our solution
    • SRFI-105 - a formal request to implement our infix notation, for Scheme. Note that guile now includes this.
    • SRFI-110 - a formal request to implement our sweet-expression (indentation) format, for Scheme.
  • [Install-howto] - how to install it
  • [Scheme-tutorial] - a tutorial on how to try it out (Scheme-focused)
  • [Common-lisp-tutorial] - a tutorial on how to try it out (Common-Lisp-focused)
  • [Style] - style guide for using them
  • [Examples] - examples of code using these formats
  • [Prepackaged] - list of (some) places where these are pre-packaged
  • [Home] - Readable Lisp project's Wiki home

Philosophy behind the Readable project

  • [Hubris] - we are heretically bucking Lisp traditional syntax
  • [Goals] - what we want to achieve in this project
  • [Rationale] - why we chose what we did in our [Solution]
  • [Retort] - a retort to the critics who claim that this can't be done
  • [Analysis] - an analysis of our notations, trying them out in different Lisps

Download Releases

The "releases" (files) area distributes our software releases for download. The README describes how to install them; they install using usual conventions and include documentation. This reflects the latest version on the "master" branch.

Our draft (development) code is in the readable code git repository "develop" branch; see [Workflow] for information on our workflow. The easy way to start contributing code is to select the "develop" branch (not the "master" branch) and fork it; when you're done, submit a push request. If you want to get the development code using the command line, and give it a go, do this:

     git clone git://git.code.sf.net/p/readable/code readable-code
     cd readable-code
     git checkout -b develop origin/develop  # Set up and switch to "develop" branch
     autoreconf -i && ./configure --prefix=/usr && make

Join us!

[Join] - Please join us!
[Workflow] - Information on our workflow (esp. moving information from the "develop" development branch to the "master" release branch)


Related

Wiki: Analysis
Wiki: Common-lisp-tutorial
Wiki: Examples
Wiki: Goals
Wiki: Home
Wiki: Hubris
Wiki: Install-howto
Wiki: Join
Wiki: Prepackaged
Wiki: Problem
Wiki: Rationale
Wiki: Retort
Wiki: Scheme-tutorial
Wiki: Solution
Wiki: Style
Wiki: Workflow