#+title: Why Wisp? #+options: num:nil toc:nil # Export as s5 presentation. See http://orgmode.org/worg/org-tutorials/non-beamer-presentations.html #+BEGIN_SRC elisp :exports none (require 'ox-s5) #+END_SRC * Elegance #+html: <br /> ** *.,":'_#?!;* /The most common non-letter, non-math characters in prose/ ** *()* /The most common paired characters/ (From letter distributions in newspapers) * On Words #+BEGIN_SRC elisp :exports results :results results raw (defun shuffle-wordcontent (string) (interactive) (let ((strings (split-string string))) (substring (apply 'concat (loop for s in strings collect (if (< (length s) 4) (concat s " ") (concat (substring s 0 1) (apply 'concat (mapcar 'string (shuffle-vector (string-to-vector (substring s 1 -1))))) (substring s -1) " ")))) 0 -1))) (concat "*" (setq why-wisp-text-scheme-has (shuffle-wordcontent "Scheme follows a minimalist design philosophy")) "*") #+END_SRC #+RESULTS: *Shcmee fowlols a malisimint dsegin plhpoihosy* - /Defocus a bit/ - /Can you see the meaning?/ * Scheme for Newcomers #+BEGIN_SRC elisp :exports results :results results raw (concat "*€" (combine-and-quote-strings (split-string why-wisp-text-scheme-has) " €") (apply 'concat (loop for word in (split-string why-wisp-text-scheme-has) collect "¥") ) "*") #+END_SRC #+RESULTS: *€Shcmee €fowlols €a €malisimint €dsegin €plhpoihosy¥¥¥¥¥¥* - /Try it again/ - /Do you see how much harder it got?/ - /€ and ¥ escape your existing filters/ * Summary 1. Lisp syntax uses the *most common* non-letter, non-math characters. 2. 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* * On Wisp #+html: <br /> #+BEGIN_SRC scheme define : hello display "Hello Schemers!\n" #+END_SRC becomes #+BEGIN_SRC scheme (define (hello) (display "Hello Schemers!\n")) #+END_SRC * Why not SRFI-49 (Indentation-sensitive syntax)? ** Scheme #+BEGIN_SRC scheme (+ 5 (* 4 3) 2 1 0) #+END_SRC ** SRFI-49 #+BEGIN_SRC scheme + 5 * 4 3 2 1 0 #+END_SRC * Continuing the argument list in wisp #+BEGIN_SRC scheme + 5 * 4 3 . 2 1 0 #+END_SRC - Complete representation of arbitrary structures - Generalize =(. x) ⇒ x= to =(. x ...) ⇒ x ...= - Use =. . x= to get a real =. x= after processing * Why no SRFI-110 (Sweet-expressions (t-expressions)) #+BEGIN_SRC scheme myfunction x: \\ original-x y: \\ calculate-y original-y #+END_SRC #+BEGIN_SRC scheme a b $ c d e $ f g #+END_SRC #+BEGIN_SRC scheme let <* x getx() \\ y gety() *> ! {{x * x} + {y * y}} #+END_SRC /This breaks elegance 1/ /Also the problems of SRFI-49 are preserved/ * Wisp syntax 1/4: Indentation #+BEGIN_SRC scheme display + 3 4 5 newline #+END_SRC becomes #+BEGIN_SRC scheme (display (+ 3 4 5)) (newline) #+END_SRC * Wisp syntax 2/4: Continue Argument list #+BEGIN_SRC scheme + 5 * 4 3 . 2 1 #+END_SRC becomes #+BEGIN_SRC scheme (+ 5 (* 4 3) 2 1 #+END_SRC * Wisp syntax 3/4: Double Parens #+BEGIN_SRC scheme let : x 1 y 2 z 3 body #+END_SRC becomes #+BEGIN_SRC scheme (let ((x 1) (y 2) (z 3)) body) #+END_SRC * Wisp syntax 4/4: Resilient Indentation #+BEGIN_SRC scheme let _ : x 1 __ y 2 __ z 3 _ body #+END_SRC becomes #+BEGIN_SRC scheme (let ((x 1) (y 2) (z 3)) body) #+END_SRC * Wisp syntax justification #+html: <small> http://draketo.de/light/english/wisp-lisp-indentation-preprocessor#sec-4 #+html: </small> /I do not like adding any unnecessary syntax element to lisp. So I want to show explicitely why the syntax elements are required to meet the goal of wisp: indentation-based lisp with a simple preprocessor./ - =.= Continue argument list - =:= Double parens - =_= Survive HTML