{"id":48626920,"url":"https://github.com/chaploud/sci-lisp","last_synced_at":"2026-04-09T04:33:40.181Z","repository":{"id":209289269,"uuid":"723658030","full_name":"chaploud/Sci-Lisp","owner":"chaploud","description":"A Lisp for Scientific Computing written in Rust","archived":false,"fork":false,"pushed_at":"2024-04-01T22:59:09.000Z","size":1042,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-11T18:53:36.735Z","etag":null,"topics":["lisp","lisp-interpreter","rust","scientific","scientific-computing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaploud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-26T11:25:19.000Z","updated_at":"2024-04-12T03:41:18.000Z","dependencies_parsed_at":"2025-04-04T15:24:38.286Z","dependency_job_id":"8b952e5d-7b70-45d7-b0b8-fd7e46ccf16b","html_url":"https://github.com/chaploud/Sci-Lisp","commit_stats":{"total_commits":57,"total_committers":3,"mean_commits":19.0,"dds":"0.052631578947368474","last_synced_commit":"08d12e75bb6136f91ffded65cfa1030cef6690f3"},"previous_names":["chaploud/sci-lisp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chaploud/Sci-Lisp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaploud%2FSci-Lisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaploud%2FSci-Lisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaploud%2FSci-Lisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaploud%2FSci-Lisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaploud","download_url":"https://codeload.github.com/chaploud/Sci-Lisp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaploud%2FSci-Lisp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31586404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lisp","lisp-interpreter","rust","scientific","scientific-computing"],"created_at":"2026-04-09T04:33:40.041Z","updated_at":"2026-04-09T04:33:40.169Z","avatar_url":"https://github.com/chaploud.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSci-Lisp\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/images/scilisp.png\" width=\"140\" alt=\"Sci-Lisp logo\"/\u003e\n\u003c/p\u003e\n\n\u003ch4 align=\"center\" style=\"margin-top: 24px\"\u003e\n  A Lisp for Scientific Computing written in Rust\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/chaploud/sci-lisp/actions/workflows/rust.yml\"\u003e\u003cimg src=\"https://github.com/chaploud/sci-lisp/actions/workflows/rust.yml/badge.svg?branch=main\" alt=\"rust status\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features (WIP)\n\n- [x] REPL\n- [x] Run as script\n- [x] S-expression\n- [x] Clojure-like syntax (), [], {}, etc...\n- [x] Numpy-like array slice `([2|-1, -3|] arrayNd)`\n- [ ] Multiparadigm (Functional, Object-Oriented and Procedural)\n- [ ] Supports exception handling\n- [ ] Functionality of IPython, numpy, matplotlib, pandas, scipy\n- [ ] Digital Signal Processing (DSP) and Time Series Analysis (TSA) included as standard library\n- [ ] Well documented\n- [ ] Easy installation (Cross Platform)\n- [ ] Great developer experience with VSCode extension\n\n## Plan/Futures (WIP)\n\n- Multiple dispatch of functions/methods\n- JIT (Just-in-Time) compile dynamically typed language\n- Powerful type inference\n- Using Wasm (Web Assembly) for IR (Intermediate Representation) and directory execute from source code\n- VM/Runtime is [wasmtime](https://github.com/bytecodealliance/wasmtime)\n- Compile to single binary\n- Polars integration ([Polars](https://github.com/pola-rs/polars))\n\n## Philosophy\n\nLet's use **Lisp easily** without thinking too hard!\n\n## Influenced by\n\n- Common Lisp\n- Clojure (\u003chttps://github.com/clojure/clojure\u003e)\n- Hy (\u003chttps://github.com/hylang/hy\u003e)\n- Python (\u003chttps://github.com/python/cpython\u003e)\n- Rust (\u003chttps://github.com/rust-lang/rust\u003e)\n- Julia (\u003chttps://github.com/JuliaLang/julia\u003e)\n\n## Installation\n\n**NOTE:** currently most features are not implemented.\n\n### Build from source code\n\n#### Prerequests\n\n- Latest Rust installation (see \u003chttps://www.rust-lang.org/tools/install\u003e)\n\n#### Commands\n\n```bash\n# Clone Repository\ngit clone https://github.com/chaploud/sci-lisp.git\n\n# build scilisp binary using cargo build\ncd sci-lisp\ncargo build --release  # =\u003e target/release/scilisp\n```\n\n- You can execute `scilisp` binary\n\n### Get prebuild binary\n\n#### Windows\n\nNot distributed yet.\n\n#### Mac\n\nNot distributed yet.\n\n#### Linux\n\nNot distributed yet.\n\n## Command line options\n\n```bash\nscilisp         # launch REPL\nscilisp xxx.sl  # run as script\n```\n\n## Sci-Lisp code examples\n\nSee `examples/example.sl`.\n\n**Note:** Functions marked as `[WIP]` (Work in Progress) are not yet implemented. Running them will result in an error.\n\n```clojure\n; Comment\n\n;; ===== Literal\n\"abc\\n\"             ; string\n#\"[0-9]+\"           ; regular expression\nfalse               ; false\ntrue                ; true\nnil                 ; nil\n-999                ; i64\n0b101               ; i64 (binary)\n0o777               ; i64 (octal)\n0xff                ; i64 (hex)\n-3.14e15            ; f64\nnan                 ; f64: Not a Number\ninf                 ; f64: positive infinity\n-inf                ; f64: negative infinity\n-0.0                ; f64: negative zero\n-1.2+3.4j           ; c64 (complex number)\n:keyword            ; keyword symbol\n'symbol             ; quoted symbol\n\n;; falsy value is only 'false' and 'nil'\n;; \"\", '(), [], {}, #{}, 0, nan =\u003e all truthy\"\n\n;; ===== Keywords (cannot use as symbol name)\n;; false, true, nil,\n;; def, const, set!,\n;; defn, fn, return,\n;; if, when, cond, switch,\n;; while, for, break, continue\n;; try, catch, finally, throw,\n;; import, export\n;; typedef\n\n;; ===== Spceial Marks (cannot use in symbol name)\n;; : =\u003e keyword\n;; ' =\u003e quote\n;; ` =\u003e syntax-quote\n;; ~ =\u003e unquote\n;; ~@ =\u003e unquote-splicing\n;; @ =\u003e splicing\n;; . =\u003e member access\n;; | =\u003e slice\n;; / =\u003e namespace(module)\n;; \u0026 =\u003e rest(variable length argument), keyword argument\n\n;; #i64 =\u003e type annotation (prefix)\n;; local# =\u003e auto-gensym (suffix)\n\n;; ===== Collection\n; comma is treated as whitespace\n'(1, \"a\", :b)                ; list\n[1.0, 2.0, 3.0]              ; vector\n{:a \"a\", :b \"b\", :c \"c\"}     ; map (holds the insersion order)\n#{:a, :b, :c}                ; set (holds the insersion order)\n(array [1, 2, 3])            ; array of i64 (like numpy)\n;; NOTE: map key must be string, i64, keyword\n\n;; ===== [WIP] Datetime\n(datetime 2021 1 1\n          {:tz \"UTC+09\"})    ; =\u003e datetime\n(duration {:hour 1})         ; =\u003e duration\n\n;; ===== Function Call\n(type [1, 2, 3])             ; show type\n(time (+ 1 2))               ; measure processing time\n(print [1, 2] \"abc\\n\" 123)   ; print any\n\n;; ===== Variable Binding\n;; NOTE: Different from Clojure\n;; =\u003e Define in local scope.\n;; =\u003e Of course, if you define in top level it has global scope.\n\n(def a \"abcde\")              ; variable (mutable, 'local' scope)\n(const C [1, 2, 3])          ; constant value (immutable, 'local' scope)\n\n([0|2] a)                    ; slice =\u003e \"ab\"\n(-1 C)                       ; back =\u003e 3\n\n;; NOTE: Only let and fn(clousure/lambda) can make scope in Sci-Lisp\n(let [a 2]                   ; bind variable (make scope)\n  (set! a 3)                 ; assign(destructive)\n  a)                         ; =\u003e 3\n\n(let                         ; make local scope only\n  (def x 2)                  ; define in local scope\n  x)                         ; =\u003e 2\nx                            ; =\u003e error\n\n;; ===== Function\n(defn my-sum                 ; define function\n  \"sum two value\"            ; docstring\n  [a b]\n  (return (+ a b))           ; can use early return\n  (- a b))\n\n(my-sum 1 2)                 ; =\u003e 3\n\n((fn [x] (* x x)) 2)         ; =\u003e 4 (lambda/anonymus function)\n\n;; ===== Control Flow\n(if (\u003c 2 3)                  ; if\n  true                       ; true form\n  false)                     ; false form (must)\n\n(when (\u003c 2 3)                ; when\n  (do                        ; true form\n    (print \"2 \u003c 3\")          ; do multiple expressions\n    \"retval\"))\n\n(cond                        ; cond\n  (\u003c n 0) \"negative\"         ; (condition) (expresson)\n  (\u003e n 0) \"positive\"\n  :else \"default\")           ; :else (expression)\n\n(def val \"hoge\")\n(switch val                  ; switch\n  [\"a\"]                      ; match \"a\"\n    (print \"A\")\n  [\"b\", \"c\"]                 ; match \"b\" or \"c\"\n    (print \"B or C\")\n  :default                   ; :default (expression)\n    (print \"DEFAULT\"))\n\n(for [i (range 5)]           ; for loop, range\n  (print i))                 ; range returns 'generator'\ni                            ; =\u003e 4 you can access i after loop.\n\n(def a 0)\n(while (\u003c a 10)              ; while loop\n  (print a)\n  (set! a (+ a 1))\n  (if (\u003e a 5)\n    (break (+ a 9994))       ; break with return value\n    (continue))              ; continue\n  (print \"never print\"))\n\n;; ===== Built-in Functions/Macros\n\n;; Arithmetic\n(inc 1)              ; add 1\n(dec 1)              ; subtract 1\n(+ 1 1)              ; Add\n(- 1 1)              ; Subtract\n(* 2 3)              ; product\n(/ 1 2)              ; devide (float)\n(// 1 2)             ; devide\n(% 3 2)              ; remainder\n\n;; Compare\n(= 2 2 2)            ; equal\n(!= 2 3)             ; not equal\n(\u003c 2 3)              ; less\n(\u003c= 2 3)             ; less equal\n(\u003e 2 3)              ; greater\n(\u003e= 2 3)             ; greater equal\n\n;; Logical\n(and true false)     ; and\n(or true false)      ; or\n(xor true true)      ; xor\n(not false)          ; not\n\n;; Predicates\n(nil? nil)\n(true? true)\n(false? false)\n(number? 1)\n(i64? 1)\n(f64? 1.0)\n(zero? 0)\n(even? 2)\n(odd? 3)\n(empty? [])\n(string? \"abc\")\n(keyword? :abc)\n(symbol? 'abc)\n(list? '(1, 2, 3))\n(vector? [1, 2, 3])\n(map? {:a 1, :b 2})\n(set? #{1, 2, 3})\n\n;; Cast\n(str 3.14)             ; to string\n(str 'abc)\n(str :abc)\n(i64 \"2\")              ; to i64\n(f64 \"2.0\")            ; to f64\n(list #{1, 2, 3})      ; to list\n(vector '(1, 2, 3))    ; to vector\n(hmap [:a 1, :b 2])    ; to map\n(hset [1, 2, 2])       ; to set\n\n;; Math\n(sqrt 2)\n(abs -2)               ; absolute value\n(cos (* 2.0 *pi*))     ; cosine\n(sin (/ *pi* 2))       ; sine\n(tan 2.0)              ; tangent\n(acos 0.5)             ; arccosine\n(asin 0.5)             ; arcsine\n(atan 0.5)             ; arctangent\n(log 2 10)             ; log_2(10)\n(ln *e*)               ; log_e(e), natural logarithm\n(log10 2.0)            ; log_10(2.0)\n(rand)                 ; rondom value 0.0 to 1.0\n(randint 0 30)         ; random integer 0 to n\n\n;; Utility\n(type [1, 2, 3])              ; show type\n(time (+ 1 2))                ; measure processing time\n(print {:a 2, :b 3})          ; print any\n(doc time)                    ; show docstring\n(printf \"{0:03}kg\" 56)        ; [WIP] print format\n\n;; String\n(len \"abcde\")                 ; length of string\n(join [1, 2, 3] \",\")          ; join (=\u003e \"1,2,3\")\n(split \"1,2,3\" \",\" i64)       ; split (=\u003e [1, 2, 3])\n(replace \"abc\" \"a\" \"x\")       ; replace (=\u003e \"xbc\")\n(concat \"abc\" \"def\")          ; concat (=\u003e \"abcdef\")\n(trim \" abc \")                ; trim (=\u003e \"abc\")\n(in? \"a\" \"12aabc32\")          ; is string in string?\n(index \"abc\" \"12aabc32\")      ; string index in string (=\u003e 3)\n(count \"abc\" \"12aabc32\")      ; count string in string (=\u003e 1)\n(upper-case \"abc\")            ; upper-case\n(lower-case \"DEF\")            ; lower-case\n(lower-camel \"abc_def\")       ; lowerCamelCase (=\u003e \"abcDef\")\n(upper-camel \"abc_def\")       ; UpperCamelCase (=\u003e \"AbcDef\")\n(snake-case \"abcDef\")         ; snake-case (=\u003e \"abc_def\")\n(kebab-case \"abcDef\")         ; cebab-case (=\u003e \"abc-def\")\n(title-case \"abcDef\")         ; Title Case (=\u003e \"Abc Def\")\n(train-case \"abcDef\")         ; Train-Case (=\u003e \"Abc-Def\")\n(shouty-snake \"abcDef\")       ; SHOUTY_SNAKE_CASE (=\u003e \"ABC_DEF\")\n(shouty-kebab \"abcDef\")       ; SHOUTY-KEBAB-CASE (=\u003e \"ABC-DEF\")\n(repeat \"abc\" 2)              ; repeat string (=\u003e \"abcabcabc\")\n(reverse \"abc\")               ; reverse (=\u003e \"cba\")\n(format \"π: {:.2}\" 3.1415)    ; [WIP] format string\n\n;; Regular Expression\n(find #\"[0-9]+\" \"aa123a\")                ; =\u003e \"123\"\n(find-all #\"No\\.(\\d+)\" \"No.1 No.2 No.3\") ; =\u003e [\"hello, world\", \"world\"]\n(replace \"aa123a\" #\"[0-9]{2}\" \"x${1}y\")  ; =\u003e \"aax12y3a\"\n\n;; At\n(-1 [1, 2, 3])                        ; back =\u003e 3\n\n;; Key Access\n(:a {:a 1, :b 2, :c 3})               ; get value by key (keyword)\n(0 {0 \"a\", 1 \"b\", 2 \"c\"})             ; get value by key (i64)\n(\"a\" {\"a\" 1, \"b\" 2, \"c\" 3})           ; get value by key (string)\n\n;; Slice\n([0|2] [1, 2, 3])                     ; slice =\u003e [1, 2]\n([0|-1|2] \"abcdefg\")                  ; slice with step =\u003e \"ace\"\n([|, 1] [[1, 2], [3, 4], [5, 6]])     ; slice =\u003e [2, 4, 6]\n([|, 1|2] [[1, 2], [3, 4], [5, 6]])   ; slice (like numpy) =\u003e [[2], [4], [6]]\n\n;; Vector\n(first [1, 2, 3])                     ; first\n(last [1, 2, 3])                      ; last\n(rest [1, 2, 3])                      ; rest\n(len [1, 2, 3])                       ; length of vector\n(sum [1, 2, 3])                       ; sum of vector\n(mean [1, 2, 3])                      ; mean of vector\n(max [1, 2, 3])                       ; max of vector\n(min [1, 2, 3])                       ; min of vector\n(in? 2 [1, 2, 3])                     ; is element in vector?\n(index 2 [1, 2, 3])                   ; index of element\n(index-all 2 [1, 2, 3, 2])            ; all index of element\n(some? [false, true, false])          ; return true if some truthy\n(every? [false, true, false])         ; return true if all truthy\n(sort [3, 1, 2] :asc)                 ; sort\n(reverse [3, 1, 2])                   ; reverse\n(push [3, 1, 2] 4)                    ; push_back\n(cons [3, 1, 2] 4)                    ; push_front\n(concat [1, 2, 3] [4, 5, 6])          ; concat\n(shuffle [3, 1, 2])                   ; shuffle\n\n(def v [1, 2, 3])\n(get v 1)                             ; get value by index\n(insert! v 1 999)                     ; insert\n(remove! v 0)                         ; remove\n(replace! v -1 123)                   ; replace\n\n;; Map\n(keys {:a 1, :b 2, :c 3})             ; keys\n(vals {:a 1, :b 2, :c 3})             ; values\n(items {:a 1, :b 2, :c 3})            ; key-value pairs\n\n(def m {:b 2, :c 3})\n(get m :b)                            ; get value by key\n(insert! m :a 1)                      ; insert/replace\n(remove! m :a)                        ; remove\n(replace! m :b 123)                   ; replace\n\n;; Set\n(def s1 #{2 3})\n(get s1 2)                            ; get key\n(insert! s 1)                         ; insert/replace\n(remove! s 1)                         ; remove\n(replace! s 3 123)                    ; replace\n(def s2 #{1 2})\n(union s1 s2)                         ; union\n(intersect s1 s2)                     ; intersect\n(difference s1 s2)                    ; difference\n\n;; Functional Programming\n(apply + [1, 2, 3])                   ; apply =\u003e 6\n(map (fn [x] (* x x)) [1, 2, 3])      ; map =\u003e [1, 4, 9]\n(filter (fn [x] (even? x)) [1, 2, 3]) ; filter =\u003e [2]\n(reduce + 4 [1, 2, 4])                ; reduce =\u003e 11\n(-\u003e 1 (+ 2) (/ 6))                    ; thread first =\u003e 0.5\n(-\u003e\u003e 1 (+ 2) (/ 6))                   ; thread last =\u003e 2\n; ((partial * 10) 1)                  ; [WIP] partial =\u003e 10\n; ((comp str +) 7 8 9)                ; [WIP] comp =\u003e \"24\"\n\n;; ******************* [WIP] **********************\n;; ===== [WIP] enum\n(enum Color                           ; define enum\n  \"Color enum\"                        ; docstring\n  [Red Green Blue])\n\n(def c Color.Red)                     ; using enum\n\n(switch c\n  [Color.Red] (print \"red\")\n  [Color.Green] (print \"green\")\n  [Color.Blue] (print \"blue\"))\n\n;; ===== [WIP] struct\n(struct Enemy                       ; define struct\n  \"Enemy Struct\"                    ; docstring\n  [hp]\n  (defn heal [self x]               ; define method inside of struct\n    (set! self.hp (+ self.hp x))))\n\n(method [Enemy]                     ; define method outside of struct\n  (defn damage [self x]             ; TODO: Constructor\n    (set! self.hp (- self.hp x))))\n\n(def slime\n  (Enemy {:hp 20}))                 ; using struct\n\n(.hp slime)                         ; access member =\u003e 20\n(slime.damage 10)                   ; call method (allow this style)\n(print slime.hp)                    ; =\u003e 10 (allow this style)\n\n(struct ChildEnemy =\u003e Enemy         ; inherit struct\n  \"ChildEnemy Struct\"\n  [mp]\n\n  (defn ChildEnemy [self hp mp]     ; you can define constructor(Same as struct name)\n    (set! self.hp hp)\n    (set! self.mp mp)))\n\n  (defn magic [self x]\n    (set! self.mp (- self.mp x)))\n\n(def slime-child\n  (ChildEnemy {:hp 20, :mp 10}))    ; using struct\n\n(slime-child.magic 5)               ; call method\n(slime-child.damage 5)              ; call parent method\n\n(ancestor slime-child)              ; =\u003e [Enemy] show all ancestor\n(ancestor ChildEnemy)               ; =\u003e [Enemy]\n(ancestor #ChildEnemy)              ; =\u003e [#Enemy]\n\n;; ===== [WIP] macro\n(macro my-and                     ; define macro\n  \"Evaluates exprs one at time,\n   from left to right.\"           ; docstring\n  ([] true)                       ; multi arity\n  ([x] x)\n  ([x \u0026 next]                     ; variable length argument (\u0026 rest)\n    `(let [and# ~x]               ; quote(`) and unquote(~)\n       (if and#                   ; auto-gensym(xxx#)\n         (my-and ~@next)          ; unquote splicing(~@)\n         and#))))\n\n(my-and \"a\" \"b\" \"c\")              ; =\u003e \"c\"\n\n;; ===== [WIP] Exception\n(try\n  (print \"before error\")\n  (throw (TypeError \"error\")\n  (print \"after error\")\n  (catch TypeError e\n    (print e))\n  (finally (print \"every time executed\"))))\n\n;; ===== [WIP] Desturcturing\n;; vector/list\n(let [[a, b, c] [1, 2, 3]] (print a b c))             ;; 1 2 3\n(let [[a, _, c] [1, 2, 3]] (print a c))               ;; 1 3\n(let [[a, [b1, b2], c] [1, [2, 3], 4]] (print b1 b2)) ;; 2 3\n(let [[a \u0026 b] [1 2 3]] (print a b))                   ;; 1 [2 3]\n(let [[a \u0026 b] [1]] (print a b))                       ;; 1 nil\n(let [[a \u0026 b] []] (print a b))                        ;; nil nil\n\n;; map\n(let [{:a a, :b b} {:a 1 :b 2}] (print a b))          ;; 1 2\n(let [{\"a\" a, \"b\" b} {:a 1}] (print a b))             ;; 1 nil\n(let [{0 a, 1 b} {1 2}] (print a b))                  ;; nil 2\n(let [{:a x, :b y, :default {x 2}}\n      {:b 20}] (print x y))                           ;; 2 20\n\n;; defn\n(defn nation-datetime\n  \"Create a datetime object\"\n  [nation                              ;; positional argument\n   \u0026 rest                              ;; variable length argument\n   \u0026 {:year year, :mon mon, :day day,  ;; keyword arguments\n      :hour hour, :min min, :sec sec,\n      :nano nano, :tz tz,\n      :default {year 1970, mon 1,      ;; default value\n                day 1, hour 0,\n                min 0, sec 0,\n                nano 0, tz \"UTC+00:00\"}}]\n\n  ;; posional argument filled with nil when not enough arguments\n  (let [year (or (0 rest) year)\n        mon (or (1 rest) mon)\n        day (or (2 rest) day)\n        hour (or (3 rest) hour)\n        min (or (4 rest) min)\n        sec (or (5 rest) sec)\n        nano (or (6 rest) nano)\n        tz (or (7 rest) tz)]\n\n      (print nation)\n      (rust/datetime year mon day hour mi sec nano tz))\n)\n\n(nation-datetime \"Japan\" 2018 1 1 {:tz \"UTC+09:00\"})\n(nation-datetime \"UK\" {:year 2018 :mon 1 :day 1\n                       :hour 0 :min 0 :sec 0 :nano 0})\n\n;; ========== [WIP] Type System (Annotation) ==========\n;; type abbreviation\n#any                     ; any type\n#nil,                    ; nil\n#bool,                   ; bool\n#i64,                    ; i64\n#f64,                    ; f64\n#c64,                    ; c64 (complex number)\n#str                     ; string\n#regex                   ; regex\n#key                     ; keyword\n#sym                     ; symbol\n#l[#any]                 ; list of any\n#v[#i64]                 ; vector of i64\n#m[#str]                 ; map that value is string\n#s[#f64]                 ; set of f64\n#a[#i64, [2, 3, 4]]      ; 3d-array of i64 (shape is [2, 3, 4])\n#fn[#i64, #i64] =\u003e #i64  ; function like (fn [x y] =\u003e (+ x y)), x: i64, y: i64, return: i64\n#macro                   ; macro(マクロの型をどうするか)\n#generator[#str]         ; generator\n#datetime                ; datetime\n#duration                ; duration\n#iterable[#i64]          ; iterable\n#collection              ; collection\n#option[#i64]            ; option of i64\n\n;; map_key: #str, #i64, #key\n;; array: #i64, #f64, #c64 + shape\n\n;; ===== [WIP] User Defined Type\n(enum Color                         ; define enum\n  \"Color enum\"\n  [Red Green Blue])\n\n(def c #Color Color.Red)            ; using enum type: Color\n\n(struct Point                       ; define struct\n  \"Point struct\"\n  [x #i64\n   y #i64])\n\n(def p #Point (Point {:x 1, :y 2})) ; using struct type: Point\n\n(typedef #int #i64)                 ; typedef (type alias)\n(typedef #map-key\n  (union #i64 #str #key))           ; union of i64, string, keyword\n\n;; ===== [WIP] Type hierarchy\n;; #any is super type of all types\n;; #i64, #f64, #c64 is sub type of #number\n;; #l, #v, #m, #s, #a is sub type of #collection\n;; #collection is sub type of #iterable\n;; #str is sub type of #iterable\n;; #generator is sub type of #iterable\n;; #slice is defined with #struct\n;; #map-key can take #str, #i64, #key\n\n;; ===== [WIP] multiple dispatch\n;; You can define multiple function with same name with different type.\n(defn some [x #i64] =\u003e #i64\n  (print \"i64\")\n  x)\n\n(defn some [x #f64] =\u003e #f64\n  (print \"f64\")\n  x)\n\n(some 1)                              ; 1 =\u003e \"i64\"\n\n;; ===== [WIP] module system\n(import string)\n(string/shouty-snake \"abcDef\")        ; =\u003e \"ABC_DEF\"\n\n(import string :as str)               ; import with alias\n(str/shouty-snake \"abcDef\")           ; =\u003e \"ABC_DEF\"\n(def sss str/#template \"{:.2}\")       ; use type defiend in module\n\n(import string [shouty-snake          ; import with select\n                train-case])\n(train-case \"abcDef\")                 ; =\u003e \"Abc-Def\"\n\n(import \"path/to/somename\")           ; import 'somename.lisp'\n(somename/somefunc 1 2 3)             ; =\u003e ...\n\n(defn somefunc [x y z]\n  (print x y z))\n\n(export [somefunc])                   ; export function\n\n;; ===== [WIP] Array API\n(def a (array [[1, 2, 3],             ; 2d-array of i64\n               [4, 5, 6]]))\n(a/shape a)                           ; =\u003e [3, 3]\n(a/reshape a [1, 6])                  ; =\u003e [[1, 2, 3, 4, 5, 6]]\n(a/zeros [2, 3])                      ; =\u003e [[0, 0, 0], [0, 0, 0]]\n(a/ones [2, 3])                       ; =\u003e [[1, 1, 1], [1, 1, 1]]\n(a/range 0, 1, 0.2)                   ; =\u003e [[0, 0.2, 0.4, 0.6, 0.8, 1.0]]\n(a/linspace 0, 1, 6)                  ; =\u003e [[0, 0.2, 0.4, 0.6, 0.8, 1.0]]\n(a/rand [2, 3])                       ; =\u003e [[0.15, 0.89, 0.35], [0.34, 0.15, 0.76]]\n(a/randint 0, 10, [2, 3])             ; =\u003e [[1, 3, 9], [8, 4, 5]]\n([0|2] a)                             ; =\u003e [[1, 2, 3], [4, 5, 6]]\n([0|-1|2] a)                          ; =\u003e [[1, 3, 5], [4, 6, 8]]\n([|, 1] a)                            ; =\u003e [[2, 5], [3, 6]]\n([|, 1|2] a)                          ; =\u003e [[[2], [5]], [[3], [6]]]\n\n;; ===== [WIP] Scientific Constants\n\n;; [WIP] Utilizing types defined in other modules\n;; [WIP] Powerful type inference\n\n;; [WIP] test\n;; [WIP] assert\n;; [WIP] Polars binding\n;; [WIP] Parallel(thread, coroutine, async)\n;; [WIP] SIMD\n;; [WIP] JIT\n;; [WIP] Compile to Single Binary\n;; ******************************************\n```\n\n## Pronunciation\n\n`/sai lisp/`\n\n## Pull requests are welcome\n\n- Currently, **execution speed is too slow**.\n- You may rewrite it from the design level.\n\n## VSCode Extension\n\nCurrently only syntax highlight supported.\n\n- [GitHub](https://github.com/chaploud/Sci-Lisp-vscode-extension)\n- [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=chaploud.sci-lisp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaploud%2Fsci-lisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaploud%2Fsci-lisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaploud%2Fsci-lisp/lists"}