GitHub

CodeGen: Semantic's improved language support system

Aug 4, 2020Ayman Nadeem
CodeGen: Semantic's improved language support system
SummaryAI, from the source post

This post details the introduction of CodeGen, a new language support system for GitHub's Semantic code analysis platform. It addresses the challenges of the previous system, including brittleness, lack of named child nodes in tree-sitter grammars, sub-optimal evaluation machinery with à la carte sum types, and the infeasible time and effort required for manual grammar and assignment writing. The new system introduces modifications to the tree-sitter library to add named child nodes (`field` API), generates a `node-types.json` file from grammars to provide AST structure, and uses Template Haskell to auto-generate language-specific syntax datatypes, significantly reducing manual effort and improving robustness.