Skip to content

Consider rewriting the parser to make it copy-free #16

Closed
@zbraniecki

Description

@zbraniecki

At the moment the parser is copying some parts of the slice while creating the AST.

Most Rust parsers I can find in the wild rather rely on building AST that stores slices and aim for zero-copy mode.
Last example: https://github.com/viperscape/lichen/blob/master/src/parse.rs

I think we could do this here and it would probably benefit performance and memory. The cost is that if you want to modify the AST you'll have to copy it, but that seems to be a reasonable cost.
Most use cases only need to read the AST from what I know.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions