Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lark-cython

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-cython

A Lark plugin that optimizes LALR parsing using Cython

  • 0.0.16
  • PyPI
  • Socket score

Maintainers
1

Lark-Cython

Cython plugin for Lark, reimplementing the LALR parser & lexer for better performance on CPython.

Install:

pip install lark-cython

Usage:

import lark_cython

parser = Lark(grammar, parser="lalr", _plugins=lark_cython.plugins)

# Use Lark as you usually would, with a huge performance boost

See the examples for more.

Differences from Lark

  • Token instances do not inherit from str. You must use the value attribute to get the string.

Other caveats

  • Postlexer isn't currently implemented

Speed

In current benchmarks, lark-cython is about 50% to 80% faster than Lark.

We're still in the early stages, and in the future, lark-cython might go a lot faster.

Other

License: MIT

Author: Erez Shinan

Special thanks goes to Datafold for commissioning the draft for lark-cython, and allowing me to release it as open-source.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc