1
0
mirror of https://codeberg.org/setop/elm-scripting synced 2025-11-08 21:49:57 +00:00

refine backlog

This commit is contained in:
2025-09-26 21:22:13 +02:00
parent a261077f6c
commit 7025bc1104
3 changed files with 37 additions and 1 deletions

View File

@@ -1,5 +1,13 @@
A tool to generate HTML code from Elm source in the terminal using [QuickJS](https://bellard.org/quickjs/).
# Requirements
* depends only on elm compiler, quickjs cli and a posix shell
* do not alter elm compiler
* do not alter quickjs cli
* do not patch elm compiler output
* provide acceptable performances (500ms for a big script)
# Design
QuickJS (Qjs) is a [JavaScript runtime](https://en.wikipedia.org/wiki/List_of_JavaScript_engines), similar to V8 or SpiderMonkey, but lighter and faster.
@@ -14,7 +22,7 @@ Next, we concatenate this with the Elm JavaScript output and an app launcher sni
* No event loop
* Hence, no [TEA](https://guide.elm-lang.org/architecture/); the `main` function must return a static view
* ~~The Elm app module must be called "Main"~~
* Hence, no Time, no Random, no Json Encoder/Decoder (!), no Http
* Nodes can only have one parent (this should always be the case)
# Usage
@@ -39,6 +47,12 @@ Hello World!
</p>
```
## Performances
Acceptable for small scripts : 250ms on a modest x86_64 CPU and 64MB RAM for a 500 records into a table ; but is does not scale well as everything is loaded before processing ; no streaming contrary to the usual Unix way.
# Prior Work
There are more complete tools for generating static sites with Elm: