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:

19
TODO.md Normal file
View File

@@ -0,0 +1,19 @@
# Major
- find a way to process external data
- [ ] from stdout (use case : json)
- [ ] from files (use case : SSG)
- [ ] from http (use case : spider)
- [ ] find a way to create a standalone executable (maybe with a combination of Google Closure Compiler and qjsc)
# Minor
- [ ] support for Elm debug mode (qjs does not implement `console.warn`, only `console.log`)
- [ ] in debug mode, keep the output
- [ ] allow to specify or guess the main module name
- [ ] allow to create standalone (`s`) HTML document instead of fragment
- [ ] silence elm compiler message when successful
- [ ] skip compilation steps if source has not been modified ; run directly ; this mean keeping the output
- [ ] add proper copyright and license

3
uloc.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh -eu
countuniq0 build.sh dom.js launch.js