You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
This week I found myself digging through the code of c4, an implementation of C “in four functions”, by Robert Swierczek. I remember coming across c4 when it was released ten years ago. It got me excited: hey, C in four functions, that means it’s easy to understand right? That excitement turned into “oh, I see” as soon as I scrolled through the code. c4 is dense, barely commented, and, frankly, st
Regular, Recursive, Restricted Jun 4, 2024 A post/question about formal grammars, wherein I search for a good formalism for describing infix expressions. Problem statement: it’s hard to describe arithmetic expressions in a way that: declaratively captures the overall shape of expression, and has a clear precedence semantics Let’s start with the following grammar for arithmetic expressions: Expr =
Let me tell you why you should (nearly) never use PEG (parsing expression grammars). Nearly everything I will say applies to parser combinators (parsec in Haskell, nom in Rust), too. So, don't use PEG. Use CFGs (context-free grammars) instead. They are more natural. I feel that CFGs more naturally represent how we think. Thus when you have some language in your head and you try to write it down as
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く