Summary
WFL parses and serializes JSON but has no TOML support. For configuration
files specifically, TOML is a very common on-disk format, and a program that
must read one currently has no option inside the language.
Context
This surfaced implementing a configuration subsystem whose specification
mandates TOML 1.0 for its config files. WFL is otherwise an excellent fit for
the work — the HTTP server, database access, and crypto primitives all did what
was needed — but the file format could not be honored.
The two options available were to hand-roll a TOML subset parser in WFL, which
is a fragile thing to own and gets progressively more wrong as it meets real
TOML, or to change the file format. The format was changed to JSON and the
deviation from spec written down.
Request
TOML parse and serialize, mirroring the existing JSON surface so the two feel
consistent:
store config as parse_toml of file_contents
store text as to_toml of config
Parsing alone would resolve most of it — configuration files are far more often
read by a program than written by one.
Note on scope
This is a genuine feature request rather than a defect, and lower priority than
the two security-related gaps I have filed alongside it (#665, #666) and the
transaction issue (#664). Filing it mainly so the gap is recorded: "reads config
files" is close to a core use case for a language with WFL's ergonomics, and
TOML is what a large share of those files are written in.
Summary
WFL parses and serializes JSON but has no TOML support. For configuration
files specifically, TOML is a very common on-disk format, and a program that
must read one currently has no option inside the language.
Context
This surfaced implementing a configuration subsystem whose specification
mandates TOML 1.0 for its config files. WFL is otherwise an excellent fit for
the work — the HTTP server, database access, and crypto primitives all did what
was needed — but the file format could not be honored.
The two options available were to hand-roll a TOML subset parser in WFL, which
is a fragile thing to own and gets progressively more wrong as it meets real
TOML, or to change the file format. The format was changed to JSON and the
deviation from spec written down.
Request
TOML parse and serialize, mirroring the existing JSON surface so the two feel
consistent:
Parsing alone would resolve most of it — configuration files are far more often
read by a program than written by one.
Note on scope
This is a genuine feature request rather than a defect, and lower priority than
the two security-related gaps I have filed alongside it (#665, #666) and the
transaction issue (#664). Filing it mainly so the gap is recorded: "reads config
files" is close to a core use case for a language with WFL's ergonomics, and
TOML is what a large share of those files are written in.