Skip to content

No TOML support: config files in a very common format cannot be read #667

Description

@logbie

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

IN WORKPresently working on thisenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions