This release is a pre-release and may not be stable for production use.
Hyperlark
Hyperlark is a Rust reimplementation of the Lark parsing toolkit, built with a focus on ergonomics, performance and modularity.
Hyperlark can parse all context-free languages. To put it simply, it means that it is capable of parsing almost any programming language out there, and to some degree most natural languages too.
Hyperlark implements the vast majority of Lark's features, and can often be used as a drop-in replacement, with none or very few code changes.
Status: 0.1.0-beta.1 — pre-1.0, APIs may still change between betas.
Install
pip install hyperlark
Wheels are CPython 3.10+ (stable-ABI, abi3), for Linux (glibc and musl,
x86-64 and aarch64), macOS 13+ (x86-64 and arm64) and Windows x64.
Not supported: PyPy, and free-threaded CPython (3.13t / 3.14t)
Hello World
import hyperlark
parser = hyperlark.Lark(r"""
start: WORD+
%import common.WORD
%ignore " "
""")
tree = parser.parse("hello world")
print(tree.pretty())
For complete, runnable programs — a calculator, JSON, an indentation-sensitive language, ambiguity, interactive parsing, error reporting — see the examples page.
Features
- An industry-standard grammar. Lark is widely used, its grammar syntax was
adopted by OpenAI for their official API, and
.larkfiles get syntax highlighting on GitHub. - Choose between LALR(1) and Earley (SPPF) parsers. LALR(1) is fast, linear-time and low on memory. Earley can parse every context-free grammar, and can efficiently handle and store every ambiguity, for later queries.
- Choose between several lexers, or provide your own. Hyperlark provides
sophisticated lexers that can help LALR(1) disambiguate tokens based on the
parser state, and that help Earley handle lexical ambiguities much faster than
scannerless methods. A
postlexpass, such as the bundledIndenter, covers indentation-sensitive languages. - Automatic tree construction. Use the
Transformer/Visitor/Interpreterclasses on the parse tree, or hand the transformer totransformer=to skip tree construction entirely. - Interactive parsing (for LALR). Drive the parser and query it at any point of the parse. Useful for error handling, checkpoints & backtracking, and even debugging.
- Line positions. Hyperlark keeps track of the line and column of every
token, and will even propagate the ranges to the tree nodes when
propagate_positions=True. - Grammar composition. Import rules, terminals, or entire grammars into your grammar, using an inheritance-like interface (namespaces, overrides), for better re-use and modularity.
Performance
10× lark engine for engine on LALR, and 16–22× on Earley.
Actual speed depends on grammar, input size and how Hyperlark is used.
For more information, see the benchmarks.
Differences from Lark
fast_tokens
To avoid creating a Python object for each token, Hyperlark uses its own Token
object. As a consequence, hyperlark.Token does not inherit from str. It does
provide some of the str methods (.upper(), .startswith(), …) for
convenience, but reach for .value wherever a real str is required.
This can be disabled with the fast_tokens=False option, which restores
Lark-identical str-subclass tokens everywhere, at some cost in performance.
Not implemented
The reconstructor, tree templates, the standalone tool, and TextSlice inputs.
These options are recognized but not supported. Each raises a clear
ConfigurationError at construction, rather than silently doing nothing:
| Option | Note |
|---|---|
strict= |
|
cache_grammar= |
cache= itself works |
use_bytes= |
|
edit_terminals= |
|
regex= |
the third-party regex module |
ambiguity='forest' |
'resolve' and 'explicit' work |
parser='cyk' |
'lalr' and 'earley' work |
parser=None |
Lark's lexer-only mode; build a parser and call .lex() |
Beyond these, a handful of behaviors differ in detail: lexer callbacks, the
parser object's surface, class identity under mixed lark + hyperlark
imports, and recursion inside your own callbacks. See the full
list of divergences.
Links
- Documentation — the grammar language, guides, and the API reference
- Lark — the API and grammar language Hyperlark reimplements
- Questions and bug reports: erezshin@gmail.com
- Commercial licensing: hyperlark@eshsoft.com
Hyperlark's source hasn't been published at this time.
License
Free for noncommercial use, including evaluation and testing inside commercial organizations. Commercial use requires a separate license — contact hyperlark@eshsoft.com.
Copyright © 2026 Esh Software LLC. Full text in the LICENSE file in the
distribution.
Metadata
Release files for hyperlark 0.1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hyperlark-0.1.0b1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_x86_64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ x86-64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_aarch64.whl | CPython 3.10 | abi3 | Linux musl 1.2+ ARM64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_x86_64.whl | CPython 3.10 | abi3 | macOS 13.0+ x86-64 | Details |
| hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_arm64.whl | CPython 3.10 | abi3 | macOS 13.0+ ARM64 | Details |
Total release size: 13.2 MB
Release files / hyperlark-0.1.0b1-cp310-abi3-win_amd64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
18e7f1438fad9256a7260aab808aeb7f90fef785c18570690ecc66b2996af21d
|
|
BLAKE2b-256 checksum How to use checksums |
30ebe85509d2073ae05f04c6cf41872f69e48a75a93f6ab6d44d1268253595e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a2c8968badc72da26e242451fa7d041699cce6b677d213e0327b1de099889df5
|
|
BLAKE2b-256 checksum How to use checksums |
4d35f5edba0156a6a1927b5295319542d21819e691065f721c9935c61b23267b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7482a274071107734593b249d1734eb931a7f88b14f4878546e1a166eb138913
|
|
BLAKE2b-256 checksum How to use checksums |
6076acfb9ed99c8ed66f00e5c33ae6e60e4585d7c12b7cafb11458b7a855da8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1647070dc462282f4a74f406a26ca5c1334f6406b5c6dc583f61b0e445ed4010
|
|
BLAKE2b-256 checksum How to use checksums |
eaafa34dd8952a04c44d1ccd2478319ceb9796f0e595c5a77d3cabe72a6cdcdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
347a6b43ea19042c7ff398e836233dea0872c2172f7470cca2207c4802cf437f
|
|
BLAKE2b-256 checksum How to use checksums |
11e08a60d671953bbfa6c6f621c8da472d07fd01687202a0cd4cd507f67e414c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_x86_64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 abi3 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
dabfaa6270a4c80636bd3735e52f2f38f4feff3d05f3f2b3b7a1be38205c64c0
|
|
BLAKE2b-256 checksum How to use checksums |
083ef2b8a405285d6246f246af818eeb5d39c17405c5749149501d050b7b11a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_arm64.whl
| Download URL | hyperlark-0.1.0b1-cp310-abi3-macosx_13_0_arm64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 abi3 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8aaa346e2e6fb8ba3ee007d1aaf9af16dee67e2a533f8c6c1515fb8bf385eed9
|
|
BLAKE2b-256 checksum How to use checksums |
e3121553158eaf8d7aa97e2a9407f43122aad5a5c4b6c0ef24b8225e324dcc40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|