This repository has been archived by the owner on Nov 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
presentation.gk
executable file
·96 lines (88 loc) · 2.57 KB
/
presentation.gk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!./gherkin -l
(def map
(fn (f xs)
(if xs
(cons (f (car xs)) (map f (cdr xs))))))
(def bold
(fn (s)
(str "\033[1m" s "\033[0m")))
(def blue
(fn (s)
(str "\033[1;34m" s "\033[0m")))
(def title
(fn (s)
(bold (blue (str s "\n\n")))))
(def conj-slides
(list
(list
(title "unix: ok, shell: $!@$#")
"- both are everywhere"
"- shell: the universal hypervisor?"
"- unix/shell support powerful primitives"
" - 'buffered channels' via fifo"
" - 'channels' via streams"
" - 'processes' via job control"
" - ... hidden behind reams of esoterica, syntax"
"how do we replace bash?")
(list
(title "gherkin - a lisp1 written in bash4")
"https://github.com/alandipert/gherkin"
"@alandipert")
(list
(title "things it has")
"- string, integer, symbol scalars"
"- symbols tagged, easily extensible"
" - bignum/floats via promoting ops, contagion"
" - shell out to bc(1)"
"- mark/sweep GC"
"- dynamic binding: def/setq/binding"
"- lexical binding: fn*"
" - varargs: (fn (x y & more) ...)"
"- non-stack-consuming recursion"
" - via recur in fn tail position"
"- namespaces (almost)")
(list
(title "things it will have")
"- deftype, extend"
" - protocols for IFn, ISeq, Channel, etc."
"- first-class macros (fexpr)"
"- lazy seqs"
"- channels/core.async primitives, terse REPL mode a la eshell"
"- save-world/load-world"
" - dump interp. state/env to executable .sh"
" - save-world and slipstream to AMIs via user-data?"
)
(list
(title "things it might have")
"- clojure interpreter"
"- concurrent GC"
"- compiler"
" - #lang gherkin in Racket"
"- static type checking via core.typed"
"- embedded prolog via make(1)?!")
(list
(title "things it will never have")
"- assoc. data other than alist/plist"
" - no real array in bash"
"- numeric performance"
" - any performance"
" - of any conceivable kind"
"- suckiness")
(list
(title "thanks to:")
"Darius Bacon et al: awklisp"
"Spencer Tipping: for a contagious imagination"
"Aaron Brooks: early feedback on original reader"
"Aron Griffis: bash pro tips"
"Joel Martin: REPL readline support, bind(2) patch to Bash")))
(def present
(fn (slides)
(if slides
(do
(sh! "clear")
(apply println (map (fn (line) (str "\t" line)) (car slides)))
(read)
(recur (cdr slides))))))
(present conj-slides)
(println (blue "Switching to REPL!"))
((fn () (println (eval (read))) (recur)))