2014-03-25 01:32:24 +04:00
|
|
|
|
;; Mal Presentation
|
|
|
|
|
|
|
|
|
|
(def! clear
|
|
|
|
|
(fn* ()
|
|
|
|
|
(str "[2J[;H")))
|
|
|
|
|
|
|
|
|
|
(def! bold
|
|
|
|
|
(fn* (s)
|
|
|
|
|
(str "[1m" s "[0m")))
|
|
|
|
|
|
|
|
|
|
(def! blue
|
|
|
|
|
(fn* (s)
|
|
|
|
|
(str "[1;34m" s "[0m")))
|
|
|
|
|
|
|
|
|
|
(def! title
|
|
|
|
|
(fn* (s)
|
|
|
|
|
(bold (blue (str s "\n")))))
|
|
|
|
|
|
|
|
|
|
(def! title2
|
|
|
|
|
(fn* (s)
|
|
|
|
|
(bold (blue s))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(def! conj-slides
|
|
|
|
|
(list
|
|
|
|
|
(list
|
|
|
|
|
(title2 " __ __ _ _")
|
2017-09-15 08:00:23 +03:00
|
|
|
|
(title2 "| \\/ | / \\ | |")
|
|
|
|
|
(title2 "| |\\/| | / _ \\ | | ")
|
|
|
|
|
(title2 "| | | |/ ___ \\| |___ ")
|
|
|
|
|
(title2 "|_| |_/_/ \\_\\_____|"))
|
2014-03-25 01:32:24 +04:00
|
|
|
|
(list
|
|
|
|
|
(title "gherkin")
|
|
|
|
|
"- a lisp1 written in bash4")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure"))
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make"
|
|
|
|
|
"- and Bash 4")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make"
|
|
|
|
|
"- and Bash 4"
|
|
|
|
|
"- and Javascript")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make"
|
|
|
|
|
"- and Bash 4"
|
|
|
|
|
"- and Javascript"
|
|
|
|
|
"- and Python")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make"
|
|
|
|
|
"- and Bash 4"
|
|
|
|
|
"- and Javascript"
|
|
|
|
|
"- and Python"
|
|
|
|
|
"- and Clojure")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - an interpreter for a subset of Clojure")
|
|
|
|
|
"- written in GNU make"
|
|
|
|
|
"- and Bash 4"
|
|
|
|
|
"- and Javascript"
|
|
|
|
|
"- and Python"
|
|
|
|
|
"- and Clojure"
|
|
|
|
|
"- and C and Java and PHP")
|
|
|
|
|
(list
|
|
|
|
|
(title "things it has")
|
|
|
|
|
"- scalars: integers, strings, symbols, nil, true, false"
|
|
|
|
|
"- immutable collections: lists, vectors, hash-maps"
|
|
|
|
|
"- metadata, atoms"
|
|
|
|
|
"- def!, fn*, let*"
|
|
|
|
|
" - varargs: (fn* (x y & more) ...)"
|
|
|
|
|
"- tail call optimization"
|
|
|
|
|
" - except GNU make implementation (no iteration)"
|
|
|
|
|
"- macros (quote, unquote, quasiquote, splice-quote)"
|
2014-03-26 02:15:11 +04:00
|
|
|
|
"- almost 300 unit tests"
|
|
|
|
|
"- REPL with readline (GNU readline or libedit)")
|
2014-03-25 01:32:24 +04:00
|
|
|
|
(list
|
|
|
|
|
(title "things it does not have")
|
|
|
|
|
"- performance"
|
|
|
|
|
"- namespaces"
|
|
|
|
|
"- keywords"
|
2017-09-15 20:57:10 +03:00
|
|
|
|
"- GC (in bash, make, C implementations)"
|
2014-03-26 02:15:11 +04:00
|
|
|
|
"- lots of other things")
|
2014-03-25 01:32:24 +04:00
|
|
|
|
(list
|
|
|
|
|
(title "why?")
|
|
|
|
|
"- because!")
|
|
|
|
|
(list
|
|
|
|
|
(title "why?")
|
|
|
|
|
"- because!"
|
|
|
|
|
"- gherkin was an inspiration to higher levels of crazy"
|
|
|
|
|
"- evolved into learning tool"
|
2014-03-26 02:15:11 +04:00
|
|
|
|
"- way to learn about Lisp and also the target language"
|
|
|
|
|
"- each implementation broken into small 10 steps")
|
2014-03-25 01:32:24 +04:00
|
|
|
|
(list
|
|
|
|
|
(title "thanks to:")
|
|
|
|
|
"- Peter Norvig: inspiration: lispy"
|
|
|
|
|
" - http://norvig.com/lispy.html"
|
|
|
|
|
"- Alan Dipert: gherkin, original gherkin slides"
|
|
|
|
|
" - https://github.com/alandipert/gherkin")
|
|
|
|
|
(list
|
|
|
|
|
(title "mal - Make a Lisp")
|
|
|
|
|
"https://github.com/kanaka/mal")
|
|
|
|
|
(list
|
|
|
|
|
(title "demo"))))
|
|
|
|
|
|
|
|
|
|
(def! present
|
|
|
|
|
(fn* (slides)
|
|
|
|
|
(if (> (count slides) 0)
|
|
|
|
|
(do
|
|
|
|
|
;;(py!* "import os; r = os.system('clear')")
|
|
|
|
|
;;(sh* "clear")
|
|
|
|
|
;;(make* "$(shell clear)")
|
|
|
|
|
(println (clear))
|
|
|
|
|
|
|
|
|
|
;;(prn (first slides))
|
|
|
|
|
(apply println (map (fn* (line) (str "\n " line)) (first slides)))
|
|
|
|
|
(println "\n\n\n")
|
|
|
|
|
(readline "")
|
|
|
|
|
(present (rest slides))))))
|
|
|
|
|
|
|
|
|
|
(present conj-slides)
|
|
|
|
|
|