s
Aug. 13, 2023, 9:50 p.m. |

Simon Willison's Weblog simonwillison.net

Lark parsing library JSON tutorial


A very convincing tutorial for a new-to-me parsing library for Python called Lark.

The tutorial covers building a full JSON parser from scratch, which ends up being just 19 lines of grammar definition code and 15 lines for the transformer to turn that tree in the final JSON.

It then gets into the details of optimization - the default Earley algorithm is quite slow, but swapping that out for a LALR parser (a one-line change) …

building code compilers definition grammar json library parsing python transformer tree tutorial

Software Engineer for AI Training Data (School Specific)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Python)

@ G2i Inc | Remote

Software Engineer for AI Training Data (Tier 2)

@ G2i Inc | Remote

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US