lisp in a startup: the good, the bad & the ugly vsevolod ... · lisp in a startup: the good,...

31
Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Upload: others

Post on 24-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Lisp in a Startup:The Good, The Bad & The Ugly

Vsevolod DyomkinFranz Inc.

2018-04-17 @ ELS

Page 2: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

A Bit about Me

https://vseloved.github.io

Page 3: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

https://vseloved.github.io

Page 4: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Startup Requirements* Support research & experimentation* Flexibility

Not:* Safety* Ease of reusing existing solutions* User-friendliness* Whatever

Page 5: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

The Good: The Language* Dynamism* Interactivity* Uniformity

Page 6: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

DynamismNot just:* Dynamic typing* OO with late binding

Page 7: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Dynamism

Page 8: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

DynamismNot just:* Dynamic typing* OO with late binding

What can (should?) also be redefined: * syntax* program flow* type signatures & class hierarchies* executable code* namespaces* dependencies* you name it

Page 9: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

(signal ‘commited)

Page 10: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

DLL Hell

“Loading Multiple Versions ofan ASDF System in the Same Image” https://www.youtube.com/watch?v=VN58mZsHWXk

Page 11: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

DSLs

(defmethod crawlik:scrape ((site geo) source) (crawlik:match-html source '(>> (div :class "lastcol ...") (>> (div :class "portlet_content") (ul (li) (>> (span :class "counts") ($ gds)) (>> (span :class "counts") ($ gse)))))))

Page 12: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

(defmethod match-expr ((head (eql :$)) &rest tail) "Match variable: ($ name &optional expr)." (when (or (single tail) (let ((*tree* *tree*)) (apply 'match-expr (rest tail)))) (:= (? *vars* (first tail)) *tree* *tree* nil) t))

(defmethod match-expr ((head (eql :>>)) &rest tail) "Match by tree depth-first search: (>> tag &rest contents)." (or (when (apply 'match-expr tail) !!!) (when (listp *tree*) (let (matched) (dolist (*tree* (rest *tree*) matched) (when (apply 'match-expr :>> tail) (if *match-multiple* (:= matched t) (return t)))))) (void *tree*)))

Page 13: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Interactivity

Page 14: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

The “Hardest” BugSocket error in "socket": EPROTONOSUPPORT (Protocol not supported) [Condition of type SB-BSD-SOCKETS:PROTOCOL-NOT-SUPPORTED-ERROR]…the problem (analysis by John Fremlin):

The shared-initialize calls getprotobyname which is not thread safe.

There is little need to call this function at runtime anyway as theseproto numbers are quite stable, but getprotobyname_r is a safealternative (on GNU/Linux).

“Fix”:(defun sb-bsd-sockets:get-protocol-by-name (name) (case name (:tcp 6) (:udp 17)))

https://bugs.launchpad.net/sbcl/+bug/505497

See also: https://tech.grammarly.com/blog/running-lisp-in-production

Page 15: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Uniformity

=>

http://lisp-univ-etc.blogspot.com/2013/04/errors-in-your-platform.html

Page 16: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

If I could change just 1 thing…

Page 17: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

If I could change just 1 thing…

Eradicate the .-syntax for cons cells! (defun |...-reader| (stream char) (when (char= #\. (peek-char nil stream)) (unless (equal '(#\. #\.) (list (read-char stream) (read-char stream))) (error "malformed ...")) '|...|))

Page 18: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

3 Flavors of Gains* incremental* game-changers* synergy

Page 19: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

The Bad: The Environment

Page 20: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

The Modern Programmer

Page 21: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Abandonware

Page 22: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

bzip2 bug

Page 23: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Implementation Issues

Page 24: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

YMMV

* IDEs/editor support* Documentation/manuals* What else?

Page 25: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

The Ugly: The FAD

Page 26: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Fight FAD?* Killer App? well, we already have Emacs

* Success Story? ITA ($1B), Grammarly, etc.

Page 27: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Fight FAD?* Killer App? well, we already have Emacs

* Success Story? ITA ($1B), Grammarly, etc.

… good, but not enough - we need other positive directions

Page 28: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

Rebranding?Common Lisp

http://lisp-univ-etc.blogspot.com.es/2013/01/common-lisp-is-just-lisp.html

Lisp-familylanguages:

Page 29: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

A Company-Champion?

Page 30: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS

A Community Edition?

Page 31: Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod ... · Lisp in a Startup: The Good, The Bad & The Ugly Vsevolod Dyomkin Franz Inc. 2018-04-17 @ ELS