death by obesity - lrde.epita.fr · death by obesity didier verna languages homoiconicity...
TRANSCRIPT
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Death by Obesity
Didier Verna
@[email protected]/didier.verna
meetic/didou
1/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language diversityTuring-completeness vs. Human-completeness
Many different shapesI C-like, Prolog, LISP, Forth. . .I Romance, English, German, Chinese, Japanese. . .
Syntactic diversitySemantic diversity
3/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language complexityTuring-madness vs. Human-wiseness
Natural languagesI All natural languages share a comparable level of
overall complexity [Pinker]Programming languages
I I don’t think so. . .
4/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language PyramidsDesign vs. emergence
5/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Language growthBy size vs. by complexity
Natural languages grow in sizeI by “vocabulibrary”
Programming languages grow in complexityI by syntax
This is WRONG! (maybe the only case ?)
6/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notationRelatively small language
7/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notation is Tuning-complete!Lots of expressive power
8/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
Occidental music notationEven provides some DSLs
9/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
The LISP UFO (Unidentified Functional Object)Syntactic anorexia
Core syntax:I Atoms: foo, 45, "string", ...I 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 byObesity
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 byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
There is syntax!But it is programmable
Customizable syntaxI ’foo => (quote foo)I #’foo => (function foo)
MacrosI (loop for i from 1 upto 10
collect (sqrt i))
HomoiconicityI Code: (sqrt 2)I Data: (sqrt 2)
13/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
The LISP pyramidWhich one is it?
14/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?
16/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?
JTC1/SC22/WG21
17/19
Death byObesity
Didier Verna
Languages
Homoiconicity
Conclusion
SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?
Should you be worried?
18/19
Death byObesity
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