diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..98a8228 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,44 @@ +name: Push (compose tests) + +on: + push: {} + pull_request: + branches: [ master ] + workflow_dispatch: {} + +jobs: + tests-and-stats: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install JavaScript and ClojureScript node modules + run: | + ( cd js && npm install ) + ( cd cljs && npm install ) + + - name: JavaScript Step Tests + run: make test^js + + - name: JavaScript Regression Tests + run: make REGRESS=1 test^js + + - name: Python Step Tests + run: make test^python + + - name: Python Regression Tests + run: make REGRESS=1 test^python + + - name: ClojureScript Step Tests + run: make test^cljs + + - name: ClojureScript Regression Tests + run: make REGRESS=1 test^cljs + + - name: Generate stats + run: | + make stats # Build compressed artifacts + make stats # Without the build noise diff --git a/.gitignore b/.gitignore index 0fbf597..699225a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ notes *.pyc *.pyz *-minipy.py +cljs/.shadow-cljs +cljs/build +cljs/src-min diff --git a/.gitmodules b/.gitmodules index 60fa024..d41c4ba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "python/minipy"] path = python/minipy url = https://github.com/kanaka/minipy +[submodule "js/regpack"] + path = js/regpack + url = https://github.com/siorki/regpack diff --git a/LICENSE b/LICENSE index 1df5ae1..b772f95 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2017 Joel Martin +Copyright (C) 2024 Joel Martin miniMAL is licensed under the MPL 2.0 (Mozilla Public License 2.0). The text of the MPL 2.0 license is included below and can be found at diff --git a/Makefile b/Makefile index a951c3e..ff3a901 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ argv_STEP = step7_interop # Map of step (e.g. "step8") to executable file for that step js_STEP_TO_PROG = js/$($(1)).js python_STEP_TO_PROG = python/$($(1)).py -cljs_STEP_TO_PROG = cljs/src/miniMAL/$($(1)).cljs +cljs_STEP_TO_PROG = cljs/src/miniMAL/$($(1)).cljc ########################################################## # Most of the rest of this file comes from mal/Makefile diff --git a/cljs/Makefile b/cljs/Makefile index d2e3c1e..2dc174e 100644 --- a/cljs/Makefile +++ b/cljs/Makefile @@ -1,47 +1,84 @@ -STEPS = step1_read_print step2_eval step3_env step4_if_fn_do \ - step5_tco step6_file step7_interop step8_macros \ - step9_try stepA_miniMAL +STEPS = step0_repl step1_read_print step2_eval step3_env \ + step4_if_fn_do step5_tco step6_file step7_interop \ + step8_macros step9_try stepA_miniMAL -MIN_FILES = src/miniMAL/miniMAL.cljs miniMAL +MIN_FILES = $(foreach S,$(STEPS),src-min/miniMAL/$(S).cljc) miniMAL +BUILD_FILES = $(foreach S,$(STEPS),build/$(S).js) miniMAL.js -all: $(MIN_FILES) +.SECONDARY: -src/miniMAL/miniMAL.cljs: src/miniMAL/stepA_miniMAL.cljs +all: $(MIN_FILES) $(BUILD_FILES) + +# +# Compressed +# +src-min/miniMAL/%.cljc: src/miniMAL/%.cljc + @echo "Compressing $@" + @mkdir -p src-min/miniMAL/ @cat $< \ | egrep -v "^ *$$|^ *;" \ | sed 's/^ *//' \ | tr '\n' ' ' \ - | sed 's/ *(/(/g' \ - | sed 's/) */)/g' \ - | sed 's/ *"/"/g' \ - | sed 's/ *\[/[/g' \ - | sed 's/] */]/g' \ - | sed 's/" *\([^n]\)/"\1/g' \ - | sed 's/\/A/g' \ - | sed 's/\/E/g' \ - | sed 's/\/a/g' \ - | sed 's/\/b/g' \ - | sed 's/\/c/g' \ - | sed 's/\/d/g' \ - | sed 's/stepA-miniMAL/miniMAL/' \ - | sed 's/\/X/g' \ - | sed 's/\/Y/g' \ - | sed 's/\/Z/g' \ + | sed \ + -e 's/ *(/(/g' \ + -e 's/) */)/g' \ + -e 's/ *"/"/g' \ + -e 's/ *\[/[/g' \ + -e 's/] */]/g' \ + -e 's/ *{/{/g' \ + -e 's/" *\([^n]\)/"\1/g' \ + -e 's/\/Y/g' \ + -e 's/\([^-]\)\/\1E/g' \ + -e 's/\/A/g' \ + -e 's/\/X/g' \ + -e 's/\/a/g' \ + -e 's/\/b/g' \ + -e 's/\/c/g' \ + -e 's/\/d/g' \ + -e 's/\/R/g' \ + -e 's/\((ns [^)]*)\)/\1(def R rest)/' \ + -e 's/\/P/g' \ + -e 's/\((ns [^)]*)\)/\1(def P js\/JSON.parse)/' \ + -e 's/ *#?(:org.babashka\/nbb *\(.*\) *#_nbb-end */\1/' \ + -e 's/ *:cljs *\(.*\)) *#_cljs-end *//' \ > $@ -miniMAL: src/miniMAL/miniMAL.cljs - @echo "#!/usr/bin/lumo -q" > $@ - @cat $< \ - | sed "s/(ns.*:require\([^)]*)\))/(require \'\1/" \ - | sed 's/defn -main\[& args\]/let [args (seq (.slice js\/process.argv 4))]/' \ +miniMAL: src-min/miniMAL/stepA_miniMAL.cljc + echo "Compressing $@" + echo "#!/usr/bin/env nbb" > $@ + cat $< \ + | sed "s/(ns [^)]*)//" \ + | sed 's/defn -main\[& args\]/let [args (seq (.slice js\/process.argv 3))]/' \ >> $@ - @chmod +x $@ + chmod +x $@ + +node_modules/.bin/shadow-cljs: + npm install +# Full ClojureScript Compiled +build/%.js: node_modules/.bin/shadow-cljs src/miniMAL/%.cljc + node_modules/.bin/shadow-cljs release $* + chmod +x $@ -.PHONY: clean +miniMAL.js: node_modules/shadow-cljs src/miniMAL/stepA_miniMAL.cljc + node_modules/.bin/shadow-cljs release miniMAL + chmod +x $@ -stats: $(foreach S,$(STEPS),src/miniMAL/$(S).cljs) $(MIN_FILES) +# +# Stats +# +stats^%: src/miniMAL/%.cljc src-min/miniMAL/%.cljc @wc $^ | grep -v "total" + +.PHONY: clean stats + +stats: $(foreach s,$(STEPS),stats^$(s)) miniMAL core.json + @wc miniMAL core.json | grep -v "total" + clean: rm -f $(MIN_FILES) + rm -f $(BUILD_FILES) + rm -fr build/cljs-runtime + rmdir -p build || true + rmdir -p src-min/miniMAL || true diff --git a/cljs/core.json b/cljs/core.json index c812d4d..bdeb997 100644 --- a/cljs/core.json +++ b/cljs/core.json @@ -32,10 +32,10 @@ ["interpose", "b", ["map", ["fn", ["x"], ["if", "c", - ["print", "x"], + ["pr*", "x"], ["if", ["string?", "x"], "x", - ["print", "x"]]]], + ["pr*", "x"]]]], "a"]]]]], ["def", "pr-str", ["fn", ["&", "a"], ["pr-list*", "a", ["`", " "], true]]], @@ -47,7 +47,7 @@ ["do", ["clj-println", ["pr-list*", "a", ["`", " "], false]], null]]], ["def", "list?", ["fn", ["a"], - ["if", ["clj-list?", "a"], true, ["array?", "a"]]]], + ["if", ["sequential?", "a"], true, ["array?", "a"]]]], ["def", "contains?", ["fn", ["a", "b"], ["if", ["object?", "a"], ["not", ["undefined?", ["aget", "a", "b"]]], diff --git a/cljs/package-lock.json b/cljs/package-lock.json new file mode 100644 index 0000000..fa14d59 --- /dev/null +++ b/cljs/package-lock.json @@ -0,0 +1,1904 @@ +{ + "name": "cljs", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "nbb": "^0.1.9", + "shadow-cljs": "^2.27.5" + } + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", + "dependencies": { + "object.assign": "^4.1.4", + "util": "^0.10.4" + } + }, + "node_modules/assert/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, + "node_modules/assert/node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/nbb": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/nbb/-/nbb-0.1.9.tgz", + "integrity": "sha512-HwRDhmfMnnuLZdOUMH7V9NzNr9eDz0vvEADoAHX6DSf9K0Lo038ro38R3lZ+2u7TfDGPTpjxh24s7lIQoylvjQ==", + "bin": { + "nbb": "out/nbb_main.js" + } + }, + "node_modules/node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "node_modules/parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==" + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "node_modules/qs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/readable-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shadow-cljs": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/shadow-cljs/-/shadow-cljs-2.27.5.tgz", + "integrity": "sha512-K0/7+kiRYvEpTyvXfjFp6RhedRyoo6bEQ452VhQqM3l15ekbRMoKSwxMn0sGp/DqFZTsKoADc+tPc7uipCRhFw==", + "dependencies": { + "node-libs-browser": "^2.2.1", + "readline-sync": "^1.4.7", + "shadow-cljs-jar": "1.3.4", + "source-map-support": "^0.4.15", + "which": "^1.3.1", + "ws": "^7.4.6" + }, + "bin": { + "shadow-cljs": "cli/runner.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/shadow-cljs-jar": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/shadow-cljs-jar/-/shadow-cljs-jar-1.3.4.tgz", + "integrity": "sha512-cZB2pzVXBnhpJ6PQdsjO+j/MksR28mv4QD/hP/2y1fsIa9Z9RutYgh3N34FZ8Ktl4puAXaIGlct+gMCJ5BmwmA==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dependencies": { + "source-map": "^0.5.6" + } + }, + "node_modules/stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==" + }, + "node_modules/tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==" + }, + "node_modules/url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, + "node_modules/util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + } + }, + "dependencies": { + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", + "requires": { + "object.assign": "^4.1.4", + "util": "^0.10.4" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + } + } + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "requires": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" + }, + "elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "nbb": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/nbb/-/nbb-0.1.9.tgz", + "integrity": "sha512-HwRDhmfMnnuLZdOUMH7V9NzNr9eDz0vvEADoAHX6DSf9K0Lo038ro38R3lZ+2u7TfDGPTpjxh24s7lIQoylvjQ==" + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "requires": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + } + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==" + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "qs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", + "requires": { + "side-channel": "^1.0.6" + } + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==" + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shadow-cljs": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/shadow-cljs/-/shadow-cljs-2.27.5.tgz", + "integrity": "sha512-K0/7+kiRYvEpTyvXfjFp6RhedRyoo6bEQ452VhQqM3l15ekbRMoKSwxMn0sGp/DqFZTsKoADc+tPc7uipCRhFw==", + "requires": { + "node-libs-browser": "^2.2.1", + "readline-sync": "^1.4.7", + "shadow-cljs-jar": "1.3.4", + "source-map-support": "^0.4.15", + "which": "^1.3.1", + "ws": "^7.4.6" + } + }, + "shadow-cljs-jar": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/shadow-cljs-jar/-/shadow-cljs-jar-1.3.4.tgz", + "integrity": "sha512-cZB2pzVXBnhpJ6PQdsjO+j/MksR28mv4QD/hP/2y1fsIa9Z9RutYgh3N34FZ8Ktl4puAXaIGlct+gMCJ5BmwmA==" + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "^0.5.6" + } + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==" + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==" + }, + "url": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "requires": { + "punycode": "^1.4.1", + "qs": "^6.11.2" + } + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "requires": {} + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } +} diff --git a/cljs/package.json b/cljs/package.json new file mode 100644 index 0000000..e3aa2e2 --- /dev/null +++ b/cljs/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "nbb": "^0.1.9" + }, + "devDependencies": { + "shadow-cljs": "^2.27.5" + } +} diff --git a/cljs/run b/cljs/run index 07d2eeb..d8177be 100755 --- a/cljs/run +++ b/cljs/run @@ -1,3 +1,4 @@ #!/bin/bash STEP=${STEP:-stepA_miniMAL} -exec lumo -c $(dirname $0)/src -m miniMAL.${STEP//_/-} "${@}" +exec $(dirname $0)/node_modules/.bin/nbb -cp $(dirname $0)/src -m miniMAL.${STEP//_/-} "${@}" +#exec $(dirname $0)/node_modules/.bin/nbb -cp $(dirname $0)/src-min -m miniMAL.${STEP//_/-} "${@}" diff --git a/cljs/shadow-cljs.edn b/cljs/shadow-cljs.edn new file mode 100644 index 0000000..d61c89a --- /dev/null +++ b/cljs/shadow-cljs.edn @@ -0,0 +1,26 @@ +;; shadow-cljs configuration +{:source-paths + ["src/"] + + :build-defaults {:output-dir "build/" + ;; Don't try and connect back to shadow-cljs process + :devtools {:enabled false :console-support false} + :compiler-options + {:optimizations :simple + :source-map-use-fs-paths true}} + + :builds + {:step0_repl {:target :node-script :main miniMAL.step0-repl/-main :output-to "build/step0_repl.js"} + :step1_read_print {:target :node-script :main miniMAL.step1-read-print/-main :output-to "build/step1_read_print.js"} + :step2_eval {:target :node-script :main miniMAL.step2-eval/-main :output-to "build/step2_eval.js"} + :step3_env {:target :node-script :main miniMAL.step3-env/-main :output-to "build/step3_env.js"} + :step4_if_fn_do {:target :node-script :main miniMAL.step4-if-fn-do/-main :output-to "build/step4_if_fn_do.js"} + :step5_tco {:target :node-script :main miniMAL.step5-tco/-main :output-to "build/step5_tco.js"} + :step6_file {:target :node-script :main miniMAL.step6-file/-main :output-to "build/step6_file.js"} + :step7_interop {:target :node-script :main miniMAL.step7-interop/-main :output-to "build/step7_interop.js"} + :step8_macros {:target :node-script :main miniMAL.step8-macros/-main :output-to "build/step8_macros.js"} + :step9_try {:target :node-script :main miniMAL.step9-try/-main :output-to "build/step9_try.js"} + :stepA_miniMAL {:target :node-script :main miniMAL.stepA-miniMAL/-main :output-to "build/stepA_miniMAL.js"} + :miniMAL {:target :node-script :main miniMAL.stepA-miniMAL/-main :output-to "miniMAL.js"}} + + } diff --git a/cljs/src/miniMAL/step0_repl.cljc b/cljs/src/miniMAL/step0_repl.cljc new file mode 100644 index 0000000..e0a5a15 --- /dev/null +++ b/cljs/src/miniMAL/step0_repl.cljc @@ -0,0 +1,8 @@ +(ns miniMAL.step0-repl) + +(defn -main [& args] + (.start + (js/require "repl") + (clj->js {:eval #(%4 0 (.trim %1)) + :writer identity})) + nil) diff --git a/cljs/src/miniMAL/step1_read_print.cljc b/cljs/src/miniMAL/step1_read_print.cljc new file mode 100644 index 0000000..da94de0 --- /dev/null +++ b/cljs/src/miniMAL/step1_read_print.cljc @@ -0,0 +1,11 @@ +(ns miniMAL.step1-read-print) + +(defn EVAL [ast env] + ast) + +(defn -main [& args] + (.start + (js/require "repl") + (clj->js {:eval #(%4 0 (EVAL (js->clj (js/JSON.parse %1)) {})) + :writer #(js/JSON.stringify (clj->js %))})) + nil) diff --git a/cljs/src/miniMAL/step1_read_print.cljs b/cljs/src/miniMAL/step1_read_print.cljs deleted file mode 100644 index d9ff132..0000000 --- a/cljs/src/miniMAL/step1_read_print.cljs +++ /dev/null @@ -1,10 +0,0 @@ -(ns miniMAL.step1-read-print) - -(defn EVAL [ast env] - ast) - -(defn -main [& args] - (let [efn #(%4 nil (js/JSON.stringify (EVAL (js/JSON.parse %1) {})))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0})))) diff --git a/cljs/src/miniMAL/step2_eval.cljc b/cljs/src/miniMAL/step2_eval.cljc new file mode 100644 index 0000000..77e2da9 --- /dev/null +++ b/cljs/src/miniMAL/step2_eval.cljc @@ -0,0 +1,34 @@ +(ns miniMAL.step2-eval) + +(defn EVAL [ast env & [sq]] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (map #(EVAL % env) ast) + + (and (string? ast) (contains? env ast)) + (env ast) + + (string? ast) + (throw (str ast " not found")) + + (sequential? ast) + (let [[f & el] (EVAL ast env 1)] + (apply f el)) + + :else + ast)) + +(def E + {"+" + + "-" - + "*" * + "/" / + }) + +(defn -main [& args] + (.start + (js/require "repl") + (clj->js {:eval #(%4 0 (EVAL (js->clj (js/JSON.parse %1)) E)) + :writer #(js/JSON.stringify (clj->js %))})) + nil) diff --git a/cljs/src/miniMAL/step2_eval.cljs b/cljs/src/miniMAL/step2_eval.cljs deleted file mode 100644 index 9e93438..0000000 --- a/cljs/src/miniMAL/step2_eval.cljs +++ /dev/null @@ -1,27 +0,0 @@ -(ns miniMAL.step2-eval) - -(declare EVAL) - -(defn eval-ast [ast env] - (cond (array? ast) (map #(EVAL % env) ast) - (and (string? ast) (contains? env ast)) (get env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[f & el] (eval-ast ast env)] - (apply f el)))) - -(def E {"+" + - "-" - - "*" * - "/" /}) - -(defn -main [& args] - (let [efn #(%4 nil (js/JSON.stringify (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0})))) diff --git a/cljs/src/miniMAL/step3_env.cljc b/cljs/src/miniMAL/step3_env.cljc new file mode 100644 index 0000000..10b23b2 --- /dev/null +++ b/cljs/src/miniMAL/step3_env.cljc @@ -0,0 +1,46 @@ +(ns miniMAL.step3-env) + +(defn new-env [& [d B E]] + (atom (js/Object.create d))) + +(defn EVAL [ast env & [sq]] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (map #(EVAL % env) ast) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (sequential? ast) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (EVAL a2 env)) + (let [[f & el] (EVAL ast env 1)] + (apply f el)))) + + :else + ast)) + +(def E + (new-env + {"+" + + "-" - + "*" * + "/" / + })) + +(defn -main [& args] + (.start + (js/require "repl") + (clj->js {:eval #(%4 0 (EVAL (js->clj (js/JSON.parse %1)) E)) + :writer #(js/JSON.stringify (clj->js %))})) + nil) diff --git a/cljs/src/miniMAL/step3_env.cljs b/cljs/src/miniMAL/step3_env.cljs deleted file mode 100644 index 55529a8..0000000 --- a/cljs/src/miniMAL/step3_env.cljs +++ /dev/null @@ -1,36 +0,0 @@ -(ns miniMAL.step3-env) - -(defn new-env [& [d B E]] - (atom (js/Object.create d))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (EVAL a2 env)) - (let [[f & el] (eval-ast ast env)] - (apply f el)))))) - -(def E (new-env {"+" + - "-" - - "*" * - "/" /})) - -(defn -main [& args] - (let [efn #(%4 nil (js/JSON.stringify (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0})))) diff --git a/cljs/src/miniMAL/step4_if_fn_do.cljc b/cljs/src/miniMAL/step4_if_fn_do.cljc new file mode 100644 index 0000000..2d7863a --- /dev/null +++ b/cljs/src/miniMAL/step4_if_fn_do.cljc @@ -0,0 +1,59 @@ +(ns miniMAL.step4-if-fn-do) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (EVAL a2 env)) + "do" (last (EVAL (rest ast) env 1)) + "if" (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + (EVAL a3 env) + (EVAL a2 env)) + "fn" #(EVAL a2 (new-env @env a1 %&)) + (let [[f & el] (EVAL ast env 1)] + (apply f el)))) + + :else + ast)) + +(def E + (new-env + (merge + {"=" = + "<" < + "+" + + "-" - + "*" * + "/" / + "list" list + }))) + +(defn -main [& args] + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v))))}) + nil) diff --git a/cljs/src/miniMAL/step4_if_fn_do.cljs b/cljs/src/miniMAL/step4_if_fn_do.cljs deleted file mode 100644 index fe2266c..0000000 --- a/cljs/src/miniMAL/step4_if_fn_do.cljs +++ /dev/null @@ -1,55 +0,0 @@ -(ns miniMAL.step4-if-fn-do - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (EVAL a2 env)) - "do" (last (eval-ast (rest ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (EVAL a3 env) - (EVAL a2 env)) - "fn" #(EVAL a2 (new-env @env a1 %&)) - (let [[f & el] (eval-ast ast env)] - (apply f el)))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"list" array - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - }))) - -(defn -main [& args] - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0})))) diff --git a/cljs/src/miniMAL/step5_tco.cljc b/cljs/src/miniMAL/step5_tco.cljc new file mode 100644 index 0000000..8ce2dea --- /dev/null +++ b/cljs/src/miniMAL/step5_tco.cljc @@ -0,0 +1,69 @@ +(ns miniMAL.step5-tco) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + (let [[f & el] (EVAL ast env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))) + + :else + ast))) + +(def E + (new-env + (merge + {"=" = + "<" < + "+" + + "-" - + "*" * + "/" / + "map" (comp doall map) + "list" list + }))) + +(defn -main [& args] + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v))))}) + nil) diff --git a/cljs/src/miniMAL/step5_tco.cljs b/cljs/src/miniMAL/step5_tco.cljs deleted file mode 100644 index 6b899b7..0000000 --- a/cljs/src/miniMAL/step5_tco.cljs +++ /dev/null @@ -1,62 +0,0 @@ -(ns miniMAL.step5-tco - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"list" array - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - }))) - -(defn -main [& args] - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0})))) diff --git a/cljs/src/miniMAL/step6_file.cljc b/cljs/src/miniMAL/step6_file.cljc new file mode 100644 index 0000000..1c9b347 --- /dev/null +++ b/cljs/src/miniMAL/step6_file.cljc @@ -0,0 +1,79 @@ +(ns miniMAL.step6-file) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + "`" a1 + (let [[f & el] (EVAL ast env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))) + + :else + ast))) + +(def E + (new-env + (merge + {"=" = + "<" < + "+" + + "-" - + "*" * + "/" / + "map" (comp doall map) + "list" list + + "read" #(js/JSON.parse %) + "eval" #(EVAL % E) + "pr*" #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v)))) + "slurp" #(.readFileSync (js/require "fs") % "utf8") + ;;"load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E) + }))) + +(defn -main [& args] + (swap! E assoc "argv" (clj->js (rest args))) + (if args + (EVAL (js/JSON.parse ((@E "slurp") (first args))) E) + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer (@E "pr*")})) + nil) diff --git a/cljs/src/miniMAL/step6_file.cljs b/cljs/src/miniMAL/step6_file.cljs deleted file mode 100644 index 03b735e..0000000 --- a/cljs/src/miniMAL/step6_file.cljs +++ /dev/null @@ -1,71 +0,0 @@ -(ns miniMAL.step6-file - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "`" a1 - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"eval" #(EVAL %1 E) - - "list" array - - "read" #(js/JSON.parse %) - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - "slurp" #(.readFileSync (js/require "fs") % "utf8") - "load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E)}))) - -(defn -main [& args] - (swap! E assoc "ARGS" (apply array (rest args))) - (if args - ((@E "load") (first args)) - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0}))))) diff --git a/cljs/src/miniMAL/step7_interop.cljc b/cljs/src/miniMAL/step7_interop.cljc new file mode 100644 index 0000000..c566973 --- /dev/null +++ b/cljs/src/miniMAL/step7_interop.cljc @@ -0,0 +1,82 @@ +(ns miniMAL.step7-interop) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + "`" a1 + ".-" (let [[o k & [v]] (EVAL (rest ast) env 1)] + (if v (aset o k v) (aget o k))) + "." (let [[o & el] (EVAL (rest ast) env 1)] + (apply (get o (first el)) (rest el))) + (let [[f & el] (EVAL ast env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))) + + :else + ast))) + +(def E + (new-env + (merge + ;; Formatted like this for easy sed'ing + #?(:org.babashka/nbb + (into {} (for [[k v] (ns-map *ns*)] + [(str k) (if (var? v) @v)])) #_nbb-end + :cljs + (into {} (for [[k v] (js->clj cljs.core)] + [(demunge k) v]))) #_cljs-end + {"map" (comp doall map) + "read" #(js/JSON.parse %) + "eval" #(EVAL % E) + "pr*" #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v)))) + "slurp" #(.readFileSync (js/require "fs") % "utf8") + ;;"load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E) + "js" js/eval}))) + +(defn -main [& args] + (swap! E assoc "argv" (clj->js (rest args))) + (if args + (EVAL (js/JSON.parse ((@E "slurp") (first args))) E) + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer (@E "pr*")})) + nil) diff --git a/cljs/src/miniMAL/step7_interop.cljs b/cljs/src/miniMAL/step7_interop.cljs deleted file mode 100644 index a9b4d4b..0000000 --- a/cljs/src/miniMAL/step7_interop.cljs +++ /dev/null @@ -1,76 +0,0 @@ -(ns miniMAL.step7-interop - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "`" a1 - ".-" (let [[o k & [v]] (eval-ast (rest ast) env)] - (if v (aset o k v) (aget o k))) - "." (let [[o & el] (eval-ast (rest ast) env)] - (apply (get o (first el)) (rest el))) - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"js" js/eval - "eval" #(EVAL %1 E) - - "list" array - - "read" #(js/JSON.parse %) - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - "slurp" #(.readFileSync (js/require "fs") % "utf8") - "load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E)}))) - -(defn -main [& args] - (swap! E assoc "ARGS" (apply array (rest args))) - (if args - ((@E "load") (first args)) - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0}))))) diff --git a/cljs/src/miniMAL/step8_macros.cljc b/cljs/src/miniMAL/step8_macros.cljc new file mode 100644 index 0000000..efa0f7a --- /dev/null +++ b/cljs/src/miniMAL/step8_macros.cljc @@ -0,0 +1,87 @@ +(ns miniMAL.step8-macros) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + "`" a1 + ".-" (let [[o k & [v]] (EVAL (rest ast) env 1)] + (if v (aset o k v) (aget o k))) + "." (let [[o & el] (EVAL (rest ast) env 1)] + (apply (get o (first el)) (rest el))) + "~" (with-meta (EVAL a1 env) + {:M true}) + (let [f (EVAL a0 env)] + (if (-> f meta :M) + (recur (apply f (rest ast)) env) + (let [el (EVAL (rest ast) env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))))) + + :else + ast))) + +(def E + (new-env + (merge + ;; Formatted like this for easy sed'ing + #?(:org.babashka/nbb + (into {} (for [[k v] (ns-map *ns*)] + [(str k) (if (var? v) @v)])) #_nbb-end + :cljs + (into {} (for [[k v] (js->clj cljs.core)] + [(demunge k) v]))) #_cljs-end + {"map" (comp doall map) + "read" #(js/JSON.parse %) + "eval" #(EVAL % E) + "pr*" #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v)))) + "slurp" #(.readFileSync (js/require "fs") % "utf8") + ;;"load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E) + "js" js/eval}))) + +(defn -main [& args] + (swap! E assoc "argv" (clj->js (rest args))) + (if args + (EVAL (js/JSON.parse ((@E "slurp") (first args))) E) + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer (@E "pr*")})) + nil) diff --git a/cljs/src/miniMAL/step8_macros.cljs b/cljs/src/miniMAL/step8_macros.cljs deleted file mode 100644 index 5bb85d7..0000000 --- a/cljs/src/miniMAL/step8_macros.cljs +++ /dev/null @@ -1,85 +0,0 @@ -(ns miniMAL.step8-macros - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - ;; inlined macroexpand - (let [ast (loop [ast ast] - (if (and (or (array? ast) (seq? ast)) - (:M (meta (get @env (first ast))))) - (recur (apply (get @env (first ast)) (rest ast))) - ast))] - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "~" (with-meta (EVAL a1 env) {:M true}) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "`" a1 - ".-" (let [[o k & [v]] (eval-ast (rest ast) env)] - (if v (aset o k v) (aget o k))) - "." (let [[o & el] (eval-ast (rest ast) env)] - (apply (get o (first el)) (rest el))) - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"js" js/eval - "eval" #(EVAL %1 E) - - "list" array - - "read" #(js/JSON.parse %) - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - "slurp" #(.readFileSync (js/require "fs") % "utf8") - "load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E)}))) - -(defn -main [& args] - (swap! E assoc "ARGS" (apply array (rest args))) - (if args - ((@E "load") (first args)) - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0}))))) diff --git a/cljs/src/miniMAL/step9_try.cljc b/cljs/src/miniMAL/step9_try.cljc new file mode 100644 index 0000000..72a252b --- /dev/null +++ b/cljs/src/miniMAL/step9_try.cljc @@ -0,0 +1,91 @@ +(ns miniMAL.step9-try) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + "`" a1 + ".-" (let [[o k & [v]] (EVAL (rest ast) env 1)] + (if v (aset o k v) (aget o k))) + "." (let [[o & el] (EVAL (rest ast) env 1)] + (apply (get o (first el)) (rest el))) + "~" (with-meta (EVAL a1 env) + {:M true}) + "try" (try (EVAL a1 env) + (catch :default e + (EVAL (nth a2 2) (new-env @env [(nth a2 1)] [e])))) + (let [f (EVAL a0 env)] + (if (-> f meta :M) + (recur (apply f (rest ast)) env) + (let [el (EVAL (rest ast) env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))))) + + :else + ast))) + +(def E + (new-env + (merge + ;; Formatted like this for easy sed'ing + #?(:org.babashka/nbb + (into {} (for [[k v] (ns-map *ns*)] + [(str k) (if (var? v) @v)])) #_nbb-end + :cljs + (into {} (for [[k v] (js->clj cljs.core)] + [(demunge k) v]))) #_cljs-end + {"map" (comp doall map) + "read" #(js/JSON.parse %) + "eval" #(EVAL % E) + "pr*" #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v)))) + "slurp" #(.readFileSync (js/require "fs") % "utf8") + ;;"load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E) + "js" js/eval + "throw" #(throw %)}))) + +(defn -main [& args] + (swap! E assoc "argv" (clj->js (rest args))) + (if args + (EVAL (js/JSON.parse ((@E "slurp") (first args))) E) + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer (@E "pr*")})) + nil) diff --git a/cljs/src/miniMAL/step9_try.cljs b/cljs/src/miniMAL/step9_try.cljs deleted file mode 100644 index ca1dcbb..0000000 --- a/cljs/src/miniMAL/step9_try.cljs +++ /dev/null @@ -1,90 +0,0 @@ -(ns miniMAL.step9-try - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - ;; inlined macroexpand - (let [ast (loop [ast ast] - (if (and (or (array? ast) (seq? ast)) - (:M (meta (get @env (first ast))))) - (recur (apply (get @env (first ast)) (rest ast))) - ast))] - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "~" (with-meta (EVAL a1 env) {:M true}) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "`" a1 - ".-" (let [[o k & [v]] (eval-ast (rest ast) env)] - (if v (aset o k v) (aget o k))) - "." (let [[o & el] (eval-ast (rest ast) env)] - (apply (get o (first el)) (rest el))) - "try" (try - (EVAL a1 env) - (catch :default t - (EVAL (nth a2 2) (new-env @env [(nth a2 1)] [t])))) - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"js" js/eval - "eval" #(EVAL %1 E) - - "list" array - "throw" #(throw %) - - "read" #(js/JSON.parse %) - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - "slurp" #(.readFileSync (js/require "fs") % "utf8") - "load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E)}))) - -(defn -main [& args] - (swap! E assoc "ARGS" (apply array (rest args))) - (if args - ((@E "load") (first args)) - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0}))))) diff --git a/cljs/src/miniMAL/stepA_miniMAL.cljc b/cljs/src/miniMAL/stepA_miniMAL.cljc new file mode 100644 index 0000000..4d0827e --- /dev/null +++ b/cljs/src/miniMAL/stepA_miniMAL.cljc @@ -0,0 +1,97 @@ +(ns miniMAL.stepA-miniMAL) + +(defn new-env [d & [B E]] + (let [[b [_ v]] (split-with #(not= "&" %) B) + [e E] (split-at (count b) E)] + (atom (merge (js/Object.create d) + (zipmap b e) + (if v {v E}))))) + +(defn EVAL [ast env & [sq]] + (loop [ast ast + env env] + ;;(prn :EVAL :ast ast :sq sq) + (cond + sq + (doall (map #(EVAL % env) ast)) + + (object? ast) + (clj->js (into {} (for [[k v] (js->clj ast)] + [k (EVAL v env)]))) + + (and (string? ast) (contains? @env ast)) + (@env ast) + + (string? ast) + (throw (str ast " not found")) + + (or (array? ast) (sequential? ast)) + (let [[a0 a1 a2 a3] ast] + (condp = a0 + "def" (let [x (EVAL a2 env)] + (swap! env assoc a1 x) x) + "let" (let [env (new-env @env)] + (doseq [[s v] (partition 2 a1)] + (swap! env assoc s (EVAL v env))) + (recur a2 env)) + "do" (recur (do (EVAL (-> ast drop-last rest) env 1) + (last ast)) + env) + "if" (recur (if ({0 1 nil 1 false 1 "" 1} (EVAL a1 env)) + a3 + a2) + env) + "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) + [a2 env a1]) + "`" a1 + ".-" (let [[o k & [v]] (EVAL (rest ast) env 1)] + (if v (aset o k v) (aget o k))) + "." (let [[o & el] (EVAL (rest ast) env 1)] + (apply (get o (first el)) (rest el))) + "~" (with-meta (EVAL a1 env) + {:M true}) + "try" (try (EVAL a1 env) + (catch :default e + (EVAL (nth a2 2) (new-env @env [(nth a2 1)] [e])))) + (let [f (EVAL a0 env)] + (if (-> f meta :M) + (recur (apply f (rest ast)) env) + (let [el (EVAL (rest ast) env 1) + [ast env p] (meta f)] + (if ast + (recur ast (new-env @env p el)) + (apply f el))))))) + + :else + ast))) + +(def E + (new-env + (merge + ;; Formatted like this for easy sed'ing + #?(:org.babashka/nbb + (into {} (for [[k v] (ns-map *ns*)] + [(str k) (if (var? v) @v)])) #_nbb-end + :cljs + (into {} (for [[k v] (js->clj cljs.core)] + [(demunge k) v]))) #_cljs-end + {"map" (comp doall map) + "read" #(js/JSON.parse %) + "eval" #(EVAL % E) + "pr*" #(js/JSON.stringify % (fn [k v] (if (fn? v) nil (clj->js v)))) + "slurp" #(.readFileSync (js/require "fs") % "utf8") + ;;"load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E) + "js" js/eval + "throw" #(throw %)}))) + +(defn -main [& args] + (swap! E assoc "argv" (clj->js (rest args))) + (if args + (EVAL (js/JSON.parse ((@E "slurp") (first args))) E) + (do + (println "miniMAL 1.2.0") + (.start + (js/require "repl") + #js {:eval #(%4 0 (try (EVAL (js/JSON.parse %1) E) (catch :default e (prn e)))) + :writer (@E "pr*")}))) + nil) diff --git a/cljs/src/miniMAL/stepA_miniMAL.cljs b/cljs/src/miniMAL/stepA_miniMAL.cljs deleted file mode 100644 index 2e91556..0000000 --- a/cljs/src/miniMAL/stepA_miniMAL.cljs +++ /dev/null @@ -1,91 +0,0 @@ -(ns miniMAL.stepA-miniMAL - (:require [clojure.string :refer [replace]])) - -(defn new-env [& [d B E]] - (atom (loop [d (js/Object.create d) - B B - E E] - (let [[b & B'] B - [e & E'] E] - (condp = b - nil d - "&" (assoc d (nth B 1) E) - (recur (assoc d b e) B' E')))))) - -(declare EVAL) -(defn eval-ast [ast env] - (cond (or (array? ast) (seq? ast)) (doall (map #(EVAL % env) ast)) - (and (string? ast) (contains? @env ast)) (get @env ast) - (string? ast) (throw (str ast " not found")) - :else ast)) - -(defn EVAL [ast env] - (loop [ast ast - env env] - ;(prn :EVAL :ast ast) - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - ;; inlined macroexpand - (let [ast (loop [ast ast] - (if (and (or (array? ast) (seq? ast)) - (:M (meta (get @env (first ast))))) - (recur (apply (get @env (first ast)) (rest ast))) - ast))] - (if (not (or (array? ast) (seq? ast))) - (eval-ast ast env) - (let [[a0 a1 a2 a3] ast] - (condp = a0 - "def" (let [x (EVAL a2 env)] (swap! env assoc a1 x) x) - "~" (with-meta (EVAL a1 env) {:M true}) - "let" (let [env (new-env @env)] - (doseq [[s v] (partition 2 a1)] - (swap! env assoc s (EVAL v env))) - (recur a2 env)) - "`" a1 - ".-" (let [[o k & [v]] (eval-ast (rest ast) env)] - (if v (aset o k v) (aget o k))) - "." (let [[o & el] (eval-ast (rest ast) env)] - (apply (get o (first el)) (rest el))) - "try" (try - (EVAL a1 env) - (catch :default t - (EVAL (nth a2 2) (new-env @env [(nth a2 1)] [t])))) - "do" (do (eval-ast (->> ast drop-last rest) env) - (recur (last ast) env)) - "if" (if (contains? #{0 nil false ""} (EVAL a1 env)) - (recur a3 env) - (recur a2 env)) - "fn" (with-meta #(EVAL a2 (new-env @env a1 %&)) - [a2 env a1]) - (let [[f & el] (eval-ast ast env) - [ast env p] (meta f)] - (if ast - (recur ast (new-env @env p el)) - (apply f el)))))))))) - -(def E (new-env - (merge (into {} (for [[k v] (js->clj cljs.core)] - [(demunge k) v])) - {"js" js/eval - "eval" #(EVAL %1 E) - - "list" array - "throw" #(throw %) - - "read" #(js/JSON.parse %) - "print" #(js/JSON.stringify - % (fn [k v] (cond (fn? v) nil - (seq? v) (apply array v) - :else v))) - "slurp" #(.readFileSync (js/require "fs") % "utf8") - "load" #(EVAL (js/JSON.parse ((@E "slurp") %)) E)}))) - -(defn -main [& args] - (swap! E assoc "ARGS" (apply array (rest args))) - (if args - ((@E "load") (first args)) - (let [efn #(%4 nil ((@E "print") (EVAL (js/JSON.parse %1) E)))] - (println "miniMAL 1.0.3") - (.start - (js/require "repl") - (clj->js {:eval efn :writer identity :terminal 0}))))) diff --git a/index.html b/index.html index 2090962..86d3d11 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ + diff --git a/python/Makefile b/python/Makefile index 8f6ee68..3d17080 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,5 +1,6 @@ -STEPS = step1_read_print step2_eval step3_env step4_if_fn_do step5_tco \ - step6_file step7_interop step8_macros step9_try stepA_miniMAL +STEPS = step0_repl step1_read_print step2_eval step3_env \ + step4_if_fn_do step5_tco step6_file step7_interop \ + step8_macros step9_try stepA_miniMAL MIN_FILES = miniMAL.py miniMAL.pyz @@ -9,7 +10,7 @@ all: $(MIN_FILES) # Library miniMAL.py: stepA_miniMAL.py - echo '__all__ = ["EVAL","rep","repl_env"]' > $@ + echo '__all__ = ["EVAL","E"]' > $@ python3 minipy/minipy.py -R -p EVAL,E $< | grep -v "^#!" >> $@ # Standalone diff --git a/python/core.json b/python/core.json index ae35abc..50a04c7 100644 --- a/python/core.json +++ b/python/core.json @@ -7,8 +7,6 @@ ["def", ".", ["fn", ["a", "b", "&", "args"], ["py-apply", [".-", "a", "b"], "args"]]], ["def", "readline", "input"], -["def", "slurp", ["fn", ["a"], - [".", ["open", "a"], ["`", "read"]]]], ["def", "map", ["fn", ["a", "b"], ["py-apply", "py-list", ["py-map", "a", "b"]]]], diff --git a/python/miniMAL-core.json b/python/miniMAL-core.json index 345a366..1767e94 100644 --- a/python/miniMAL-core.json +++ b/python/miniMAL-core.json @@ -1,6 +1,6 @@ ["do", -["load", ["`", "core.json"]], +["eval", ["read", ["slurp", ["`", "core.json"]]]] ["def", "repl", ["fn",["prompt", "rep"], ["let", ["line", ["readline", "prompt"]], diff --git a/python/run b/python/run index f82a47e..f1b8159 100755 --- a/python/run +++ b/python/run @@ -1,2 +1,2 @@ #!/bin/bash -exec python3 $(dirname $0)/${STEP:-stepA_mal}.py "${@}" +exec python3 $(dirname $0)/${STEP:-stepA_miniMAL}.py "${@}" diff --git a/python/step0_repl.py b/python/step0_repl.py index 070b1a0..6795dac 100755 --- a/python/step0_repl.py +++ b/python/step0_repl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import readline diff --git a/python/step1_read_print.py b/python/step1_read_print.py index 960befe..94e3bba 100755 --- a/python/step1_read_print.py +++ b/python/step1_read_print.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline diff --git a/python/step2_eval.py b/python/step2_eval.py index c827512..dc0cc4b 100755 --- a/python/step2_eval.py +++ b/python/step2_eval.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline diff --git a/python/step3_env.py b/python/step3_env.py index 75a7fe2..e73ba7e 100755 --- a/python/step3_env.py +++ b/python/step3_env.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline diff --git a/python/step4_if_fn_do.py b/python/step4_if_fn_do.py index db8798f..97cf890 100755 --- a/python/step4_if_fn_do.py +++ b/python/step4_if_fn_do.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline diff --git a/python/step5_tco.py b/python/step5_tco.py index 5b01820..537a975 100755 --- a/python/step5_tco.py +++ b/python/step5_tco.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline diff --git a/python/step6_file.py b/python/step6_file.py index 9279915..ee8a298 100755 --- a/python/step6_file.py +++ b/python/step6_file.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline @@ -68,14 +68,14 @@ def EVAL(ast, env): 'read': loads, 'pr*': lambda a: dumps(a, separators=(',', ':')), - 'load': lambda a: EVAL(loads(open(a).read()),E), + 'slurp': lambda a: open(a).read(), - 'ARGS': sys.argv[2:] + 'argv': sys.argv[2:] }) if __name__ == "__main__": if len(sys.argv) >= 2: - E.load(sys.argv[1]) + EVAL(loads(E.slurp(sys.argv[1])), E) sys.exit(0) while True: diff --git a/python/step7_interop.py b/python/step7_interop.py index 9269418..bb7a901 100755 --- a/python/step7_interop.py +++ b/python/step7_interop.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline, builtins @@ -75,14 +75,14 @@ def EVAL(ast, env): 'read': loads, 'pr*': lambda a: dumps(a, separators=(',', ':')), - 'load': lambda a: EVAL(loads(open(a).read()),E), + 'slurp': lambda a: open(a).read(), - 'ARGS': sys.argv[2:] + 'argv': sys.argv[2:] }) if __name__ == "__main__": if len(sys.argv) >= 2: - E.load(sys.argv[1]) + EVAL(loads(E.slurp(sys.argv[1])), E) sys.exit(0) while True: diff --git a/python/step8_macros.py b/python/step8_macros.py index f222462..b9e8ce5 100755 --- a/python/step8_macros.py +++ b/python/step8_macros.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline, builtins @@ -82,14 +82,14 @@ def EVAL(ast, env): 'read': loads, 'pr*': lambda a: dumps(a, separators=(',', ':')), - 'load': lambda a: EVAL(loads(open(a).read()),E), + 'slurp': lambda a: open(a).read(), - 'ARGS': sys.argv[2:] + 'argv': sys.argv[2:] }) if __name__ == "__main__": if len(sys.argv) >= 2: - E.load(sys.argv[1]) + EVAL(loads(E.slurp(sys.argv[1])), E) sys.exit(0) while True: diff --git a/python/step9_try.py b/python/step9_try.py index 8dac1cd..bef9ba0 100755 --- a/python/step9_try.py +++ b/python/step9_try.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline, builtins @@ -88,14 +88,14 @@ def EVAL(ast, env): 'read': loads, 'pr*': lambda a: dumps(a, separators=(',', ':')), - 'load': lambda a: EVAL(loads(open(a).read()),E), + 'slurp': lambda a: open(a).read(), - 'ARGS': sys.argv[2:] + 'argv': sys.argv[2:] }) if __name__ == "__main__": if len(sys.argv) >= 2: - E.load(sys.argv[1]) + EVAL(loads(E.slurp(sys.argv[1])), E) sys.exit(0) while True: diff --git a/python/stepA_miniMAL.py b/python/stepA_miniMAL.py index 516031c..f5980ce 100755 --- a/python/stepA_miniMAL.py +++ b/python/stepA_miniMAL.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # miniMAL -# Copyright (C) 2022 Joel Martin +# Copyright (C) 2024 Joel Martin # Licensed under MPL 2.0 import sys, readline, builtins @@ -36,8 +36,8 @@ def EVAL(ast, env): return fn elif "let" == ast[0]: env = Env(env) - for i in range(0, len(ast[1]), 2): - setattr(env, ast[1][i], EVAL(ast[1][i+1], env)) + [setattr(env, ast[1][i], EVAL(ast[1][i+1], env)) + for i in range(0, len(ast[1]), 2)] ast = ast[2] # TCO elif "`" == ast[0]: return ast[1] @@ -89,17 +89,17 @@ def EVAL(ast, env): 'read': loads, 'pr*': lambda a: dumps(a, separators=(',', ':')), - 'load': lambda a: EVAL(loads(open(a).read()),E), + 'slurp': lambda a: open(a).read(), - 'ARGS': sys.argv[2:] + 'argv': sys.argv[2:] }) if __name__ == "__main__": if len(sys.argv) >= 2: - E.load(sys.argv[1]) + EVAL(loads(E.slurp(sys.argv[1])), E) sys.exit(0) - print("miniMAL 1.1.0") + print("miniMAL 1.2.0") while True: try: line = input("> ") diff --git a/small.html b/small.html index 39e1ddb..93ae4f3 100644 --- a/small.html +++ b/small.html @@ -12,7 +12,7 @@

- A Lisp implemented in < 1 KB of JavaScript with macros, TCO, interop and exception handling. + A Lisp implemented in < 1 KB of JavaScript with macros, TCO, interop and exception handling.

@@ -21,8 +21,8 @@ - - + +