tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

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.

olivier · il y a 1 mois · 1aa3db00ca56e5573e9104170f340a29eebcb2c6

Parents 8c5bc5a

19 fichiers modifiés, 613 ajouts, 84 suppressions

Mcrates/louise_core/src/externs.rs+5−0
Mcrates/louise_interp/src/externs.rs+25−0
Mexamples/http_demo/src/assets.lse+33−50
Mexamples/http_demo/src/views.lse+30−15
Aexamples/http_demo/static/robots.txt+2−0
Aexamples/http_demo/static/style.css+221−0
Mexamples/http_demo/test/app_test.lse+30−15
Mruntime/louise_rt/include/louise_rt.h+7−0