Skip to content

Commit

Permalink
a rushed refactor with content updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jun 24, 2021
1 parent 106cdce commit d44444d
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 426 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
&& git clone https://github.com/calcit-lang/lilac.git
&& git clone https://github.com/calcit-lang/memof.git
&& git clone https://github.com/Respo/respo.calcit.git
&& git clone https://github.com/Respo/reel.calcit.git --branch 0.5.3
&& git clone https://github.com/Respo/respo-markdown.calcit.git
&& git clone https://github.com/Respo/reel.calcit.git
&& git clone https://github.com/Respo/respo-markdown.calcit.git --branch 0.3.7
&& git clone https://github.com/Respo/respo-ui.calcit.git
- name: "compiles to js"
Expand Down
37 changes: 37 additions & 0 deletions assets/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

body {
margin: 0;
overscroll-behavior-y: none;
}

body * {
flex-shrink: 0;
box-sizing: border-box;
}

::-webkit-scrollbar {
width: 4px;
height: 4px;
}

::-webkit-scrollbar-track {
background-color: hsla(0,0%,100%);
}

::-webkit-scrollbar-thumb {
background-color: hsla(200,100%,76%,0.8);
}

::-webkit-scrollbar-corner {
background-color: transparent;
}

::-webkit-resizer {
background-color: transparent;
}

.md-block .md-p {
font-size: 16px;
margin: 24px 0px;
line-height: 25px;
}
406 changes: 57 additions & 349 deletions calcit.cirru

Large diffs are not rendered by default.

47 changes: 11 additions & 36 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[] respo.core :refer $ [] defcomp defeffect <> >> div button textarea span input a body img
[] respo.comp.space :refer $ [] =<
[] reel.comp.reel :refer $ [] comp-reel
[] respo-md.comp.md :refer $ [] comp-md
[] respo-md.comp.md :refer $ [] comp-md comp-md-block
[] app.config :refer $ [] dev?
:defs $ {}
|comp-container $ quote
Expand All @@ -33,44 +33,17 @@
div
{} $ :style ui/row-middle
img $ {} (:src "\"http://cdn.tiye.me/logo/calcit.png")
:style $ {} (:max-width "\"40vw")
:style $ {} (:max-width "\"min(30vw, 200px)")
div
{} $ :style
merge $ {} (:flex 1) (:font-size 18) (:line-height "\"24px") (:height :max-content)
<> "\"Calcit is an interpreter inspired by Clojure, Cirru and webpack HMR."
merge $ {} (:flex 1) (:font-size 20) (:line-height "\"32px") (:height :max-content) (:font-family ui/font-fancy)
div ({}) (<> "\"Calcit: Lisp but with indentations")
div
{} $ :style
{} $ :font-size 16
<> "\"...an interpreter inspired by Clojure, Cirru and webpack HMR."
=< nil 40
div ({}) (<> "\"calcit-runner is an interpreter for loading snapshot file and evaluate program. It's inspired mostly by ClojureScript with Lisp macros and immutable data. And calcit-js is its js-emitting mode for plan javascript in ES import format.\n")
div ({}) (<> "\"Current goal for calcit-runner is to offer a scripting solution for simple tasks and drawing some patterns with help of Cairo APIs.")
=< nil 40
div ({}) (<> "\"Calcit was a project compiling Cirru to Clojure(Script), and calcit-runner makes it possible to interpret the snapshot file directly, without compiling to another language. The interpreter is currently experimental, with several useful tools from my old works. You can take it as a toy scripting language like Clojure, but implemented with a special editor, which is calcit-editor.\n")
=< nil 40
div ({}) (<> "\"Updates can be followed on ") (add-link "\"Twitter @cirrulang" "\"https://twitter.com/cirrulang") (<> "\". Visit ") (add-link "\"Calcit Runner" "\"https://github.com/calcit-lang") (<> "\" for details. Pre-built binaries for Linux can be found on ") (add-link "\"bin.calcit-lang.org" "\"http://bin.calcit-lang.org/linux/") (<> "\" and you can also compile code by yourself to try it.")
=< nil 40
div ({}) (<> "\"Also see ") (add-link "\"Cirru Project" "\"http://cirru.org/") (<> "\" for higher goals of auto-layout code editor.")
=< nil 40
div ({}) (<> "\"Recent Posts")
div ({}) (add-link "\"Introducing calcit-js: toy language inspired by cljs" "\"https://clojureverse.org/t/introducing-calcit-js-toy-language-inspired-by-cljs/7097")
div ({}) (add-link "\"An indentation way to Lisp" "\"https://github.com/calcit-lang/calcit-runner/discussions/123")
div ({}) (add-link "\"Problems encountered in generating js" "\"https://github.com/calcit-lang/calcit-runner/discussions/148")
div ({}) (add-link "\"calcit-js 的 JavaScript 代码生成与疑难" "\"https://github.com/calcit-lang/calcit-runner/discussions/184")
div ({}) (add-link "\"ternary-tree.ts: 关于初期的性能优化(on early optimizations)" "\"https://github.com/calcit-lang/ternary-tree.ts/discussions/7")
div ({}) (add-link "\"A trick for cheaper persistent list in JavaScript" "\"https://clojureverse.org/t/a-trick-for-cheaper-persistent-list-in-javascript/7172")
=< nil 40
div ({}) (<> "\"Recent Videos")
div ({}) (add-link "\"calcit-js 开发记录(21-01-22) 关于 ternary-tree.ts 重构" "\"https://www.bilibili.com/video/BV1Ht4y167Fg")
div ({}) (add-link "\"calcit-js 阶段介绍(2021-01)" "\"https://www.bilibili.com/video/BV1H5411n7su")
div ({}) (add-link "\"calcit-runner 阶段记录介绍(2021-01)" "\"https://www.bilibili.com/video/BV1cK4y1W7dZ")
=< nil 40
div ({}) (<> "\"Libraries & Tools")
div ({}) (add-link "\"Memof: memoization library with caching" "\"https://github.com/calcit-lang/memof")
div ({}) (add-link "\"Lilac: validation library" "\"https://github.com/calcit-lang/lilac")
div ({}) (add-link "\"Respo: virtual DOM library" "\"https://github.com/Respo/respo.calcit")
div ({}) (add-link "\"Phlox: virtual DOM like wrapper on top of PIXI" "\"https://github.com/Quamolit/phlox.calcit")
div ({}) (add-link "\"Quaterfoil: thin virtual DOM wrapper over three.js" "\"https://github.com/Quamolit/quatrefoil.calcit")
div ({}) (add-link "\"Calcit IR viewer" "\"https://github.com/calcit-lang/calcit-ir-viewer")
div ({}) (add-link "\"Calcit Error viewer" "\"https://github.com/calcit-lang/calcit-error-viewer")
div ({}) (add-link "\"Calcit Paint: play with 2d shapes" "\"https://github.com/calcit-lang/calcit-paint")
div ({}) (add-link "\"Cumulo: template for tiny realtime apps" "\"https://github.com/Cumulo/cumulo-workflow.calcit")
comp-md-block (inline-content! "\"content/intro.md") ({})
=< nil 200
when dev? $ comp-reel (>> states :reel) reel ({})
|add-link $ quote
Expand All @@ -89,6 +62,8 @@
:padding "\"0 20px"
:font-family ui/font-fancy
<> "\"Calcit Project"
|inline-content! $ quote
defmacro inline-content! (path) (read-file path)
:proc $ quote ()
|app.config $ {}
:ns $ quote (ns app.config)
Expand Down
54 changes: 54 additions & 0 deletions content/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

Calcit is an interpreter and code emitter for snapshot file from [calcit-editor](https://github.com/Cirru/calcit-editor). It's inspired mostly by ClojureScript. Calcit-js is emitted in ES Modules syntax. And it's hot-swapping friendly.

## Features

* Immutabilit Data

Values and states are represented in different data structures, which is the semantics from functional programming. Internally it's [`im` in Rust](https://crates.io/crates/im) and custom [finger trees](https://github.com/calcit-lang/ternary-tree.ts) in JavaScript.

* Lisp(Code is Data)

Calcit-js was designed based on experiences from ClojureScript, with a bunch of built macros. It offer similar experience with ClojureScript. So Calcit offers much power via macros, while keeps its core simple.

* Indentations

With the bundler command, Calcit code can be written like a 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.

### Eco-system

Libraries & Tools:

[Memof: memoization library with caching](https://github.com/calcit-lang/memof)
[Lilac: validation library](https://github.com/calcit-lang/lilac)
[Respo: virtual DOM library](https://github.com/Respo/respo.calcit)
[Phlox: virtual DOM like wrapper on top of PIXI](https://github.com/Quamolit/phlox.calcit)
[Quaterfoil: thin virtual DOM wrapper over three.js](https://github.com/Quamolit/quatrefoil.calcit)
[Calcit IR viewer](https://github.com/calcit-lang/calcit-ir-viewer)
[Calcit Error viewer](https://github.com/calcit-lang/calcit-error-viewer)
[Calcit Paint: play with 2d shapes](https://github.com/calcit-lang/calcit-paint)
[Cumulo: template for tiny realtime apps](https://github.com/Cumulo/cumulo-workflow.calcit)


### Recent Posts

Videos:

[calcit-js 开发记录(21-01-22) 关于 ternary-tree.ts 重构](https://www.bilibili.com/video/BV1Ht4y167Fg)
[calcit-js 阶段介绍(2021-01)](https://www.bilibili.com/video/BV1H5411n7su)
[calcit-runner 阶段记录介绍(2021-01)](https://www.bilibili.com/video/BV1cK4y1W7dZ)

Articles:

[Introducing calcit-js: toy language inspired by cljs](https://clojureverse.org/t/introducing-calcit-js-toy-language-inspired-by-cljs/7097)
[An indentation way to Lisp](https://github.com/calcit-lang/calcit-runner/discussions/123)
[Problems encountered in generating js](\"https://github.com/calcit-lang/calcit-runner/discussions/148)
[calcit-js 的 JavaScript 代码生成与疑难](https://github.com/calcit-lang/calcit-runner/discussions/184)
[ternary-tree.ts: 关于初期的性能优化(on early optimizations)](https://github.com/calcit-lang/ternary-tree.ts/discussions/7)
[A trick for cheaper persistent list in JavaScript](https://clojureverse.org/t/a-trick-for-cheaper-persistent-list-in-javascript/7172)

### More

Also see ["Cirru Project]("http://cirru.org/) " for higher goals of auto-layout code editor.

Updates can be followed on ["Twitter @cirrulang]("https://twitter.com/cirrulang) ". Visit ["Calcit Runner]("https://github.com/calcit-lang) " for details. Pre-built binaries for Linux can be found on ["bin.calcit-lang.org]("http://bin.calcit-lang.org/linux/) " and you can also compile code by yourself to try it.
35 changes: 1 addition & 34 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
<link rel="stylesheet" type="text/css" href="http://cdn.tiye.me/favored-fonts/main-fonts.css">

<style type="text/css">
body {
margin: 0;
overscroll-behavior-y: none;
}

body * {
flex-shrink: 0;
box-sizing: border-box;
}

::-webkit-scrollbar {
width: 4px;
height: 4px;
}

::-webkit-scrollbar-track {
background-color: hsla(0,0%,100%);
}

::-webkit-scrollbar-thumb {
background-color: hsla(200,100%,76%,0.8);
}

::-webkit-scrollbar-corner {
background-color: transparent;
}

::-webkit-resizer {
background-color:transparent;
}

</style>
<link rel="stylesheet" type="text/css" href="./assets/main.css">
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@calcit/procs": "^0.4.0-a14"
"@calcit/procs": "^0.4.0"
},
"devDependencies": {
"vite": "^2.3.8"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d44444d

Please sign in to comment.