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.

Simplifier: no copies to inspect a block or to try case-of-case (#316)

Two copies ran on every pass over a function, whatever came of them:
- every `let v = { ... }` was cloned to see whether its chain ends in a
  return (and may be spliced); a borrowed walk answers that now, and
  the block is taken apart only when it does;
- every switch on a variable cloned the substitution map and renamed
  all its arms for case-of-case before checking the cheap conditions
  (one use, a known switch block, a pure one); they come first now.

The optimised Core is byte-identical (md5 of `louise core` over every
tests/run program, example and toki2), and the optimiser on toki2 goes
from 4.8 s to 4.1 s.

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

olivier · il y a 1 mois · c633ab10cde0e26920fe9d43f2de0d1ccdd9023c

Parents 9c35330

1 fichiers modifiés, 49 ajouts, 26 suppressions

Mcrates/louise_core/src/opt/simplify.rs+49−26