semantic-source
Glean
semantic-source | Glean | |
---|---|---|
23 | 20 | |
8,933 | 928 | |
0.2% | 1.1% | |
8.9 | 9.8 | |
about 2 months ago | 3 days ago | |
Haskell | Hack | |
MIT License | GNU General Public License v3.0 or later |
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
-
The Meaning of Monad in MonadTrans
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
-
How to Get Started with Tree-Sitter
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 🎉
- 2022 State of Haskell Survey
-
11 Companies That Use Haskell in Production
GitHub used Haskell for implementing Semantic, a command-line tool for parsing, analyzing, and comparing source code.
-
What happened with GitHub's semantic project?
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
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
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
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/
Glean
-
LSP: The Good, the Bad, and the Ugly
I've responded on reddit before (https://www.reddit.com/r/rust/comments/1eqqwa7/comment/lhwwn...), but I'll restate and cover some other things here.
> I have a maybe wrong and bad opinion that LSP is actually at the wrong level. Right now every language needs to implement a from scratch implementation of their LSP server. These implementations are HUGE and take YEARS to develop. rust-analyzer is over 365,000 lines of code. And every language has their own massive, independent implementation.
rust-analyzer a big codebase, but it's also less problematic than the raw numbers would make you think. rust-analyzer has a bunch of advanced functionality (term search https://github.com/rust-lang/rust-analyzer/pull/16092 and refactors), assists (nearly 20% of rust-analyzer!) and tests.
> I think there should be a common Intellisense Database file format for providing LSP or LSP-like capabilities. Ok sure there will still be per-language work to be done to implement the IDB format.
I think you might be describing formats like (https://code.visualstudio.com/blogs/2019/02/19/lsif) and SCIP (https://github.com/sourcegraph/scip). I personally like SCIP a bit more LSIF because SCIP's design makes it substantially easier to incrementally update a large index. We use SCIP with Glean (https://glean.software/) at work; it's pretty nice.
> But you'd get like 95% of the implementation for free for any LLVM language. And generating a common IDB format should be a lot simpler than implementing a kajillion LSP protocols.
I wouldn't say 95%. SCIP/LSIF can do the job for navigation, but that's only a subset of what you want from an IDE. For example:
-
Is Meta decommissioning Sigma?
Even if it is true (which is an unsubstantiated gossip at the moment), Sigma is not the only Haskell project at Facebook. See https://github.com/facebookincubator/Glean for another example.
- Glean – System for collecting, deriving and querying facts about source code
-
Codebase as Database: Turning the IDE Inside Out with Datalog
Meta uses something very much like this in production. It’s open sourced at https://glean.software/
- Knows/Knows anyone that understands how to build a code indexer ala Intellisense
-
11 Companies That Use Haskell in Production
Glean, a system for collecting and working with facts about source code.
- Facebook open sources Glean, its scalable code search and query engine
- Facebook Is Down
-
Is there a tool that would allow me to query (structured search) a codebase?
Glean was recently open sourced, it might fit your needs - https://glean.software/
What are some alternatives?
diffsitter - A tree-sitter based AST difftool to get meaningful semantic diffs
livegrep - Interactively grep source code. Source for http://livegrep.com/
massiv - Efficient Haskell Arrays featuring Parallel computation
opengrok - OpenGrok is a fast and usable source code search and cross reference engine, written in Java
refined - Refinement types with static checking
zoekt - Fast trigram based code search
cantor-pairing - Convert data to and from a natural number representation
Glean - System for collecting, deriving and working with facts about source code.
jump - Jump start your Haskell development
linguist - Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
critbit - A Haskell implementation of crit-bit trees.
codesearch - Fast, indexed regexp search over large file trees