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/string: repeat doubles its copies, linear and log-depth

`repeat s n` was `s <> repeat s (n - 1)`: quadratic in the result (each
step copied everything after it) and one stack frame per copy, so a
million copies overflowed a small stack natively and took ~30 s to build
a 2 MB string. It now doubles: about log2(n) concatenations and frames,
and linear in the result's length.

tests/run/string_repeat.lse runs under //@ small-stack with a million
copies, which the old version could not.

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

olivier · il y a 2 sem. · eb9f80cab7189b51271d50c910f960595da7e7c8

Parents ae18f62

2 fichiers modifiés, 43 ajouts, 1 suppressions