This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-03
Channels
- # babashka (5)
- # beginners (34)
- # biff (3)
- # calva (29)
- # cherry (11)
- # cider (7)
- # clojure (148)
- # clojure-brasil (1)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (6)
- # clojuredesign-podcast (8)
- # clojurescript (49)
- # cursive (1)
- # datalevin (7)
- # fulcro (1)
- # honeysql (1)
- # jobs (1)
- # matrix (7)
- # off-topic (13)
- # re-frame (12)
- # react (21)
- # reagent (42)
- # releases (6)
- # remote-jobs (2)
- # shadow-cljs (9)
- # solo-full-stack (5)
- # sql (7)
- # squint (9)
- # vim (2)
- # xtdb (11)
- # yamlscript (5)
A ton of work on the YS ecosystem has happened over the last month, but not much useful to show yet. Today I reached a big milestone in that I got the simplest test form to go through all 7 stages of compilation 🙂 This is the compiler flow https://github.com/yaml/yamlscript/blob/clojure/clojure/src/yamlscript/compiler.clj#L22-L28
One thing I added to the python binding is the compile
method which returns the Clojure code value of the YS input
$ python3 -c 'import yamlscript; print(yamlscript.compile("inc: 41"))'
(inc 41)
$ python3 -c 'import yamlscript; print(yamlscript.load("inc: 41"))'
42
Also all the compilation phases have tests now. They are defined here: https://github.com/yaml/yamlscript/blob/clojure/clojure/test/data.yaml
I have a pretty cool way of turning that one file into unit tests for each stage of compilation. For example to test the resolver stage I have this file: https://github.com/yaml/yamlscript/blob/clojure/clojure/test/yamlscript/resolver_test.clj
Here's the output of a test run:
$ TEST_VERBOSE=1 make test
lein test
lein test yamlscript.builder-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.compiler-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.composer-test
* test-3: Basic function call with 2 args (test all phases)
* test-1: Most YAML syntax forms in one example
lein test yamlscript.constructor-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.core-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.expander-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.parser-test
* test-3: Basic function call with 2 args (test all phases)
* test-1: Most YAML syntax forms in one example
* test-2: Nested parse events test
lein test yamlscript.printer-test
* test-3: Basic function call with 2 args (test all phases)
lein test yamlscript.resolver-test
* test-3: Basic function call with 2 args (test all phases)
Ran 12 tests containing 12 assertions.
0 failures, 0 errors.