Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Suggestion: A new infrastructure for this Toml -> Json compiler#56

Copy link
Copy link
@bd82

Description

@bd82
Issue body actions

Hello @BinaryMuse and other contributors 馃槃

Context

I am creating a set of re-usable and modular Toml related tooling in here.

One of the first modules is a Toml to Syntax Tree parser.

How this could benefit the Toml-Node project

The Toml to Concrete Syntax Tree parser could be evaluated for re-use as the parser for this repo's Toml to Json compiler. So instead of implementing both a parser and a compiler in this repo. Toml-Node would only implement a (to Json) compiler using a Syntax Tree Visitor.

Pros

  • Let someone else deal with aligning to the specifications 馃槃 .
  • Toml 0.5 support.
  • I estimate (potential) for around two orders of magnitude higher performance than Toml-Node.
  • Try out the benchmark.
  • Just an estimate, Depends on how complex the compiler is relative to parsing...
  • Will solve toml parsing is too slow聽#39

Cons

  • Early work, expect some bugs.
    • But those should be ironed out quickly as the Toml spec is very simple.
  • Larger library size (including deps) as the Chevrotain Parsing Toolkit runtime used is: 146K/B minified.
  • No Streaming support (yet).
    • Will hopefully exist at a later time (but likely not soon).
  • No longer a dependency free library.
  • Bundling of Chevrotain based parsers must be done carefully due to reliance on
    Function.prototype.toString.
    • but this can be fully mitigated transparently from end users.

Summary

This has a potential to improve both the performance and alignment to newest spec of Toml Node, but with the cons described above.

@BinaryMuse could this be of interest to Toml Node?

Cheers.
Shahar.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.