lightinggaq.blogg.se

Tor project replace complex with rust
Tor project replace complex with rust







a lexeme), and to find a substring, crazy naming. These traits provide methods to find a token (i.e. Recently, I have been working on optimisations in the FindToken and FindSubstring traits from nom itself.

tor project replace complex with rust

To that end, it uses extensively Rust’s strong typing, zero copy parsing, push streaming, pull streaming, and provides macros and traits to abstract most of the error prone plumbing. Its goal is to provide tools to build safe parsers without compromising the speed or memory consumption. Nom is a parser combinators library written in Rust. This post does not explain why this is a sane approach in our context, but keep in mind this is much easier to test, to maintain, and to optimise.īecause this project is complex enought, we are delegating the parser combinator implementation to nom. Instead of having a classical grammar, compiled to a parser, we write pure functions acting as small parsers. The library tagua-parser is built with parser combinators.

tor project replace complex with rust

If you would like to know more about this project, you can see this conference I gave at the PHPTour last week: Tagua VM, a safe PHP virtual machine. It contains the lexical and syntactic analysers for the PHP language, in addition to the AST (Abstract Syntax Tree). One of them that keeps me busy these days is tagua-parser. Tagua VM is an experimental PHP virtual machine written in Rust and LLVM.









Tor project replace complex with rust