paritytech/lunarity

Name: lunarity

Owner: Parity Technologies

Description: Lunarity - a Solidity parser in Rust

Created: 2017-12-05 03:03:56.0

Updated: 2018-03-25 02:19:48.0

Pushed: 2018-01-03 15:04:47.0

Homepage:

Size: 285

Language: Rust

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Lunarity

A high performance, correctness-oriented Solidity parser + other tools.

The produced AST is mostly grammar.txt compliant. The AST is statically typed to make sure that it is not possible to construct an AST representation of what would be illegal grammar.

Performance

It's really fast.

ing target/release/deps/second_price_auction-2b369ce54b97fb9f

ing 2 tests
 parse_to_ast ... bench:      24,028 ns/iter (+/- 573) = 562 MB/s
 tokenize     ... bench:      15,037 ns/iter (+/- 1,405) = 898 MB/s

Neither the lexer nor the parser ever backtrack while reading bytes/tokens. The parser is using a paginated arena allocator to avoid heap allocation costs (or garbage collection costs, or anything else).

Feel free to rerun the benchmarks (requires nightly Rust, with rustup: rustup run nightly cargo bench)

License

This crate is distributed under the terms of both the MIT license and the Apache License (Version 2.0). Choose whichever one works best for you.

See LICENSE-APACHE and LICENSE-MIT for details.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.