Symptom
my check on a .my file with many deeply-nested str_concat chains and/or many multi-line format() templates triggers a runaway memory allocation (16-32 GB observed) and OOM-aborts the process:
my.exe : memory allocation of 34359738368 bytes failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The same happens on my run of the same file (the type-checker runs first).
Reproducible against
A non-trivial Solo program with ~30 inline template-emitter functions, each containing chained str_concat/format() calls, totalling ~330 LOC. Stripped down to ~110 LOC (audit logic only, no template builders), the same file type-checks and runs in <1s.
The trigger appears to be aggregate complexity of nested string-building constructs, not any single construct. A minimal pathological case I could not narrow further in this session.
Approximate repro shape
fn build_a(name: String, lang: String) -> String {
return str_concat(
str_concat(
str_concat(
format("// SPDX-License-Identifier: PMPL-1.0-or-later\n= {}\n:toc:\n\n", [name]),
format("Component: {} ({}).\n\n", [name, lang])
),
format("== Status\n\nStandalone. Conforms to the standards.\n\n* RSR template floor.\n* Stapeln container build using {}.\n* Contractiles.\n* 6a2 machine-readable.\n\n", [lang])
),
"\n== License\n\nPMPL-1.0-or-later.\n"
);
}
// ... 27 more functions of similar shape ...
// Combined file -> OOM during `my check`
Environment
my-lang HEAD: as of 2026-04-30 (with locally-applied stdlib additions for fs_*/env_args/format — see paired PR)
- Toolchain:
stable-x86_64-pc-windows-msvc, rustc 1.95.0
- OS: Windows 11 Pro for Workstations 26300
Suspected cause
Type-checker likely has a non-memoised recursion over the AST of str_concat/format chains, producing exponential type-resolution cost. A minimal Array mismatch returns a clean TypeMismatch error in microseconds, so the OOM is specifically a complexity issue, not parser-level construct rejection.
Suggested fix direction
- Memoise type checks on common subexpressions (especially repeated
str_concat/format AST nodes).
- Add a depth/size guard with a clear error when exceeded, rather than letting the allocator OOM.
Workaround in use
For the project that surfaced this (an idaptik scaffold tool), templates were moved out of .my source and into on-disk template files, read at runtime via fs_read_file + format(). The reduced AST type-checks fine.
Why this matters
This blocks using Solo for tooling that emits templated output (scaffolders, codegens, doc generators). Until fixed, every such tool has to use the on-disk-template workaround, which is a real ergonomic tax.
Symptom
my checkon a.myfile with many deeply-nestedstr_concatchains and/or many multi-lineformat()templates triggers a runaway memory allocation (16-32 GB observed) and OOM-aborts the process:The same happens on
my runof the same file (the type-checker runs first).Reproducible against
A non-trivial Solo program with ~30 inline template-emitter functions, each containing chained
str_concat/format()calls, totalling ~330 LOC. Stripped down to ~110 LOC (audit logic only, no template builders), the same file type-checks and runs in <1s.The trigger appears to be aggregate complexity of nested string-building constructs, not any single construct. A minimal pathological case I could not narrow further in this session.
Approximate repro shape
Environment
my-langHEAD: as of 2026-04-30 (with locally-applied stdlib additions forfs_*/env_args/format— see paired PR)stable-x86_64-pc-windows-msvc, rustc 1.95.0Suspected cause
Type-checker likely has a non-memoised recursion over the AST of
str_concat/formatchains, producing exponential type-resolution cost. A minimalArraymismatch returns a cleanTypeMismatcherror in microseconds, so the OOM is specifically a complexity issue, not parser-level construct rejection.Suggested fix direction
str_concat/formatAST nodes).Workaround in use
For the project that surfaced this (an idaptik scaffold tool), templates were moved out of
.mysource and into on-disk template files, read at runtime viafs_read_file+format(). The reduced AST type-checks fine.Why this matters
This blocks using Solo for tooling that emits templated output (scaffolders, codegens, doc generators). Until fixed, every such tool has to use the on-disk-template workaround, which is a real ergonomic tax.