Elegance
.,":'_#?!;
The most common non-letter, non-math characters in prose
()
The most common paired characters
(From letter distributions in newspapers)
On Words
Shcmee fowlols a malisimint dsegin plhpoihosy
- Defocus a bit
- Can you see the meaning?
Scheme for Newcomers
€Shcmee €fowlols €a €malisimint €dsegin €plhpoihosy¥¥¥¥¥¥
- Try it again
- Do you see how much harder it got?
- € and ¥ escape your existing filters
On Lisp
- Lisp syntax uses the most common non-letter, non-math characters.
- The first and last characters are important for text-recognition.
Let’s call these elegance 1 and elegance 2
Any fix for elegance 2 should preserve elegance 1
Elegance 0: generality and homoiconicity: code is data
Summary: Current Lisp Syntax
- √ Code is data.
- √ Uses the most common characters.
- × The first and last characters are always the same.
On Wisp
define : hello
display "Hello Schemers!\n"
becomes
(define (hello) (display "Hello Schemers!\n"))
Why not SRFI-49 (Indentation-sensitive syntax)?
- Scheme
(+ 5 (* 4 3) 2 1 0)
- SRFI-49
+ 5 * 4 3 2 1 0
- Cannot continue the argument list
Continuing the argument list in wisp
- Wisp
+ 5 * 4 3 . 2 1 0
- Complete representation of arbitrary structures
- Generalize
(. x) ⇒ x
to(. x ...) ⇒ x ...
- Use
. . x
to get a real. x
after processing
Why not SRFI-110 (Sweet-expressions (t-expressions))
- SRFI-110
myfunction x: \\ original-x y: \\ calculate-y original-y
a b $ c d e $ f g
let <* x getx() \\ y gety() *> ! {{x * x} + {y * y}}
This breaks elegance 1
The problems of SRFI-49 are preserved, but their impact reduced.
Summary: Why wisp?
- Wisp
minimal indentation-based syntax
- Wisp vs. SRFI-49: continue the argument list.
- Wisp vs. SRFI-110:
- use common characters (elegance 1).
- KISS.
- use common characters (elegance 1).
Wisp syntax 1/4: function calls
- Indentation
display + 3 4 5 newline
becomes
(display (+ 3 4 5)) (newline)
Wisp syntax 2/4: Continue Arguments
- The dot
+ 5 * 4 3 . 2 1
becomes
(+ 5 (* 4 3) 2 1)
Wisp syntax 3/4: Double Parens
- The colon
let : x 1 y 2 z 3 body
becomes
(let ((x 1) (y 2) (z 3)) (body))
Wisp syntax 4/4: Resilient Indentation
- The underscore (optional)
let _ : x 1 __ y 2 __ z 3 _ body
becomes
(let ((x 1) (y 2) (z 3)) (body))
Summary: Wisp syntax justification
http://draketo.de/light/english/wisp-lisp-indentation-preprocessor#sec-4
Required for the goal of wisp: indentation-based lisp with a simple preprocessor
.
to continue the argument list:
for double parens_
to survive HTML
Wisp mission
“I love the syntax of Python, but crave the simplicity and power of Lisp.”
See the site for info how to test wisp:
http://draketo.de/light/english/wisp-lisp-indentation-preprocessor