#config-parser #configuration-language #toml-parser #toml-config #validation #lexer #unit-testing

frostwalker

A TOML-like configuration language parser with zero dependencies outside of std

3 releases

0.1.1 Jan 19, 2024
0.1.0 Jan 19, 2024

#122 in Value formatting

45 downloads per month

MPL-2.0 license

33KB
640 lines

Frostwalker

A TOML-like configuration language parser for Rust. The crate features a parser stack made up of a lexer, validator, and formatter which all have unit tests and integration tests.

Justification

The Rust crate toml pulls in 8 other crates to do its job, including serde. While this may not be irksome to basically most Rust developers, I'm used to using severely underpowered Intel hardware so low compile times is a big focus for me so a crate made by me that requires only the standard library compared to one that requires other dependencies is preferrable.

I've also wanted to write a lexer, validator and parser stack for a language and configuration languages are much, much simpler than programming languages like C, Python, and Rust so it is easier to implement these things in a configuration language.

This was mainly made for my web server, herb, where I want to keep dependencies as low as possible just for fun but also for compile times as well. At present, the only dependency for herb is my packet library Packeteer to make the HTTP protocol code more seperated from herb.

I also use a TOML-like language instead of TOML directly as I don't need all the features of TOML nor do I want to implement parsing for all the features of TOML.

What features are supported at the moment?

  • Keys
  • Values
  • The equals sign
  • Booleans
  • Integers
  • Arrays (single depth only)

No runtime deps