
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1199 · main · 10 min 33 s
1Étoiles
0Forks
0Issues
Runtime, std: `std/file`, whole-file IO on the blocking pool; the demo serves static files (ADR 0049)
Std could not read a file, so the demo could not serve one. Now it can: `std/file` reads and writes whole files — `read`/`read_bytes`, `write`/`write_bytes`, `exists`, `size` — every operation `/ <io>` and `Result`, never a panic. The four externs are `blocking`: they run on the runtime's blocking pool while the actor waits, so a slow disk never stalls a scheduler (the pool of ADR 0005, whose module doc already named file IO as a motivation). The interpreter implements them inline (`std::fs`), so `louise run` and interpreted tests see files too. The five touch points of `docs/runtime-abi.md` are cross-checked by `louise_codegen_c/tests/externs.rs`. - **The demo serves `/static/`**: `assets.static_file` reads `.` + path, maps the extension to a content type, rejects `..` (a request path must not leave the directory) and answers 404 for anything missing. The git-dependency sandbox test copies `static/` too. - **The demo is styled**, glassmorphism over a dark terminal theme (`~/louise · demo ▌`, `// Log in`): the stylesheet is a real file, `static/style.css`, served by the new route and linked from the pug views. Tests: `tests/run/file.lse` (interpreter and native, idempotent), an `fs.rs` round-trip unit test with the leak oracle, the demo's route tests (stylesheet from disk, robots.txt, missing and traversal 404s) natively, and the load test.
Parents 8c5bc5a
19 fichiers modifiés, 613 ajouts, 84 suppressions
crates/louise/tests/packages.rs+1−1crates/louise_core/src/externs.rs+5−0crates/louise_db/src/lib.rs+1−0crates/louise_interp/src/externs.rs+25−0docs/adr/0049-std-file.md+54−0docs/adr/README.md+1−0docs/reference/language.md+1−0docs/tutorial.md+1−0examples/http_demo/src/app.lse+4−3examples/http_demo/src/assets.lse+33−50examples/http_demo/src/views.lse+30−15examples/http_demo/static/robots.txt+2−0examples/http_demo/static/style.css+221−0examples/http_demo/test/app_test.lse+30−15runtime/louise_rt/include/louise_rt.h+7−0runtime/louise_rt/src/fs.rs+130−0runtime/louise_rt/src/lib.rs+1−0std/file.lse+41−0tests/run/file.lse+25−0