death by obesity - lrde.epita.fr · death by obesity didier verna languages homoiconicity...

16
Death by Obesity Didier Verna Languages Homoiconicity Conclusion Death by Obesity Didier Verna @didierverna [email protected] facebook/didier.verna meetic/didou 1/19

Upload: others

Post on 16-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

Death by Obesity

Didier Verna

@[email protected]/didier.verna

meetic/didou

1/19

Page 2: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 3: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 4: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

Language PyramidsDesign vs. emergence

5/19

Page 5: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 6: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

Occidental music notationRelatively small language

7/19

Page 7: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

Occidental music notation is Tuning-complete!Lots of expressive power

8/19

Page 8: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

Occidental music notationEven provides some DSLs

9/19

Page 9: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 10: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 11: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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

Page 12: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

The LISP pyramidWhich one is it?

14/19

Page 13: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?

16/19

Page 14: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?

JTC1/SC22/WG21

17/19

Page 15: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

Death byObesity

Didier Verna

Languages

Homoiconicity

Conclusion

SOS: the Syntactic Obesity ScaleHow would you grade your favorite language ?

Should you be worried?

18/19

Page 16: Death by Obesity - lrde.epita.fr · Death by Obesity Didier Verna Languages Homoiconicity Conclusion Language diversity Turing-completeness vs. Human-completeness Many different shapes

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