Shiguredo has begun shifting its development focus from C++ to Rust. As part of this transition, we've been implementing various libraries in Rust, and this time we've released a TOML library.
By default, Shiguredo uses the JSONC format when developing applications in Rust. JSONC is an incompatible extension of JSON that allows comments and trailing commas, making it convenient to use.
Additionally, the nojson dependency-free JSON library supports it.
However, Rust is primarily designed for TOML usage. Despite this, the default library does not include TOML support, and most major TOML libraries have significant dependencies. Therefore, we decided to develop our own TOML implementation with minimized dependencies.
shiguredo/toml-rs
- Dependencies: 0
- Supports TOML v1.0.0 and v1.1.0 specifications
- Compatible with toml-test
- Fuzzing support
- Rewriting functionality
toml-test is a testing suite officially provided by the TOML project. A score of 100% indicates full compatibility, making this product technically "fully compatible."
We have prioritized robustness by thoroughly implementing fuzzing and ensuring the code remains stable under unexpected inputs.
Following user requests, we've added rewriting functionality. We implemented this feature by adapting nojson's positional tracking mechanism. After addressing several identified bugs, we've released this version.
https://github.com/shiguredo/toml-rs
Summary
While we strive to minimize dependencies by building our own libraries, the result is both comfortable to use and highly maintainable. The reduced dependency footprint makes maintenance easier, and having our own libraries provides the advantage of complete control.
Top comments (0)