Get the latest tech news

Use context-free grammars instead of parser combinators and PEG


Rust, Linux, programming languages, type systems

First of all, let me introduce one method not mentioned in the Jesper's article: randomly generated globally unique identifiers for all bound variables! As I mentioned above, de Bruijn indices fail to satisfy this criteria: if want to modify (or even inspect) subterm, located deeply inside another term, you need to make O(NM) operations. LoNaUniqueability to perform capture-avoiding substitution for lambda-terms in more or less sane wayYesYesany variable is always encoded sameNoYesno need to came up with artificial numbering of variablesNoYesability to perform trivial copy of terms without restrictionsYesNono need for external method for generating IDsYesNobasic operations have no more than linear complexityNoYesOkay, what we should choose?

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Context

Context

Photo of free grammars

free grammars

Photo of parser combinators

parser combinators

Related news:

News photo

How to Train a Million Context LLM

News photo

Rootless Docker in a multi-user environment

News photo

Google’s AI Studio adds adjustable video frame extraction, context caching