0
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 
• Metaobjec...
Common Lisp is expressive 
• Reader macros 
• Macros
Common Lisp is fast 
• (Optional) type declaration 
• Inlining functions 
• Compiler macros 
• Disassembler included 
• Fr...
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...
It’s because of the origin.
Portability 
8 Goals of 
standardising Common Lisp 
Commonality 
Consistency 
Expressiveness 
Compatibility 
Efficiency 
P...
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 impleme...
Portability 
8 Goals of 
standardising Common Lisp 
Commonality 
Consistency 
Expressiveness 
Compatibility 
Efficiency 
P...
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) ...
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...
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 ...
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})$" 
"...
Expressiveness of CL21 
CL21 
(use-package :cl21.re) 
! 
(#/^(d{4})-(d{2})-(d{2})$/ "2014-01-23") 
(re-replace #/a/ig "Eit...
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.re) 
! 
(#/^(#/^(d{4})-(d{2})-(d{2})$/ 
"2014-01-23") 
(re-replace #/a...
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.re) 
! 
(#/^(#/^(d{4})-(d{2})-(d{2})$/ 
"2014-01-23") 
(re-replace #/a...
Expressiveness of CL21 
Common Lisp 
(ql:quickload :clazy) 
(use-package :clazy) 
! 
(defun fib-seq () 
(labels ((rec (a b...
Expressiveness of CL21 
CL21 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
(lazy-sequence (cons a ...
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
Abstract sequence 
(...
Expressiveness of CL21 
CL21 
! 
(use-package :cl21.lazy) 
! 
(defun fib-seq () 
(labels ((rec (a b) 
Abstract sequence 
(...
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 "sr...
Compatibility of CL21 
(! 
defsystem my-cl21-app 
:defsystem-depends-on (:cl21) 
:class :cl21-system 
:components ((:file ...
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.p...
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...
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
Upcoming SlideShare
Loading in...5
×

Redesigning Common Lisp

5,772

Published on

Shibuya.lisp Tech Talk #8

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
  • Thank you very much for these works. I hope CL21 will grow into a mainstream programing language for lispers. I love it.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
5,772
On Slideshare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
15
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide

Transcript of "Redesigning Common Lisp"

  1. 1. Shibuya.lisp Tech Talk #8 Eitaro Fukamachi Redesigning Common Lisp
  2. 2. Thank you for coming.
  3. 3. I’m Eitaro Fukamachi @nitro_idiot fukamachi
  4. 4. (and 'web-application-developer 'common-lisper)
  5. 5. GitHub product languages Others Clojure Perl Emacs Lisp JavaScript Common Lisp
  6. 6. GitHub product languages
  7. 7. I ♥ Common Lisp
  8. 8. because…
  9. 9. Common Lisp is the most powerful, expressive and fast language ever.
  10. 10. Common Lisp is damn powerful • First class functions + lexical closures • Object system + multiple dispatch • Metaobject protocol
  11. 11. Common Lisp is expressive • Reader macros • Macros
  12. 12. Common Lisp is fast • (Optional) type declaration • Inlining functions • Compiler macros • Disassembler included • Free high-performance implementation
  13. 13. Common Lisp is the most powerful, expressive and fast language ever.
  14. 14. = GOD LANGUAGE
  15. 15. So, here is a question.
  16. 16. Is Common Lisp perfect?
  17. 17. Is Common Lisp successful?
  18. 18. Is Common Lisp attractive to young people?
  19. 19. ……………..
  20. 20. “well…”
  21. 21. 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
  22. 22. It’s because of the origin.
  23. 23. Portability 8 Goals of standardising Common Lisp Commonality Consistency Expressiveness Compatibility Efficiency Power Stability from Common Lisp the Language
  24. 24. Common Lisp is a compound of MacLISP, Zetalisp, Spice Lisp, NIL and S-1 Lisp.
  25. 25. Common Lisp was designed for MacLISP, Zetalisp, Spice Lisp, NIL and S-1 Lisp users, not us.
  26. 26. Besides, Common Lisp is old.
  27. 27. Common Lisp = 30 years old Ruby = 19 years old JavaScript = 19 years old Clojure = 7 years old
  28. 28. Common Lisp was designed for people 30 years ago.
  29. 29. But it doesn’t mean Common Lisp is obsolete.
  30. 30. Common Lisp is the most powerful, expressive and fast language ever.
  31. 31. Common Lisp is the best one, but I’m still not fulfilled in it.
  32. 32. CLtL3? Almost hopeless.
  33. 33. Let’s redesign Common Lisp for the 21st century by ourselves.
  34. 34. “Common Lisp for the 21st century”
  35. 35. “CL21”
  36. 36. What is CL21? • (One of) the next generation of Common Lisp • Bases on Common Lisp • Designed for us • Actual implementation (not only discussions)
  37. 37. Portability 8 Goals of standardising Common Lisp Commonality Consistency Expressiveness Compatibility Efficiency Power Stability from Common Lisp the Language
  38. 38. Consistency Expressiveness 4 Goals of CL21 Compatibility Efficiency
  39. 39. Goal 1: Consistency
  40. 40. Consistency of CL21 • Naming convention • Argument order
  41. 41. 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))
  42. 42. 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))
  43. 43. Consistency of CL21 Common Lisp (getf person :name) (gethash :name person-hash)
  44. 44. Consistency of CL21 CL21 (getf person :name) (gethash person-hash :name)
  45. 45. Goal 2: Expressiveness
  46. 46. Expressiveness of CL21 • Specific vs Generic • Delete useless symbols
  47. 47. Expressiveness of CL21 • Specific vs Generic • Delete useless symbols
  48. 48. Expressiveness of CL21 • Specific vs Generic • Delete useless symbols
  49. 49. Expressiveness of CL21 • Specific vs Generic • Delete useless symbols (ed “~/.sbclrc”)
  50. 50. Expressiveness of CL21 • Specific vs Generic • Delete useless symbols Are you crazy???? (ed “~/.sbclrc”)
  51. 51. Expressiveness of CL21 Common Lisp (append '(1 2 3) '(a b c)) (concatenate 'vector #(1 2 3) '()) (concatenate 'string "Hello, " name)
  52. 52. Expressiveness of CL21 CL21 (append '(1 2 3) '(a b c)) (append #(1 2 3) '()) (append "Hello, " name)
  53. 53. Expressiveness of CL21 Common Lisp (mapcar #'1+ '(1 2 3)) (map 'vector #'1+ #(1 2 3))
  54. 54. Expressiveness of CL21 CL21 (map #'1+ '(1 2 3)) (map #'1+ #(1 2 3))
  55. 55. Expressiveness of CL21 Common Lisp (format nil "Hello, World!~%") (format nil "Hello, ~A~%" name)
  56. 56. Expressiveness of CL21 CL21 "Hello, World!n" #"Hello, ${name}n"
  57. 57. Expressiveness of CL21 Common Lisp (parse-integer "1984") (symbol-name 'alien-technology)
  58. 58. Expressiveness of CL21 CL21 (coerce "1984" 'integer) (coerce 'alien-technology 'string)
  59. 59. 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
  60. 60. Expressiveness of CL21 CL21 (use-package :cl21.re) ! (#/^(d{4})-(d{2})-(d{2})$/ "2014-01-23") (re-replace #/a/ig "Eitaro Fukamachi" "α")
  61. 61. Expressiveness of CL21 CL21 ! (use-package :cl21.re) ! (#/^(#/^(d{4})-(d{2})-(d{2})$/ "2014-01-23") (re-replace #/a/ig "Eitaro Fukamachi" "α")
  62. 62. 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
  63. 63. 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))
  64. 64. 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)
  65. 65. 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)
  66. 66. 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
  67. 67. Goal 3: Compatibility
  68. 68. Compatibility of CL21 • Written in Common Lisp • 100% compatible with Common Lisp • All CL libraries are available
  69. 69. Compatibility of CL21 (defsystem my-cl21-app :defsystem-depends-on (:cl21) :class :cl21-system :components ((:file "src/myapp")))
  70. 70. Compatibility of CL21 (! defsystem my-cl21-app :defsystem-depends-on (:cl21) :class :cl21-system :components ((:file "src/myapp")))
  71. 71. Goal 4: Efficiency
  72. 72. Efficiency of CL21 • (less important in CL21, though) • Generic methods are slow • Compiler macros
  73. 73. Consistency Expressiveness 4 Goals of CL21 Compatibility Efficiency
  74. 74. Other topics: “syntax”
  75. 75. “syntax” • CL21 has “syntax” • “syntax” = readtable bound to a package
  76. 76. “syntax” (defsyntax cl21.process ((## #`) #'run-process-reader)) ! (export-syntax 'cl21.process) (use-package :cl21.process) ! #`ls -l /Users`
  77. 77. Other topics: Standard libraries
  78. 78. Batteries included (?) • cl21.re • cl21.process • cl21.lazy • cl21.os
  79. 79. Remember CL21 is 100% compatible with Common Lisp
  80. 80. You see how Common Lisp is expressive and growable?
  81. 81. Current status
  82. 82. Current status • Still in development • No backward-compatibility guaranteed • We’ll release in the 21st century • Not settled discussions • loop vs iterate vs series
  83. 83. WEB SITE: cl21.org ! GITHUB: github.com/cl21/cl21
  84. 84. Make Lisp the Premier Prototyping Language. — Richard P. Gabriel “Worse Is Better”
  85. 85. Thanks.
  86. 86. EITARO FUKAMACHI 8arrow.org @nitro_idiot fukamachi
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×