~technomancy/fennel-lang.org

Add content-type for .lua files.

It tries to parse it as XML otherwise??
Add samples to See.
Pipe See input/output to the worker completely separately.

Don't even try to share code across worker vs fallback.
Attempt to do compilation in workers, but it gives nonsense errors.
Experiment with loading See Fennel in the background with web workers.
Add error handling to See Fennel.
Tweak notice.
Add See: rudimentary bidirectional compilation page.
Update to 0.6.0.
Remove broken contributors link until we can get it fixed.
Update sourcehut link to project URL

Instead of repository URL.
Allow pandoc command to be overridden.

I still don't have pandoc 2 locally.
migrating repl to a web worker with fallback

Hello,

This patch suggests using a Web Worker for the web REPL. We had an issue
with the last one (https://lists.sr.ht/~technomancy/fennel/patches/12080).

The problem was that we had missing files in the upload process inside
the makefile. This patch solves these problems, and I improved it to
ensure a compatible fallback for browsers that do not support Web
Workers. Also, the shim.lua test still works.

I uploaded a version to make testing easier:
https://gbaptista.com/fennel/ (fennel / 123)

Tested on: Luakit, Nyxt, Chromium, Firefox, Brave, and Opera.

Included in this patch:

makefile:
Adds new files into the upload process.

repl-worker.js:

Fengari does not have a straightforward way to deal with Web Workers;
This file evaluates the Worker written in Lua and makes it accessible
in pure js for the Web Worker.

repl-worker.lua:

The Web Worker source code; It's responsible for receiving messages
from the UI and sending the evaluated responses.

repl.fnl:

The Lua pane toggle was removed to make possible to run the full REPL
inside a Web Worker.

init.lua:

Instead of using REPL directly, it communicates via messages with the
Web Worker to avoid freezing the page.

I introduced a "fake loader" that gives the feeling that something is
happening to avoid let the user think that something is broken. This
loader simulates percentage progress for 10 seconds waiting time.

The Lua pane toggle was moved to this file.

Also, there are compatible modes that make possible to use the REPL in
old browsers or to run tests without any browser.
Revert "migrating repl to a web worker"

This reverts commit 20f6744439fbdec4c9d0d1a138e86551bb3dadbf.
migrating repl to a web worker

This patch suggests using a Web Worker for the web REPL. I tried to
modify as little code as possible.

Tested on: Chromium, Firefox, Brave, and Opera.

Included in this patch:

repl-worker.js:

Fengari does not have a straightforward way to deal with Web Workers;
This file evaluates the Worker written in Lua and makes it accessible
in pure js for the Web Worker.

repl-worker.lua:

The Web Worker source code; It's responsible for receiving messages
from the UI and sending the evaluated responses.

repl.fnl:

The Lua pane toggle was removed to make possible to run the full REPL
inside a Web Worker.

shim.lua:

A small adjustment to avoid breaking the test.

init.lua:

Instead of using REPL directly, it communicates via messages with the
Web Worker to avoid freezing the page.

I introduced a "fake loader" that gives the feeling that something is
happening to avoid let the user think that something is broken. This
loader simulates percentage progress for 10 seconds waiting time.

The Lua pane toggle was moved to this file.

Also, there is a loadReplWithoutWebWorker function to keep the shim.lua
working.
Add some padding to the site for mobile.
No TOC on rationale.
Add rationale doc.
Improving the REPL loading feedback

Hi!

This patch improves user feedback when loading the repl.

I found that the problem is related to how the Javascript Event Loop works. The talk "What the heck is the event loop anyway?" by Philip Roberts was a joy of knowledge!

This patch does not solve the entire problem: The fact that the browser still freezes during the loading and the page does not respond until the repl is loaded makes me crazy.

I will try to do some experiments, and if it works, I send a second patch. Probably some solution using js async feature or Web Workers will do the trick.
Pull in repl bug fix.
Don't allow repl coroutine to fail silently.
Next