Shibuya.lisp Tech Talk #8 Eitaro Fukamachi 
Redesigning Common Lisp
Thank you for coming.
I’m Eitaro Fukamachi 
@nitro_idiot fukamachi
(and 'web-application-developer 
'common-lisper)
GitHub product languages 
Others 
Clojure 
Perl 
Emacs Lisp 
JavaScript 
Common Lisp
GitHub product languages
I ♥ Common Lisp
because…
Common Lisp is 
the most powerful, expressive 
and fast language ever.
Common Lisp is damn powerful 
• First class functions + lexical closures 
• Object system + multiple dispatch 
• Metaobject protocol
Common Lisp is expressive 
• Reader macros 
• Macros
Common Lisp is fast 
• (Optional) type declaration 
• Inlining functions 
• Compiler macros 
• Disassembler included 
• Free high-performance implementation
Common Lisp is 
the most powerful, expressive 
and fast language ever.
= GOD LANGUAGE
So, here is a question.
Is Common Lisp 
perfect?
Is Common Lisp 
successful?
Is Common Lisp 
attractive to young people?
……………..
“well…”
Common Lisp is 
not sophisticated 
• too-long-wordy-name-for-common-macros 
• append & nconc 
• elt vs aref vs nth 
• getf vs gethash 
• map?? mapc?? dolist?? loop?? 
• Functional vs Procedual
It’s because of the origin.
Portability 
8 Goals of 
standardising Common Lisp 
Commonality 
Consistency 
Expressiveness 
Compatibility 
Efficiency 
Power 
Stability 
from Common Lisp the Language
Common Lisp is a compound of 
MacLISP, Zetalisp, 
Spice Lisp, NIL and S-1 Lisp.
Common Lisp was designed for 
MacLISP, Zetalisp, 
Spice Lisp, NIL and S-1 Lisp 
users, not us.
Besides, 
Common Lisp is old.
Common Lisp = 30 years old 
Ruby = 19 years old 
JavaScript = 19 years old 
Clojure = 7 years old
Common Lisp was designed for 
people 30 years ago.
But it doesn’t mean 
Common Lisp is obsolete.
Common Lisp is 
the most powerful, expressive 
and fast language ever.
Common Lisp is the best one, 
but I’m still not fulfilled in it.
CLtL3? Almost hopeless.
Let’s redesign Common Lisp 
for the 21st century 
by ourselves.
“Common Lisp 
for the 21st century”
“CL21”
What is CL21? 
• (One of) the next generation of 
Common Lisp 
• Bases on Common Lisp 
• Designed for us 
• Actual implementation 
(not only discussions)
Portability 
8 Goals of 
standardising Common Lisp 
Commonality 
Consistency 
Expressiveness 
Compatibility 
Efficiency 
Power 
Stability 
from Common Lisp the Language
Consistency 
Expressiveness 
4 Goals of CL21 
Compatibility 
Efficiency
Goal 1: Consistency
Consistency of CL21 
• Naming convention 
• Argument order
Consistency of CL21 
Common Lisp 
(reverse '(1 2 3)) 
(nreverse '(1 2 3)) 
! 
(append '(1 2 3) '(a b c)) 
(nconc '(1 2 3) '(a b c))
Consistency of CL21 
CL21 
(reverse '(1 2 3)) 
(nreverse '(1 2 3)) 
! 
(append '(1 2 3) '(a b c)) 
(nappend '(1 2 3) '(a b c))
Consistency of CL21 
Common Lisp 
(getf person :name) 
(gethash :name person-hash)
Consistency of CL21 
CL21 
(getf person :name) 
(gethash person-hash :name)
Goal 2: Expressiveness
Expressiveness of CL21 
• Specific vs Generic 
• Delete useless symbols
Expressiveness of CL21 
• Specific vs Generic 
• Delete useless symbols
Expressiveness of CL21 
• Specific vs Generic 
• Delete useless symbols
Expressiveness of CL21 
• Specific vs Generic 
• Delete useless symbols 
(ed “~/.sbclrc”)
Expressiveness of CL21 
• Specific vs Generic 
• Delete useless symbols 
Are you crazy???? 
(ed “~/.sbclrc”)
Expressiveness of CL21 
Common Lisp 
(append '(1 2 3) '(a b c)) 
(concatenate 'vector #(1 2 3) '()) 
(concatenate 'string "Hello, " name)
Expressiveness of CL21 
CL21 
(append '(1 2 3) '(a b c)) 
(append #(1 2 3) '()) 
(append "Hello, " name)
Expressiveness of CL21 
Common Lisp 
(mapcar #'1+ '(1 2 3)) 
(map 'vector #'1+ #(1 2 3))
Expressiveness of CL21 
CL21 
(map #'1+ '(1 2 3)) 
(map #'1+ #(1 2 3))
Expressiveness of CL21 
Common Lisp 
(format nil "Hello, World!~%") 
(format nil "Hello, ~A~%" name)
Expressiveness of CL21 
CL21 
"Hello, World!n" 
#"Hello, ${name}n"
Expressiveness of CL21 
Common Lisp 
(parse-integer "1984") 
(symbol-name 'alien-technology)
Expressiveness of CL21 
CL21 
(coerce "1984" 'integer) 
(coerce 'alien-technology 'string)
Expressiveness of CL21 
(ql:quickload :cl-ppcre) 
(use-package :cl-ppcre) 
! 
(scan-to-strings "^(d{4})-(d{2})-(d{2})$" 
"2014-01-23") 
(regex-replace-all "a" "Eitaro Fukamachi" "α" 
:preserve-case nil) 
Common Lisp
Expressiveness of CL21 
CL21 
(use-package :cl21.re) 
! 
(#/^(d{4})-(d{2})-(d{2})$/ "2014-01-23") 
(re-replace #/a/ig "Eitaro Fukamachi" "α")
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.re) 
! 
(#/^(#/^(d{4})-(d{2})-(d{2})$/ 
"2014-01-23") 
(re-replace #/a/ig 
"Eitaro Fukamachi" "α")
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.re) 
! 
(#/^(#/^(d{4})-(d{2})-(d{2})$/ 
"2014-01-23") 
(re-replace #/a/ig 
"Eitaro Fukamachi" "α") 
Appliable Regex literal
Expressiveness of CL21 
Common Lisp 
(ql:quickload :clazy) 
(use-package :clazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
(clazy:lazily (cons a 
(rec b (+ a b)))))) 
(rec 0 1))) 
! 
(head (tail (tail (tail (fib-seq))))) 
(lazy-seq:take 5 (fib-seq))
Expressiveness of CL21 
CL21 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
(lazy-sequence (cons a 
(rec b (+ a b)))))) 
(rec 0 1))) 
! 
(first (rest (rest (rest (fib-seq))))) 
(elt (fib-seq) 3) 
(subseq (fib-seq) 0 5)
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
Abstract sequence 
(lazy-sequence 
(cons a 
(rec b (+ a b)))))) 
(rec 0 1))) 
! 
! 
! 
! 
! 
(first (rest (rest (rest (fib-seq))))) 
(elt (fib-seq) 3) 
(subseq (fib-seq) 0 5)
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
Abstract sequence 
(lazy-sequence 
(cons a 
(rec b (+ a b)))))) 
(rec 0 1))) 
! 
! 
! 
! 
! 
(first (rest (rest (rest 
(fib-seq))))) 
(elt 
(fib-seq) 3) 
(subseq 
(fib-seq) 0 5) 
Builtin sequence functions 
are available
Goal 3: Compatibility
Compatibility of CL21 
• Written in Common Lisp 
• 100% compatible with Common Lisp 
• All CL libraries are available
Compatibility of CL21 
(defsystem my-cl21-app 
:defsystem-depends-on (:cl21) 
:class :cl21-system 
:components ((:file "src/myapp")))
Compatibility of CL21 
(! 
defsystem my-cl21-app 
:defsystem-depends-on (:cl21) 
:class :cl21-system 
:components ((:file "src/myapp")))
Goal 4: Efficiency
Efficiency of CL21 
• (less important in CL21, though) 
• Generic methods are slow 
• Compiler macros
Consistency 
Expressiveness 
4 Goals of CL21 
Compatibility 
Efficiency
Other topics: “syntax”
“syntax” 
• CL21 has “syntax” 
• “syntax” = readtable bound to a package
“syntax” 
(defsyntax cl21.process 
((## #`) #'run-process-reader)) 
! 
(export-syntax 'cl21.process) 
(use-package :cl21.process) 
! 
#`ls -l /Users`
Other topics: 
Standard libraries
Batteries included (?) 
• cl21.re 
• cl21.process 
• cl21.lazy 
• cl21.os
Remember 
CL21 is 100% compatible 
with Common Lisp
You see 
how Common Lisp is 
expressive and growable?
Current status
Current status 
• Still in development 
• No backward-compatibility guaranteed 
• We’ll release in the 21st century 
• Not settled discussions 
• loop vs iterate vs series
WEB SITE: 
cl21.org 
! 
GITHUB: 
github.com/cl21/cl21
Make Lisp the Premier 
Prototyping Language. 
— Richard P. Gabriel “Worse Is Better”
Thanks.
EITARO FUKAMACHI 
8arrow.org 
@nitro_idiot fukamachi

Redesigning Common Lisp