Skip to content
Ben Samuel edited this page Jul 6, 2020 · 12 revisions

Ideas for new backends

Python

It doesn't seem that there is a canonical tool such as lex/yacc in python. A list of parsing tools is available on the python wiki.

Scala

Issue

Rust

Issue

K-framework

Pandoc

We could replace those backend by a pandoc backend. This has a few advantages:

  • it can generate more formats
  • pandoc-types provide a nice API to create documents programatically
  • we don't have to maintain a latex backend and a plain text backend separately

Javascript

  • Jison is a port of flex/yacc in javascript so it might not be so hard to derive a javascript backend from the C one
  • pegjs
  • Canopy, which can also generate python, java and ruby frontends.

BNF variants

Go

Go comes with a port of yacc which should make adding this fairly easy. There is no flex/lex equivalent though.

The Lemon program is an LALR(1) parser generator. It takes a context free grammar and converts it into a subroutine that will parse a file using that grammar. Wikipedia

The Tree-sitter project generates a C library for incremental parsing that has bindings in Rust, JavaScript via Wasm, Node.js, Python, Ruby and Haskell.

Use case: Implementing IDE plugins and other build tools that watch files and react incrementally to changes.

Clone this wiki locally