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: sending requires `Send`; the concrete-types check is removed (issue #233)

ADR 0004 Revision 6, second part: the actor APIs require the `Send`
auto trait of the previous PR, which replaces `send.rs` (M6 part 6).
Generic code is now checked statically.

- **Operations may have a `where` clause** (parser, AST, HIR,
  tree-sitter), limited to marker traits: performing an operation passes
  no dictionary (new E0414).
- **What requires `Send`:**
  - `process.send` (`where Send<m>`);
  - `actor.start` (the initial state, `where Send<s>`);
  - `actor.try_call`, `call` and `cast` (the message).
  An annotated generic function that sends now needs the bound (E0402
  with the fix as a note); an unannotated one infers it.
- **`send.rs` is deleted.** E0704 now points at the send, not at
  `process.subject()`, and its note names the field.
- **Hidden types are checked only when stored.** A type a constructor
  hides is an obstacle only if a field stores a value of it. So
  `Ask(Request<r>, Subject<r>) -> Msg` (tests/run/gadts.lse) is sendable:
  a subject is a pid and a tag, and `Request<r>`'s constructors hold
  `Int`s. The previous PR's rule rejected any hidden type.

Closures are still assumed sendable statically (the runtime refuses bad
captures); capture rows come next.

- **Tests:**
  - `tests/ui/send.lse` is updated: errors at the send, unbounded and
    inferred relays;
  - `tests/ui/send_trait.lse` gains the hidden-but-not-stored case;
  - a tree-sitter corpus case covers operations with `where`.
- **Generated C:** byte-identical for tests/run, tests/bench,
  tests/stress and examples/http_demo, since the bounds are erased.
- **`louise check`, release, median of 21, before → after:** std_tour
  46–47 → 47 ms, hello 45 → 45 ms, http_demo 54–55 → 51 ms; no
  measurable cost.

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

olivier · il y a 1 mois · fa53a90333a4e331a55f49d578f0816cfa64b074

Parents 9f63b1c

19 fichiers modifiés, 5409 ajouts, 5357 suppressions

Mcrates/louise_hir/src/lower/mod.rs+1−1
Mcrates/louise_syntax/src/grammar/mod.rs+4−0
Mcrates/louise_types/src/env/mod.rs+14−0
Dcrates/louise_types/src/send.rs+0−155
Mcrates/louise_types/src/traits.rs+53−25
Meditors/tree-sitter-louise/grammar.js+2−0
Meditors/tree-sitter-louise/src/grammar.json+12−0
Meditors/tree-sitter-louise/src/node-types.json+10−0
Meditors/tree-sitter-louise/src/parser.c+5205−5155
Meditors/tree-sitter-louise/test/corpus/items.txt+44−0