tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

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

std/file/stream: open files read and written in chunks (ADR 0087)

A program can now stream a file of any size through a chunk's worth of
memory and read a range without reading what comes before it (HTTP
Range), on both backends:

- std/file/stream: open_read, open_write (Truncate, CreateNew, Append;
  new files 0600), read (fills up to max, empty at the end), read_at
  (pread), write, seek, size, sync, close, and impl Stream<OpenFile>.
- std/file: sync_dir, for durable creates and renames.
- A file is a pinned resource of the actor that opened it: it cannot be
  sent, and it is closed by close or when that actor unwinds. Use after
  close is an error. Every call runs on the io blocking pool.
- One kernel for both backends (louise_rt_prims::file); the interpreter
  holds it in a new Val::File.

Tests: tests/run/file_handles.lse on both backends; end to end, a 1 GiB
copy with peak RSS under 64 MiB, a killed actor's files closed, and 50
actors with files at once; unit tests in louise_rt_prims and louise_rt.

ADR 0087 is Proposed and needs engineering review. Closes #471 (its
directory operations landed in 33550bca).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 sem. · fb17f9212b6f28cafe79b884c9ca5b8492eb6a63

Parents 67b2420

19 fichiers modifiés, 1552 ajouts, 4 suppressions

Acrates/louise/tests/file_streams.rs+154−0
Acrates/louise/tests/fixtures/file_streams/file_streams.lse+194−0
Mcrates/louise_core/src/externs.rs+11−0
Mcrates/louise_interp/src/externs.rs+76−1
Mcrates/louise_interp/src/sched.rs+1−0
Adocs/adr/0087-streaming-file-handles.md+153−0
Mruntime/louise_rt/include/louise_rt.h+12−0
Aruntime/louise_rt_prims/src/file.rs+357−0
Mruntime/louise_rt_prims/src/lib.rs+4−0