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.3 — 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.0b3

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.0b3
File Actions
hyperlark-0.1.0b3-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for hyperlark-0.1.0b3-cp314-cp314t-win_amd64.whl
hyperlark-0.1.0b3-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.0b3-cp314-cp314t-musllinux_1_2_x86_64.whl
hyperlark-0.1.0b3-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.0b3-cp314-cp314t-musllinux_1_2_aarch64.whl
hyperlark-0.1.0b3-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.0b3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hyperlark-0.1.0b3-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.0b3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hyperlark-0.1.0b3-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.0b3-cp314-cp314t-macosx_13_0_x86_64.whl
hyperlark-0.1.0b3-cp314-cp314t-macosx_13_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64 Details for hyperlark-0.1.0b3-cp314-cp314t-macosx_13_0_arm64.whl
hyperlark-0.1.0b3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for hyperlark-0.1.0b3-cp310-abi3-win_amd64.whl
hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_x86_64.whl
hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_aarch64.whl
hyperlark-0.1.0b3-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.0b3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hyperlark-0.1.0b3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for hyperlark-0.1.0b3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_x86_64.whl CPython 3.10 abi3 macOS 13.0+ x86-64 Details for hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_x86_64.whl
hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_arm64.whl CPython 3.10 abi3 macOS 13.0+ ARM64 Details for hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_arm64.whl

Total release size: 26.4 MB

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

Download URL hyperlark-0.1.0b3-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
a2c04700552d5cfa1e87bcf5031b715f79ddaa253da700321daae551cf3973b3
BLAKE2b-256 checksum
How to use checksums
4c9be822b06d3ccb48e9686d4bccfcbf2acbfd001e948c8eaa05f8626306a693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL hyperlark-0.1.0b3-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
d0d3f68cc9a8da32dc88c632461d70e9f116326eefc557ff9cd50039540ba6d5
BLAKE2b-256 checksum
How to use checksums
f09ac8ddfef41fa4560ab2621d5cb3562232856ea0ce449ba2d75a961f7ac866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp314-cp314t-musllinux_1_2_aarch64.whl

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

Release files / hyperlark-0.1.0b3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hyperlark-0.1.0b3-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
cf634b5fdec63cdf4f1bf1a16b310520f5b23724ae9f31de218ddb09fde0bdef
BLAKE2b-256 checksum
How to use checksums
e4ed2149d105a4126129b522c41ea9cf897bf294bc8b80f14e0fff4fcd00f5d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hyperlark-0.1.0b3-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
8a6a71dbf0abe742c47f587e4b0abe3a08a97599dac0385cb4a1e3049e4a5fe7
BLAKE2b-256 checksum
How to use checksums
4bfd35ede533a5945c8e24fbe5187c23bdb7c345a2d111e55053c26268e520b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp314-cp314t-macosx_13_0_x86_64.whl

Download URL hyperlark-0.1.0b3-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
9b175a05675d7109c04022e413e77b7f56cc3556519ca7d59b3804ec0d4ec06b
BLAKE2b-256 checksum
How to use checksums
9f71b82e17e9bdb6bfd23ad027bc33152bd72af054b7dca72ae62fbb97c95244
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp314-cp314t-macosx_13_0_arm64.whl

Download URL hyperlark-0.1.0b3-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
5c705c5d653c8b84a8a317a2aed933e073a0d3b3611a25d5d5b25336e673e5c1
BLAKE2b-256 checksum
How to use checksums
7fc5fb7ae5fa03949b21655261da4de2c318bb33ed3b778d17911162ebdfe56b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-win_amd64.whl

Download URL hyperlark-0.1.0b3-cp310-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
04f063a7e8c21535305950845ff1acf2cc79937306f1d9e385b3c06c5569468d
BLAKE2b-256 checksum
How to use checksums
c75ad737e1aa80f8bcc6014f620e7fe8209b449a4f8a3673c043f3ec139c9450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL hyperlark-0.1.0b3-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
87a87a9393346f5d07e1f1dad63fb647fcacdd1ea0c6f46e6f100d0a55f6f6c5
BLAKE2b-256 checksum
How to use checksums
f0b0792606bfa241baafbe383df9e2a10a4e44bbfc26fc8506374f54a716e92f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL hyperlark-0.1.0b3-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.0 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
2f5c71c6b66c0fcb341419bc222593d666cbe3427ad2b93a4ebaf192d2a2307e
BLAKE2b-256 checksum
How to use checksums
3cb6d1def35cd5d9b46251194ea157ce2f6e7037f413f358a933a67e41b0d158
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hyperlark-0.1.0b3-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
944f55a35d588b1006f9b4d6ee41e6ecb79dbd174e05f63c8f96c18c616f7f0c
BLAKE2b-256 checksum
How to use checksums
c51c9b1aa339ea3de6021d4f90266a47a8c9fe3ef114892adbfcaebdeb34293d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hyperlark-0.1.0b3-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
efb896c46de6f1d722ba771a6c3553e8ac596bb7e71434b54b2cbb28a2e70a20
BLAKE2b-256 checksum
How to use checksums
256d4b452c27f6efb59a96bba7e90ae11690fb73faa6e65291fc0d13923a472e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_x86_64.whl

Download URL hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 abi3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
7abc6804efe61ae03cc9059f42c845a034813c78271185005268a33ffe363833
BLAKE2b-256 checksum
How to use checksums
06b8b52aab3d3f01beb7864ed1503307c93461d7f1979a0243089b88ebaf0438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hyperlark-0.1.0b3-cp310-abi3-macosx_13_0_arm64.whl

Download URL hyperlark-0.1.0b3-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
fd8dea3b29b63d2bed503cddd72ac849217add422938c17f7d69c2eb1ae27247
BLAKE2b-256 checksum
How to use checksums
fdd6b5418a1ce6a03d25dd6495511045986a15fcc5926ae3a4d014915b87cc07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hyperlark 0.1.0b3

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