I just published louis-rs 0.4.0, the first beta. louis-rs is the from-scratch Rust reimplementation of liblouis: same tables, same test suite, new engine, and none of the manual memory management behind liblouis’s CVEs.
Beta means: translation matches liblouis closely enough to try it on real work. It passes 99.4% of the more than two million assertions in liblouis’s own test suite, forward and backward, and every table liblouis ships compiles. The library API now follows semantic versioning, so breaking changes come only in a new 0.x minor version.
Please try it on your own texts and tables. What I need most now are reports from real use: a text that comes out differently from liblouis, a table that doesn’t load, an API that gets in your way.
Ways to use it:
- From Python, with Leonard de Ruijter’s bindings. They aren’t on PyPI yet; with a Rust toolchain, pip builds them from the repository:
pip install git+https://github.com/liblouis/louis-py
They cover translation in both directions, position maps and the cursor, the translation modes and emphasis. https://github.com/liblouis/louis-py - From Rust: `cargo add louis-rs`, API docs on https://docs.rs/louis-rs
- On the command line, which is useful to table authors whatever you translate with:
cargo install louis-cli
`louis check-table` compiles a table like `lou_checktable`, `louis check` runs YAML tests, and `louis trace` shows which rule produced each cell:
$ export LOUIS_TABLE_PATH=/usr/share/liblouis/tables
$ louis trace en-us-g2.ctb
> It’s about the blind
⠠⠭⠄⠎⠀⠁⠃⠀⠮⠀⠃⠇
┌───┬───────┬─────┬─────────────────┬───────┐
│ │ From │ To │ Rule │ Stage │
├───┼───────┼─────┼─────────────────┼───────┤
│ 1 │ │ ⠠ │ capsletter ⠠ │ Main │
│ 2 │ it’s │ ⠭⠄⠎ │ word it’s ⠭⠄⠎ │ Main │
│ 3 │ │ ⠀ │ space ⠀ │ Main │
│ 4 │ about │ ⠁⠃ │ word about ⠁⠃ │ Main │
│ 5 │ │ ⠀ │ space ⠀ │ Main │
│ 6 │ the │ ⠮ │ largesign the ⠮ │ Main │
│ 7 │ │ ⠀ │ space ⠀ │ Main │
│ 8 │ blind │ ⠃⠇ │ word blind ⠃⠇ │ Main │
└───┴───────┴─────┴─────────────────┴───────┘
New since 0.3:
- What a screen reader needs from liblouis: the `partialTrans`, `compbrlAtCursor`, `compbrlLeftCursor` and `noContractions` modes, back-translation that returns emphasis (liblouis’s typeform output), and braille encodings other than Unicode braille, read from liblouis display tables.
- Speed: several times faster for tables with many `match`, `context` or multipass rules.
- A stable footing: the library API follows semantic versioning, and the CLI is its own crate, `louis-cli`, so the library no longer pulls in its dependencies.
The full list is in the changelog.
Before you switch: every place where louis-rs deliberately does something other than liblouis is written down, together with how to get the output you had, so you can see in a few minutes whether any of it affects you:
https://github.com/liblouis/louis-rs/blob/main/doc/Differences_From_Liblouis.md
Rust and Python are covered today; programs that link `liblouis.so` directly will need a C API, which is planned.
Where it’s headed: the goal is for louis-rs to replace liblouis eventually. Reports from people using it are what will get it there.
Repository: https://github.com/liblouis/louis-rs
Changelog: https://github.com/liblouis/louis-rs/blob/main/CHANGELOG.md
Parity report: https://github.com/liblouis/louis-rs/blob/main/doc/Liblouis_Parity.md
LGPL-2.1-or-later.