Skip to content

Commit 64bdc91

Browse files
committed
update compact.cirru snippet
1 parent d2ad3cd commit 64bdc91

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

.github/workflows/upload.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ jobs:
1010
test:
1111
runs-on: ubuntu-22.04
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
cache: 'yarn'
1919

2020
- uses: supplypike/setup-bin@v3
2121
with:
22-
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0-a5/cr'
22+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.2/cr'
2323
name: 'cr'
24-
version: '0.8.0-a5'
24+
version: '0.8.2'
2525

2626
- uses: supplypike/setup-bin@v3
2727
with:
28-
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0-a5/caps'
28+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.2/caps'
2929
name: 'caps'
30-
version: '0.8.0-a5'
30+
version: '0.8.2'
3131
- name: "compiles to js"
3232
run: >
3333
caps --ci && cr --emit-js --once

content/intro.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
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.
32

43
## Install & Try
@@ -44,23 +43,23 @@ It's hot-swapping friendly when you use [calcit-editor](https://github.com/calci
4443

4544
## Features
4645

47-
* Immutable Data
46+
- Immutable Data
4847

4948
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.
5049

51-
* Lisp(Code is Data)
50+
- Lisp(Code is Data)
5251

5352
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.
5453

55-
* Indentations-based Syntax
54+
- Indentations-based Syntax
5655

5756
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.
5857

59-
* Hot code swapping
58+
- Hot code swapping
6059

6160
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.
6261

63-
* ES Modules Syntax
62+
- ES Modules Syntax
6463

6564
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.
6665

@@ -118,14 +117,14 @@ Example of a `compact.cirru` file generated from calcit-editor:
118117
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
119118
:modules $ []
120119
:files $ {}
121-
|app.main $ {}
122-
:ns $ quote
123-
ns app.main $ :require
120+
|app.main $ %{} :FileEntry
124121
:defs $ {}
125122
|main! $ quote
126123
defn main! () (+ 1 2)
127124
|reload! $ quote
128125
defn reload! ()
126+
:ns $ quote
127+
ns app.main $ :require
129128
```
130129

131130
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).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"@calcit/procs": "^0.8.0-a5",
3+
"@calcit/procs": "^0.8.2",
44
"cirru-color": "^0.2.3"
55
},
66
"devDependencies": {

yarn.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)