Dao of lisp

21
Dao of lisp @sbelak [email protected]

Transcript of Dao of lisp

Page 2: Dao of lisp
Page 3: Dao of lisp

The Artificial Intelligence people were endeavouring to write programs that no one knew how to write. The idea that you could sit down and say: 'Well, here is my problem, here are the requirements, let me come up with a specification and now code that up' (was) completely crazy as far as the AI people were concerned' The only way to write AI programs, then (as it still is now) was by taking an exploratory approach to development. The only way to do it was to experiment. 'Let me try this, let me add that. Let me try to add this fuzzy concept, let me try to add a scheduler, let me add agendas, let me add resources, let me have resource-limitations' ... you're not constructing it like making a ton of source code and compiling it periodically, you're constructing it the way you construct a city: build some of it, it's running all the time, so it's kind of like a live programming language.

— R. Gabriel

Page 4: Dao of lisp

Two schools of thinking

Page 5: Dao of lisp

System paradigmLanguage paradigm

infoq.com/presentations/Mixin-based-Inheritance realworldclojure.com/the-system-paradigm

Page 6: Dao of lisp

The system paradigm

1. Nibble at the problem from different directions

2. Compose partial solutions into the final solution

Page 7: Dao of lisp

“Composition is about decomposing.”

— E. Normand

Page 8: Dao of lisp

Live programming with the REPL

Page 9: Dao of lisp

code = datahomoiconicity:

Page 10: Dao of lisp

code

Page 11: Dao of lisp

code

data

Page 12: Dao of lisp

“This is possibly Clojure’s most important property: the syntax expresses the code’s semantic layers. An experienced reader of Clojure can skip over most of the code and have a lossless understanding of its high-level intent.”

— Z. Tellman, Elements of Clojure

Page 13: Dao of lisp

code

data =AST

Page 14: Dao of lisp

Macrosdata = code

Page 15: Dao of lisp

Macroexpand time

run timevs.

Page 16: Dao of lisp

Problem languagemacroexpand-1macroexpand-2

macroexpand-n...

implementation language

Page 17: Dao of lisp

Simple first, then Easy

Page 18: Dao of lisp

It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.

— A. Perils

Page 19: Dao of lisp

You can write lisp in any language

norvig.com/spell-correct.html

Page 20: Dao of lisp

The next 70 years

linkedin.com/pulse/how-write-your-first-quantum-program-view-supply-christoph