{"id":13451761,"url":"https://github.com/github/semantic","last_synced_at":"2025-04-08T17:04:47.925Z","repository":{"id":37545856,"uuid":"175839913","full_name":"github/semantic","owner":"github","description":"Parsing, analyzing, and comparing source code across many languages","archived":false,"fork":false,"pushed_at":"2025-03-31T19:21:39.000Z","size":34515,"stargazers_count":9031,"open_issues_count":117,"forks_count":453,"subscribers_count":430,"default_branch":"main","last_synced_at":"2025-04-01T16:13:17.914Z","etag":null,"topics":["keep"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-15T14:54:00.000Z","updated_at":"2025-04-01T07:36:46.000Z","dependencies_parsed_at":"2024-12-02T14:13:59.765Z","dependency_job_id":null,"html_url":"https://github.com/github/semantic","commit_stats":{"total_commits":30222,"total_committers":51,"mean_commits":592.5882352941177,"dds":0.6874793197008802,"last_synced_commit":"ad281b52e3a399ff88126e3d06063c48eb245135"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fsemantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fsemantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fsemantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fsemantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/semantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247888556,"owners_count":21013001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keep"],"created_at":"2024-07-31T07:01:01.616Z","updated_at":"2025-04-08T17:04:47.920Z","avatar_url":"https://github.com/github.png","language":"Haskell","readme":"**NOTE**: _This repository is no longer supported or updated by GitHub. If you wish to continue to develop this code yourself, we recommend you fork it._\n\n# Semantic\n\n`semantic` is a Haskell library and command line tool for parsing, analyzing, and comparing source code.\n\nIn a hurry? Check out our documentation of [example uses for the `semantic` command line tool](docs/examples.md).\n\n| Table of Contents |\n| :------------- |\n| [Usage](#usage) |\n| [Language support](#language-support) |\n| [Development](#development) |\n| [Technology and architecture](#technology-and-architecture) |\n| [Licensing](#licensing) |\n\n## Usage\n\nRun `semantic --help` for complete list of up-to-date options.\n\n#### Parse\n```\nUsage: semantic parse [--sexpression | (--json-symbols|--symbols) |\n                        --proto-symbols | --show | --quiet] [FILES...]\n  Generate parse trees for path(s)\n\nAvailable options:\n  --sexpression            Output s-expression parse trees (default)\n  --json-symbols,--symbols Output JSON symbol list\n  --proto-symbols          Output protobufs symbol list\n  --show                   Output using the Show instance (debug only, format\n                           subject to change without notice)\n  --quiet                  Don't produce output, but show timing stats\n  -h,--help                Show this help text\n   ```\n\n## Language support\n\n| Language       | Parse | AST Symbols† | Stack graphs |\n| :------------- | :---: | :---:        | :---:        |\n| Ruby           | ✅    | ✅           | |\n| JavaScript     | ✅    | ✅           | |\n| TypeScript     | ✅    | ✅           | 🚧 |\n| Python         | ✅    | ✅           | 🚧 |\n| Go             | ✅    | ✅           | |\n| PHP            | ✅    | ✅           | |\n| Java           | 🚧    | ✅           | |\n| JSON           | ✅    | ⬜️           | ⬜️ |\n| JSX            | ✅    | ✅           | |\n| TSX            | ✅    | ✅           | |\n| CodeQL         | ✅    | ✅           | |\n| Haskell        | 🚧    | 🚧           | |\n\n† Used for [code navigation](https://help.github.com/en/github/managing-files-in-a-repository/navigating-code-on-github) on github.com.\n* ✅ — Supported\n* 🔶 — Partial support\n* 🚧 — Under development\n* ⬜ - N/A ️\n\n\n## Development\n\n`semantic` requires at least GHC 8.10.1 and Cabal 3.0. We strongly recommend using [`ghcup`][ghcup] to sandbox GHC versions, as GHC packages installed through your OS's package manager may not install statically-linked versions of the GHC boot libraries. `semantic` currently builds only on Unix systems; users of other operating systems may wish to use the [Docker images](https://github.com/github/semantic/packages/11609).\n\nWe use `cabal's` [Nix-style local builds][nix] for development. To get started quickly:\n\n```bash\ngit clone git@github.com:github/semantic.git\ncd semantic\nscript/bootstrap\ncabal v2-build all\ncabal v2-run semantic:test\ncabal v2-run semantic:semantic -- --help\n```\n\nYou can also use the [Bazel](https://bazel.build) build system for development. To learn more about Bazel and why it might give you a better development experience, check the [build documentation](docs/build.md).\n\n``` bash\ngit clone git@github.com:github/semantic.git\ncd semantic\nscript/bootstrap-bazel\nbazel build //...\n```\n\n\n `stack` as a build tool is not officially supported; there is [unofficial `stack.yaml` support](https://github.com/jkachmar/semantic-stack-yaml) available, though we cannot make guarantees as to its stability.\n\n[nix]: https://cabal.readthedocs.io/en/3.4/nix-local-build-overview.html\n[ghcup]: https://www.haskell.org/ghcup/\n\n## Technology and architecture\n\nArchitecturally, `semantic`:\n1. Generates per-language Haskell syntax types based on [tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar definitions.\n2. Reads blobs from a filesystem or provided via a protocol buffer request.\n3. Returns blobs or performs analysis.\n4. Renders output in one of many supported formats.\n\nThroughout its lifecycle, `semantic` has leveraged a number of interesting algorithms and techniques, including:\n\n- Myers' algorithm (SES) as described in the paper [*An O(ND) Difference Algorithm and Its Variations*][SES]\n- RWS as described in the paper [*RWS-Diff: Flexible and Efficient Change Detection in Hierarchical Data*][RWS].\n- Open unions and [data types à la carte](https://www.cambridge.org/core/journals/journal-of-functional-programming/article/data-types-a-la-carte/14416CB20C4637164EA9F77097909409).\n- An implementation of [Abstracting Definitional Interpreters][adi] extended to work with an à la carte representation of syntax terms.\n\n[SES]: http://www.xmailserver.org/diff2.pdf\n[RWS]: https://db.in.tum.de/~finis/papers/RWS-Diff.pdf\n[adi]: https://plum-umd.github.io/abstracting-definitional-interpreters/\n[tree-sitter]: https://github.com/tree-sitter/tree-sitter\n\n## Contributions\n\nContributions are welcome!  Please see our [contribution\nguidelines](CONTRIBUTING.md) and our [code of conduct](CODE_OF_CONDUCT.md) for\ndetails on how to participate in our community.\n\n## Licensing\n\nSemantic is licensed under the [MIT license](semantic/LICENSE).\n","funding_links":[],"categories":["Haskell","Industrial Strength NLP","Misc","AutoML NLP","Semantics","others","\u003ca name=\"Haskell\"\u003e\u003c/a\u003eHaskell"],"sub_categories":["Databases"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fsemantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fsemantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fsemantic/lists"}