I still can't make my mind up about using lists for representing syntax. It's great for macros, but ASTs often need more (eg line numbers).
miniblog.
Related Posts
Writing type params with <> (e.g. List<Int>) seems the most natural to me: probably because I encountered that syntax first.
Between C++, Java and TypeScript I think it's the most common too.
List[Int] seems to be next most common (Scala, Python) but TIL Gleam uses List(Int)!
I'm super impressed by how many lint rules can be implemented with just eslint's no-restricted-syntax and selectors. Example:
{
selector: "ExportNamedDeclaration[declaration=null][source=null]",
message: "Add `export` directly to the function instead of a block export."
}
Should lint suppressions be first class syntax or comments?
Adding a proper metadata system (e.g. Clojure or Rust) is a big design space but it's clear which expressions are affected.
Comments are much easier to implement but it's easy for users to get them wrong.
Thoughts?