tact icon indicating copy to clipboard operation
tact copied to clipboard

Docs: complete annotated grammar reference/spec from `grammar.gg`

Open novusnota opened this issue 2 years ago • 3 comments

Current grammar page doesn't bring much value, especially for those willing to work on Tact compiler development or related tooling.

The page should be moved to the Language → Reference section, and it should cover different parts of the official Tact grammar in Ohm with examples showcasing their usage in the language.

Now, it's possible to do it with syntax highlighting of Ohm code blocks thanks to the merged TextMate grammar for Ohm, brought from novusnota/vscode-ohm.

Reference links:

  • https://craftinginterpreters.com/appendix-i.html
  • https://c3-lang.org/references/docs/specification/

novusnota avatar Mar 01 '24 00:03 novusnota

Would be nice to render the grammar as BNF or EBNF. Being able to look at the language grammar is really valuable when you have to quickly learn a new language (a bunch of code snippets help a lot too, but a grammar in a standard form can save a lot of time).

As for the available grammars in different format, we should definitely document we have those in a different section about tooling. Basically, the Grammar page should only contain a standardized description of the Tact syntax and the concrete grammars like the one in the TextMate format or the Tree-Sitter grammar for Tact should be linked and described as tools.

anton-trunov avatar Mar 01 '24 08:03 anton-trunov

@verytactical you might want to look at it

anton-trunov avatar Dec 12 '24 08:12 anton-trunov

here's my VSCode extension to help with authoring TextMate grammars https://marketplace.visualstudio.com/items?itemName=RedCMD.tmlanguage-syntax-highlighter

RedCMD avatar Aug 15 '25 02:08 RedCMD