runtest: Don't worry about how implementation echoes input
[jackhill/mal.git] / examples / presentation.mal
1 ;; Mal Presentation
2
3 (def! clear
4 (fn* ()
5 (str "\e[2J\e[;H")))
6
7 (def! bold
8 (fn* (s)
9 (str "\e[1m" s "\e[0m")))
10
11 (def! blue
12 (fn* (s)
13 (str "\e[1;34m" s "\e[0m")))
14
15 (def! title
16 (fn* (s)
17 (bold (blue (str s "\n")))))
18
19 (def! title2
20 (fn* (s)
21 (bold (blue s))))
22
23
24 (def! slides
25 (list
26 (list
27 (title2 " __ __ _ _")
28 (title2 "| \/ | / \ | |")
29 (title2 "| |\/| | / _ \ | | ")
30 (title2 "| | | |/ ___ \| |___ ")
31 (title2 "|_| |_/_/ \_\_____|"))
32 (list
33 (title "gherkin")
34 "- a lisp1 written in bash4")
35 (list
36 (title "mal - an interpreter for a subset of Clojure"))
37 (list
38 (title "mal - an interpreter for a subset of Clojure")
39 "- written in GNU make")
40 (list
41 (title "mal - an interpreter for a subset of Clojure")
42 "- written in GNU make"
43 "- and Bash 4")
44 (list
45 (title "mal - an interpreter for a subset of Clojure")
46 "- written in GNU make"
47 "- and Bash 4"
48 "- and Javascript")
49 (list
50 (title "mal - an interpreter for a subset of Clojure")
51 "- written in GNU make"
52 "- and Bash 4"
53 "- and Javascript"
54 "- and Python")
55 (list
56 (title "mal - an interpreter for a subset of Clojure")
57 "- written in GNU make"
58 "- and Bash 4"
59 "- and Javascript"
60 "- and Python"
61 "- and Clojure")
62 (list
63 (title "mal - an interpreter for a subset of Clojure")
64 "- written in GNU make"
65 "- and Bash 4"
66 "- and Javascript"
67 "- and Python"
68 "- and Clojure"
69 "- and 17 other languages")
70 (list
71 (title "things it has")
72 "- scalars: integers, strings, symbols, keywords, nil, true, false"
73 "- immutable collections: lists, vectors, hash-maps"
74 "- metadata, atoms"
75 "- def!, fn*, let*"
76 " - varargs: (fn* (x y & more) ...)"
77 "- tail call optimization"
78 " - except GNU make implementation (no iteration)"
79 "- macros (quote, unquote, quasiquote, splice-quote)"
80 "- over 500 unit tests"
81 "- REPL with line editing (GNU readline/libedit/linenoise)")
82 (list
83 (title "things it does not have")
84 "- performance"
85 "- namespaces"
86 "- GC (in bash, make, C implementations)"
87 "- protocols :-("
88 "- lots of other things")
89 (list
90 (title "why?")
91 "- because!")
92 (list
93 (title "why?")
94 "- because!"
95 "- gherkin was an inspiration to higher levels of crazy"
96 "- evolved into learning tool"
97 "- way to learn about Lisp and also the target language"
98 "- each implementation broken into small 11 steps")
99 (list
100 (title "thanks to:")
101 "- Peter Norvig: inspiration: lispy"
102 " - http://norvig.com/lispy.html"
103 "- Alan Dipert: gherkin, original gherkin slides"
104 " - https://github.com/alandipert/gherkin")
105 (list
106 (title "mal - Make a Lisp")
107 "https://github.com/kanaka/mal")
108 (list
109 (title "demo"))))
110
111 (def! present
112 (fn* (slides)
113 (if (> (count slides) 0)
114 (do
115 (println (clear))
116
117 (apply println (map (fn* (line) (str "\n " line)) (first slides)))
118 (println "\n\n\n")
119 (readline "")
120 (present (rest slides))))))
121
122 (present slides)