Skip to main content
Pre-release

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.2 — 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. Free-threaded CPython 3.14 (3.14t) gets its own wheel for the same platforms, and keeps the GIL off.

Not supported: PyPy, and free-threaded CPython 3.13 (3.13t)

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 .lark files 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 postlex pass, such as the bundled Indenter, covers indentation-sensitive languages.
  • Automatic tree construction. Use the Transformer / Visitor / Interpreter classes on the parse tree, or, with parser="lalr", hand the transformer to transformer= 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 from the built-in lexer, 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 17–23× on Earley.

Building a parser, including its first parse, is 8–10× faster than in lark.

hyperlark against sly and lark, on both engines

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 type, FastToken. As a consequence, tokens do not inherit from str. They do provide 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 few behaviors differ in detail. Terminal regexes that Python's re would read differently are refused when the parser is built. Lexer callbacks, the parser object's API, class identity under mixed lark + hyperlark imports and recursion inside your own callbacks also differ. See the full list of divergences.

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.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for hyperlark 0.1.0b2
File Actions
hyperlark-0.1.0b2-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for hyperlark-0.1.0b2-cp314-cp314t-win_amd64.whl
hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details for hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl
hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64 Details for hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_aarch64.whl
hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Details for hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64 Details for hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 13.0+ x86-64 Details for hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_x86_64.whl
hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64 Details for hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_arm64.whl
hyperlark-0.1.0b2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for hyperlark-0.1.0b2-cp310-abi3-win_amd64.whl
hyperlark-0.1.0b2-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for hyperlark-0.1.0b2-cp310-abi3-musllinux_1_2_x86_64.whl
hyperlark-0.1.0b2-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for hyperlark-0.1.0b2-cp310-abi3-musllinux_1_2_aarch64.whl
hyperlark-0.1.0b2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for hyperlark-0.1.0b2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hyperlark-0.1.0b2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for hyperlark-0.1.0b2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hyperlark-0.1.0b2-cp310-abi3-macosx_13_0_x86_64.whl CPython 3.10 abi3 macOS 13.0+ x86-64 Details for hyperlark-0.1.0b2-cp310-abi3-macosx_13_0_x86_64.whl
hyperlark-0.1.0b2-cp310-abi3-macosx_13_0_arm64.whl CPython 3.10 abi3 macOS 13.0+ ARM64 Details for hyperlark-0.1.0b2-cp310-abi3-macosx_13_0_arm64.whl

Total release size: 26.2 MB

Release files / hyperlark-0.1.0b2-cp314-cp314t-win_amd64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-win_amd64.whl
Size 1.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
2d6979036be6f75a7c56a930988de04b2ac4893a9d7e39cff975ce3195e853dc
BLAKE2b-256 checksum
How to use checksums
92cf045054ffa0ed0f8efea2d3b7c37bc259333e0f277d0a392900e63cdefd93
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.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 2.1 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
c5f5de52fea423f6e9cb10f45a786e173b10e03f7a4d9b0f0e59375fe1955a4d
BLAKE2b-256 checksum
How to use checksums
d0ac0786dffc2832a9853bdce04c963a71265b87352592f152ca4e0660871460
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.0b2-cp314-cp314t-musllinux_1_2_aarch64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-musllinux_1_2_aarch64.whl
Size 1.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64
SHA-256 checksum
How to use checksums
94fc9d66159960d70d5e4b33a182eebe4aaa7e8f8bc5df8ab516e1f98766f619
BLAKE2b-256 checksum
How to use checksums
ce8c9e2f9f50b3be2f0089d64c35675b79ffbcf9548b6bf46594da81ee024a8e
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.0b2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
50cb8f89e34d0e5b422eb0a5fbfc66cb7ab4517b852db3d3870881e472758a2f
BLAKE2b-256 checksum
How to use checksums
33c0c69f77fc3b888c7e9cd5c6cf88e769115a645edeb1554dc05e3ccfaf46f3
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.0b2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.8 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
f72826e8df5d51bd959d55c444ca061e52e8a96913f1895f689ebf88ce4635b3
BLAKE2b-256 checksum
How to use checksums
e044bd0ad93c9349d106a7a4e3034a5705e7594ca4b865fea48c63b359e675b1
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.0b2-cp314-cp314t-macosx_13_0_x86_64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_x86_64.whl
Size 1.8 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
3dc52364f79a0712b8808410a02f93c1ef9c7868dab1a604431443993ffd6d9c
BLAKE2b-256 checksum
How to use checksums
d1d244bbe1176263a03912345dd8c3a2067c6fcfb78687bff90055d082330c30
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.0b2-cp314-cp314t-macosx_13_0_arm64.whl

Download URL hyperlark-0.1.0b2-cp314-cp314t-macosx_13_0_arm64.whl
Size 1.7 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
65cc9e55335656a3d3a4c0eac7e64756959ae2295b3664b1045bfc971f241876
BLAKE2b-256 checksum
How to use checksums
b2467fbdc6937b0c5a500243ce0c2ada75c185d6b0712e1d73f7fb4a90385283
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.0b2-cp310-abi3-win_amd64.whl

Download URL hyperlark-0.1.0b2-cp310-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3ae7768007f1fa1305faf7fe7256e02c4ac774f1267dd74a464cf985d8b0b57b
BLAKE2b-256 checksum
How to use checksums
96f9152adf2d8c461cef9c50bc8f319179c87aa49d74269b0abc9fe2044d609c
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.0b2-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL hyperlark-0.1.0b2-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
c323ab29997c0214d67203b0f0d6702a3a65f8fb6bfe1e64885c8f174bbc230d
BLAKE2b-256 checksum
How to use checksums
f4abc9ce255e4a03412bddbd7ad8d53964dd10701ef4ee3665e94d3ee8839abf
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.0b2-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL hyperlark-0.1.0b2-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
e0172bbd4f9ba17ff4505c8a080cf488914355fcf092eba62ca025f852edebbc
BLAKE2b-256 checksum
How to use checksums
1b9870317623ffa086b0da1f249050947c7099312b65bf8e2257a7b2432ad8e3
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.0b2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hyperlark-0.1.0b2-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
0294c57a33534cf98180b6dd40cc6459e9cf700f5cd4ad882baf592c7b6e7c9c
BLAKE2b-256 checksum
How to use checksums
934f9276062172821351715297702e336a19264ee1b1ad37a5f6cbbda643a680
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.0b2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hyperlark-0.1.0b2-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
4e595f0ed83aaa5d886051c97890b1e83f5e6f5d3bc06501c0c3384693081677
BLAKE2b-256 checksum
How to use checksums
40c52192a9daebe852dcfccb138f26806259324588e1be1e61fad39bd5357b38
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.0b2-cp310-abi3-macosx_13_0_x86_64.whl

Download URL hyperlark-0.1.0b2-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
843904f927626f6aa6a2684b050742ec93986e58331adbeb58748f5af7649a7d
BLAKE2b-256 checksum
How to use checksums
5082b3b2961141bec91a069d267191f3c0fc1a8563f495a514d76adb01d54456
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.0b2-cp310-abi3-macosx_13_0_arm64.whl

Download URL hyperlark-0.1.0b2-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
14dcd7c43490be38f96b325e63e3679dfc8d2d0c502d11b0dcebe1bfd29d2529
BLAKE2b-256 checksum
How to use checksums
0fbb97439b12f58f815f10beb93d8ef2d1b4296cfcaeabc7a5962bb83f34bbcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Security for hyperlark 0.1.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page