You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stage-A: a shared growable byte buffer for compiler/src modules #985
Every DSL port in compiler/src/ builds its output text by hand. The Field DSL port (#956) has FxBuf, a fixed-capacity buffer that sets an error flag when it fills. The Shader DSL port (#683) has ShBuf, which grows with realloc. cgen.flow has its own writer. Each module also carries its own copy of the ASCII whitespace and word-character tests and a span compare.
Current workaround
Each module declares malloc / realloc / free / strlen as externs and defines a struct with buf, cap and len plus putc / puts / put_span helpers. The shader port alone spends about 60 lines on this.
Request
A leaf module (for example compiler/src/bytebuf.flow, or a Stage-A stdlib module the frontend can import) with a growable byte buffer: new(cap), putc, puts, put_span(src, s, e), cstr() (NUL-terminated view) and free, and the ASCII class helpers (is_space matching Python str.isspace, is_word, is_digit). It must be a leaf so the self-emit scripts can link it into flowc_frontend.o like fileio.
Activity
stdlib: process API with argv, captured output, exit status, timeout,…
selfhost: DSL expanders share compiler/src/bytebuf.flow (#985)
stdlib: process API with argv, captured output, exit status, timeout,…
selfhost: DSL expanders share compiler/src/bytebuf.flow (#985)
stdlib: process, regex, os and bytebuf (#1083)