From 7025bc11045750caa1f3821c0dfc4f8067bc5ddd Mon Sep 17 00:00:00 2001 From: setop Date: Fri, 26 Sep 2025 21:22:13 +0200 Subject: [PATCH] refine backlog --- README.md | 16 +++++++++++++++- TODO.md | 19 +++++++++++++++++++ uloc.sh | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 TODO.md create mode 100755 uloc.sh diff --git a/README.md b/README.md index 6914a9a..57f661d 100644 --- a/README.md +++ b/README.md @@ -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!

``` +## 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: diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..145d287 --- /dev/null +++ b/TODO.md @@ -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 diff --git a/uloc.sh b/uloc.sh new file mode 100755 index 0000000..64d0bca --- /dev/null +++ b/uloc.sh @@ -0,0 +1,3 @@ +#!/bin/sh -eu + +countuniq0 build.sh dom.js launch.js