|
1 |
| - |
2 | 1 | Calcit is an interpreter built with Rust, and also a JavaScript code emitter. It's inspired mostly by ClojureScript. Calcit-js emits JavaScript in ES Modules syntax.
|
3 | 2 |
|
4 | 3 | ## Install & Try
|
@@ -42,92 +41,3 @@ Read more in [Minimal Calcit](https://github.com/calcit-lang/minimal-calcit/blob
|
42 | 41 |
|
43 | 42 | It's hot-swapping friendly when you use [calcit-editor](https://github.com/calcit-lang/editor). Install it and run `ct` to launch editor server, which writes `compact.cirru` and `.compact-inc.cirru` on saving. Try launching example by cloning [Calcit Workflow](https://github.com/calcit-lang/calcit-workflow).
|
44 | 43 |
|
45 |
| -## Features |
46 |
| - |
47 |
| -* Immutable Data |
48 |
| - |
49 |
| -Values and states are represented in different data structures, which is the semantics from functional programming. Internally it's [rpds](https://docs.rs/rpds/) in Rust and a custom [2-3 tree](https://github.com/calcit-lang/ternary-tree.ts) in JavaScript. |
50 |
| - |
51 |
| -* Lisp(Code is Data) |
52 |
| - |
53 |
| -Calcit-js was designed based on experiences from ClojureScript, with a bunch of builtin macros. It offers similar experiences to ClojureScript. So Calcit offers much power via macros, while keeping its core simple. |
54 |
| - |
55 |
| -* Indentations-based Syntax |
56 |
| - |
57 |
| -With `bundle_calcit` command, Calcit code can be written as an indentation-based language. So you don't have to match parentheses like in Clojure. It also means now you need to handle indentations very carefully. |
58 |
| - |
59 |
| -* Hot code swapping |
60 |
| - |
61 |
| -Calcit was built with hot swapping in mind. Combined with [calcit-editor](https://github.com/calcit-lang/editor), it watches code changes by default, and re-runs program on updates. For calcit-js, it works with Vite and Webpack to reload, learning from Elm, ClojureScript and React. |
62 |
| - |
63 |
| -* ES Modules Syntax |
64 |
| - |
65 |
| -To leverage the power of modern browsers with help of Vite, we need another ClojureScript that emits `import`/`export` for Vite. Calcit-js does this! And this page is built with Calcit-js as well, open Console to find out more. |
66 |
| - |
67 |
| -### Eco-system |
68 |
| - |
69 |
| -Libraries: |
70 |
| - |
71 |
| -[Calcit Std Libraries](https://github.com/calcit-lang/calcit.std) |
72 |
| -[Memof: memoization library with caching](https://github.com/calcit-lang/memof) |
73 |
| -[Lilac: validation library](https://github.com/calcit-lang/lilac) |
74 |
| -[Recollect: Diff/patch library designed for Cumulo project](https://github.com/calcit-lang/recollect) |
75 |
| -[Calcit WebSocket server binding](https://github.com/calcit-lang/calcit-wss) |
76 |
| - |
77 |
| -Frameworks: |
78 |
| - |
79 |
| -[Respo: virtual DOM library](https://github.com/Respo/respo.calcit) |
80 |
| -[Phlox: virtual DOM like wrapper on top of PIXI](https://github.com/Quamolit/phlox.calcit) |
81 |
| -[Quamolit: what if we make animations in React's way?](https://github.com/Quamolit/quamolit.calcit) |
82 |
| -[Quaterfoil: thin virtual DOM wrapper over three.js](https://github.com/Quamolit/quatrefoil.calcit) |
83 |
| -[Cumulo: template for tiny realtime apps](https://github.com/Cumulo/cumulo-workflow.calcit) |
84 |
| - |
85 |
| -Tools: |
86 |
| - |
87 |
| -[Calcit IR viewer](https://github.com/calcit-lang/calcit-ir-viewer) |
88 |
| -[Calcit Error viewer](https://github.com/calcit-lang/calcit-error-viewer) |
89 |
| -[Calcit Paint: play with 2d shapes(experimental)](https://github.com/calcit-lang/calcit-paint) |
90 |
| - |
91 |
| -### Recent Posts |
92 |
| - |
93 |
| -Videos: |
94 |
| - |
95 |
| -[Calcit-js 开发的阶段介绍 2021-11](https://www.bilibili.com/video/BV1Yg411K73P) |
96 |
| -[calcit-js 开发记录(21-01-22) 关于 ternary-tree.ts 重构](https://www.bilibili.com/video/BV1Ht4y167Fg) |
97 |
| -[calcit-js 阶段介绍(2021-01)](https://www.bilibili.com/video/BV1H5411n7su) |
98 |
| -[calcit-runner 阶段记录介绍(2021-01)](https://www.bilibili.com/video/BV1cK4y1W7dZ) |
99 |
| - |
100 |
| -Articles: |
101 |
| - |
102 |
| -[Calcit 脚本语言一些基础介绍](https://zhuanlan.zhihu.com/p/394791973) |
103 |
| -[Introducing calcit-js: toy language inspired by cljs](https://clojureverse.org/t/introducing-calcit-js-toy-language-inspired-by-cljs/7097) |
104 |
| -[An indentation way to Lisp](https://github.com/calcit-lang/calcit-runner/discussions/123) |
105 |
| -[Problems encountered in generating js](https://github.com/calcit-lang/calcit-runner.nim/discussions/148) |
106 |
| -[calcit-js 的 JavaScript 代码生成与疑难](https://github.com/calcit-lang/calcit-runner.nim/discussions/184) |
107 |
| -[ternary-tree.ts: 关于初期的性能优化(on early optimizations)](https://github.com/calcit-lang/ternary-tree.ts/discussions/7) |
108 |
| -[A trick for cheaper persistent list in JavaScript](https://clojureverse.org/t/a-trick-for-cheaper-persistent-list-in-javascript/7172) |
109 |
| - |
110 |
| -### Cirru |
111 |
| - |
112 |
| -Also see [Cirru Project](http://cirru.org/) for higher goals of auto-layout code editor, which is Calcit's default editor. |
113 |
| - |
114 |
| -Example of a `compact.cirru` file generated from calcit-editor: |
115 |
| - |
116 |
| -```cirru |
117 |
| -{} (:package |app) |
118 |
| - :configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!) |
119 |
| - :modules $ [] |
120 |
| - :files $ {} |
121 |
| - |app.main $ {} |
122 |
| - :ns $ quote |
123 |
| - ns app.main $ :require |
124 |
| - :defs $ {} |
125 |
| - |main! $ quote |
126 |
| - defn main! () (+ 1 2) |
127 |
| - |reload! $ quote |
128 |
| - defn reload! () |
129 |
| -``` |
130 |
| - |
131 |
| -If you want to write in a text editor, check out `bundle_calcit` command in project. 也可以查看相关中文[介绍视频](https://www.bilibili.com/video/BV1ry4y1W7VW?from=search&seid=17614445788882056969). |
132 |
| - |
133 |
| -There's also a "Cirru EDN" format for data. |
0 commit comments