semantic-source VS stack-graphs

Compare semantic-source vs stack-graphs and see what are their differences.

semantic-source

Parsing, analyzing, and comparing source code across many languages (by github)

stack-graphs

Rust implementation of stack graphs (by github)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
semantic-source stack-graphs
23 6
8,858 686
0.3% 7.4%
9.1 9.7
29 days ago 9 days ago
Haskell Rust
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

semantic-source

Posts with mentions or reviews of semantic-source. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-13.
  • The Meaning of Monad in MonadTrans
    2 projects | news.ycombinator.com | 13 Aug 2023
    One production example I know: GitHub code navigation is written in Haskell https://github.com/github/semantic
  • Semantic: Parsing, analyzing, and comparing source code across many languages
    1 project | news.ycombinator.com | 28 May 2023
  • How to Get Started with Tree-Sitter
    3 projects | news.ycombinator.com | 28 May 2023
    ah, easy. it's because support has not been added into https://github.com/github/semantic which is the tech that powers the GitHub UI. Adding support is pretty easy/mainly glue code [1] that imports the tree sitter API.

    [1] https://github.com/github/semantic/blob/793a876ae45d38a6bd17...

  • Scala community now has control over the official Scala grammar for tree-sitter 🎉
    3 projects | /r/scala | 3 Jan 2023
  • 2022 State of Haskell Survey
    6 projects | news.ycombinator.com | 3 Nov 2022
  • 11 Companies That Use Haskell in Production
    7 projects | dev.to | 4 May 2022
    GitHub used Haskell for implementing Semantic, a command-line tool for parsing, analyzing, and comparing source code.
  • What happened with GitHub's semantic project?
    3 projects | /r/haskell | 29 Jan 2022
    As far as engineering effort, you can read this GitHub comment for an overview of where we’d like to take the project in the future. The tl;dr here is that the open sum type view of the world made it very concise to fold over syntax trees (since such a view of data is ultimately unityped, recursion schemes Just Work), but the tradeoff thus associated—namely, that you have to parse a concrete syntax tree into an open-sum view (a complicated and painful-to-read process), that you can never really be sure how a given syntax tree is shaped, and that the types don’t help you nearly as much as they could—proved to be too onerous to deal with. Going forward, we’re generating syntax types from the AST once per target language, and working on an abstraction (probably via this generated code; I made five separate efforts at using Generics for this, and failed every time) that recovers at least some of the convenience of recursion schemes. It turns out that recursion schemes over a mutually recursive syntax tree—as pretty much every language’s syntax trees are, in practice—are pretty much an unsolved problem, especially when extended to languages like TypeScript, which have hundreds of different syntax nodes.
  • Stack Graphs
    6 projects | news.ycombinator.com | 9 Dec 2021
    Meanwhile their Tree-Sitter-based semantic parser[1] looks abandoned. There is even rotting for years pull request[2] adding support of the same stack graphs into it.

    [1] https://github.com/github/semantic

    [2] https://github.com/github/semantic/pull/535

  • Cardano relying on Haskell is not bad at all
    1 project | /r/cardano | 30 Nov 2021
    The semantic team at GitHub uses it for statically analyzing the dozens of languages that end up in GitHub repositories: https://github.com/github/semantic/blob/eaf13783838861fe5eb6cd46d59354774a8eb88d/docs/why-haskell.md
  • 7 Useful Tools Written in Haskell
    1 project | /r/functionalprogramming | 3 Nov 2021
    Yesterday I was looking for some examples of projects using tree-sitter (which is C) when I found GitHub's semantic, used to analyze and compare source code, and written in Haskell: https://github.com/github/semantic/

stack-graphs

Posts with mentions or reviews of stack-graphs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-10.
  • Code Search Is Hard
    13 projects | news.ycombinator.com | 10 Apr 2024
    https://github.com/pyjarrett/septum

    The hardest part about getting code search right imo is grabbing the right amount of surrounding context, which septum is aimed at solving on a per-file basis.

    Another one I'm surprised hasn't been mentioned is stack-graphs (https://github.com/github/stack-graphs), which tries to incrementally resolve symbolic relationships across the whole codebase. It powers github's cross-file precise indexing and conceptually makes a lot of sense, though I've struggled to get the open source version to work

  • Even the Pylint codebase uses Ruff
    8 projects | news.ycombinator.com | 5 Mar 2023
    [2]: https://github.com/github/stack-graphs
  • The technology behind GitHub’s new code search
    17 projects | news.ycombinator.com | 6 Feb 2023
    > It doesn't have the faintest idea where the name is defined, or if there's even a difference between a function name, a parameter name, or a word in a comment.

    I don't think what you are saying is actually true for stack-graphs[0][1].

    [0]: https://github.com/github/stack-graphs

    [1]: https://github.blog/2021-12-09-introducing-stack-graphs/

  • Should I be worried or not worried about Tree-sitter now that the Atom editor has been killed?
    3 projects | /r/neovim | 13 Jun 2022
    I think GitHub still has some use for tree-sitter. In this post it's mentioned that their new code navigation system is based on tree-sitter. In a more recent post they welcome contributers to add special code navigation queries to existing languages. You can find their public repository here if you want to follow along with any developments. Since their code navigation system relies heavily on tree-sitter I don't think it's going anywhere soon (fingers crossed).
  • What happened with GitHub's semantic project?
    3 projects | /r/haskell | 29 Jan 2022
    Which they implement in Rust. https://github.com/github/stack-graphs
  • Stack Graphs
    6 projects | news.ycombinator.com | 9 Dec 2021
    As mentioned elsewhere on this thread, stack graphs and Semantic were built by the same team (which I manage). Semantic is not abandoned, we've just been focusing on a different layer of our tech stack for the past year or so. https://news.ycombinator.com/item?id=29501389

    That PR on the Semantic repo was our first attempt at implementing these ideas. We decided to reimplement it in a separate library (also open source, https://github.com/github/stack-graphs), which only builds on tree-sitter directly so that there's an easier story for us and language communities to add support for new languages. It's a fair point that we could have closed the Semantic PR to indicate that more clearly.

What are some alternatives?

When comparing semantic-source and stack-graphs you can also consider the following projects:

diffsitter - A tree-sitter based AST difftool to get meaningful semantic diffs

kickstart.nvim - A launch point for your personal nvim configuration

massiv - Efficient Haskell Arrays featuring Parallel computation

nvim-lspconfig - Quickstart configs for Nvim LSP

refined - Refinement types with static checking

scip-zig - SCIP indexer for Zig!

cantor-pairing - Convert data to and from a natural number representation

pagefind - Static low-bandwidth search at scale

Glean - System for collecting, deriving and working with facts about source code.

nvim-ts-context-commentstring - Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.

jump - Jump start your Haskell development

lsif-clang - Language Server Indexing Format (LSIF) generator for C, C++ and Objective C