Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Death by Obesity
Didier Verna
@didierverna
didier@didierverna.net
facebook/didier.verna
meetic/didou
1/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language diversity
Turing-completeness vs. Human-completeness
Many different shapes
C-like, Prolog, LISP, Forth. . .
Romance, English, German, Chinese, Japanese. . .
Syntactic diversity
Semantic diversity
3/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language complexity
Turing-madness vs. Human-wiseness
Natural languages
All natural languages share a comparable level of
overall complexity [Pinker]
Programming languages
I don’t think so. . .
4/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language Pyramids
Design vs. emergence
5/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language growth
By size vs. by complexity
Natural languages grow in size
by “vocabulibrary”
Programming languages grow in complexity
by syntax
This is WRONG! (maybe the only case ?)
6/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notation
Relatively small language
7/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notation is Tuning-complete!
Lots of expressive power
8/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notation
Even provides some DSLs
9/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
The LISP UFO (Unidentified Functional Object)
Syntactic anorexia
Core syntax:
Atoms: foo, 45, "string", ...
S-expressions: (atom sexp sexp atom ...)
(foo 1 2)
(defun foo (n1 n2) ...)
(defun foo (n1 n2)
(declare (type fixnum n1 n2)) ...)
(lambda (n1 n2) ...)
(defstruct struct ...)
(defclass class ...)
(class-slot object)
(setf (class-slot object) value)
...
11/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
Having no syntax is impractical
x | x (1..10)
(BLOCK NIL
(LET ((I 1))
(DECLARE (TYPE (AND REAL NUMBER) I))
(SB-LOOP::WITH-LOOP-LIST-COLLECTION-HEAD (#:LOOP-LIST-HEAD-859
#:LOOP-LIST-TAIL-860)
(SB-LOOP::LOOP-BODY NIL
(NIL NIL (WHEN (> I ’10) (GO SB-LOOP::END-LOOP))
NIL)
((SB-LOOP::LOOP-COLLECT-RPLACD
(#:LOOP-LIST-HEAD-859 #:LOOP-LIST-TAIL-860)
(LIST (SQRT I))))
(NIL (SB-LOOP::LOOP-REALLY-DESETQ I (1+ I))
(WHEN (> I ’10) (GO SB-LOOP::END-LOOP)) NIL)
((RETURN-FROM NIL
(SB-LOOP::LOOP-COLLECT-ANSWER
#:LOOP-LIST-HEAD-859)))))))
12/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
There is syntax!
But it is programmable
Customizable syntax
’foo => (quote foo)
#’foo => (function foo)
Macros
(loop for i from 1 upto 10
collect (sqrt i))
Homoiconicity
Code: (sqrt 2)
Data: (sqrt 2)
13/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
The LISP pyramid
Which one is it?
14/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity Scale
How would you grade your favorite language ?
16/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity Scale
How would you grade your favorite language ?
JTC1/SC22/WG21
17/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity Scale
How would you grade your favorite language ?
Should you be worried?
18/19
Death by
Obesity
Didier Verna
Languages
Homoiconicity
Conclusion
The cure
One pill of Homoiconicitum every morning (for the next 10 years)
and you should be fine. . .
19/19