github/semantic

Created Feb 14, 2021 · View the github/semantic repository page

Parsing, analyzing, and comparing source code across many languages

Want this for your repo?

Render a free sample of any GitHub repo in seconds.

Visualize your own →

Contributors

42

Lines of Code

95,953

From

Jul 18, 2015

To

Nov 5, 2020

About github/semantic

Semantic is a Haskell library and command-line tool for parsing, analyzing, and comparing source code across multiple programming languages. It generates language-specific syntax types based on tree-sitter grammar definitions and can read source code from the filesystem or protocol buffer requests, then perform various analyses and render output in multiple formats.

The tool supports parsing and AST symbol extraction for a broad range of languages including Ruby, JavaScript, TypeScript, Python, Go, PHP, Java, JSON, JSX, TSX, CodeQL, and Haskell, with varying levels of feature completeness across languages. Some languages have partial support for advanced features like stack graphs, which are still under development. The project leverages sophisticated algorithms for code comparison and analysis, including Myers' difference algorithm, RWS-Diff for hierarchical data change detection, and advanced functional programming techniques like data types à la carte and definitional interpreters.

As of the repository's last update, GitHub has discontinued official support and maintenance, encouraging users to fork the code if they wish to continue development. The project requires GHC 8.10.1 and Cabal 3.0 at minimum and officially supports Unix systems only, though Docker images are available for other platforms. Development can be conducted using either Cabal or Bazel build systems, with unofficial Stack support available separately.

Share this video

More from github

See all →