4 ms·
Raw lisp is obviously very easy, not sure about the various schemes. OCaml, the whole SML family are easy to parse (just an LR grammar that is easy to copy). I
by Drup 10y ago
Raw lisp is obviously very easy, not sure about the various schemes.
OCaml, the whole SML family are easy to parse (just an LR grammar that is easy to copy). I think Rust is the same.
IIRC, Java is LL(k), so very easy.
C is not LR(1) for annoying reasons (typedef). Same for Go, IIRC. Otherwise, it's okayish.
Javascript has this inane "optional semicolon" thing, which probably makes it annoying.
C++ is probably the most insane thing to parse.
And then, there is bash[1].
http://www.oilshell.org/blog/2016/10/20.html http://www.oilshell.org/blog/2016/10/20.html
- steveklabnik 10y agoRust is 99% easy to parse, but there's one, rarely used, syntactic construct that's context-sensitive.
- saosebastiao 10y agoWhich one is that?
- steveklabnik 10y agoRaw string literals https://doc.rust-lang.org/stable/reference.html#raw-string-literals https://doc.rust-lang.org/stable/reference.html#raw-string-l... and raw byte string literals https://doc.rust-lang.org/stable/reference.html#raw-byte-string-literals https://doc.rust-lang.org/stable/reference.html#raw-byte-str... r"…", r#"…"#, r##"…"## br"…", br#"…"#, br##"…"## you need to count the #s.