Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/immunant/rexpat
Rust ❤️ Expat library
https://github.com/immunant/rexpat
expat expat-xml-parser library rust rust-library xml xml-parser xml-parser-lib
Last synced: 1 day ago
JSON representation
Rust ❤️ Expat library
- Host: GitHub
- URL: https://github.com/immunant/rexpat
- Owner: immunant
- License: mit
- Created: 2020-01-13T21:55:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-07T04:28:47.000Z (over 3 years ago)
- Last Synced: 2024-04-19T19:05:19.142Z (7 months ago)
- Topics: expat, expat-xml-parser, library, rust, rust-library, xml, xml-parser, xml-parser-lib
- Language: Rust
- Homepage:
- Size: 3.49 MB
- Stars: 22
- Watchers: 11
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
[![Build Status](https://dev.azure.com/immunant/rexpat/_apis/build/status/immunant.rexpat?branchName=master)](https://dev.azure.com/immunant/rexpat/_build/latest?definitionId=2&branchName=master)
# Rexpat: a libexpat compatible Rust crate
This project is a work-in-progress conversion from unsafe Rust transpiled directly from libexpat into safe, idiomatic Rust code. The initial transpilation and refactoring was done using [C2Rust](https://github.com/immunant/c2rust).
Do **not** use this in production (yet!), but help refactoring and rewriting is always welcome.
## Building
Requirements: Linux host with [`rustup`](https://rustup.rs/) installed. To run tests, you'll also need to install the requirements of libexpat (autoconf 2.58 or newer, make, and a recent C toolchain).
$ git clone --recurse-submodules https://github.com/immunant/rexpat
$ cd rexpat && cargo build## Testing
Unit testing:
$ cargo testDownload the W2C XML test suite to `/tmp/libexpat/xml-test-suite` and run
$ ./test_w2c.sh
To perform additional testing.
## Benchmarking
*NOTE:* Requires that you build `$REXPAT_ROOT/upstream/expat/tests/benchmark/benchmark` first. See steps and requirements [here](https://github.com/libexpat/libexpat/). You must also have `python3` (Python 3.6 or later) in your path.
$ ./src/tests/bench_c_vs_rust.py
## Goals
- Provide an ABI-compatible drop-in replacement for `libexpat`
- Avoid memory-corruption vulnerabilities via Rust's safety guarantees.
- Perform on par with the `libexpat` in time and space.## License
`rexpat` is free software licensed similarly to `libexpat`. You may copy, distribute, and modify it under the terms of the License contained in the file [COPYING](https://github.com/immunant/rexpat/blob/master/COPYING) distributed with this package. This license is the same as the MIT/X Consortium license.