{"id":13723468,"url":"https://github.com/josefs/Gradualizer","last_synced_at":"2025-05-07T16:32:59.378Z","repository":{"id":27022253,"uuid":"108764455","full_name":"josefs/Gradualizer","owner":"josefs","description":"A Gradual type system for Erlang","archived":false,"fork":false,"pushed_at":"2024-10-11T15:30:20.000Z","size":4831,"stargazers_count":618,"open_issues_count":108,"forks_count":35,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-14T15:00:30.399Z","etag":null,"topics":["erlang","type-system","typesystem"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josefs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-29T19:30:20.000Z","updated_at":"2025-03-26T05:31:19.000Z","dependencies_parsed_at":"2024-04-18T12:46:33.900Z","dependency_job_id":"6e97272b-3765-424e-ae2b-c5b020618253","html_url":"https://github.com/josefs/Gradualizer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefs%2FGradualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefs%2FGradualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefs%2FGradualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josefs%2FGradualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josefs","download_url":"https://codeload.github.com/josefs/Gradualizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915568,"owners_count":21824599,"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":["erlang","type-system","typesystem"],"created_at":"2024-08-03T01:01:41.804Z","updated_at":"2025-05-07T16:32:54.368Z","avatar_url":"https://github.com/josefs.png","language":"Erlang","funding_links":[],"categories":["Erlang Specific","Erlang"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGradualizer: A Gradual Type System for Erlang\u003c/h1\u003e\n\u003ca href=\"https://github.com/josefs/Gradualizer/actions/workflows/build-and-test.yml\"\u003e\n  \u003cimg src=\"https://github.com/josefs/Gradualizer/actions/workflows/build-and-test.yml/badge.svg\"\n       alt=\"GitHub Actions Build and Test Status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://hex.pm/packages/gradualizer\"\u003e\n  \u003cimg src=\"https://img.shields.io/hexpm/v/gradualizer.svg\"\n       alt=\"Gradualizer on Hex.pm\" /\u003e\n\u003c/a\u003e\n\n\n## A type checker for Erlang\n\nGradualizer is a [_static type checker_][static-type-checker] for Erlang\nwith some support for [_gradual typing_][gradual-typing].\nA static type checker catches bugs before we run a program thanks to type analysis.\n\n[static-type-checker]: https://en.wikipedia.org/wiki/Type_system#Static_type_checking\n[gradual-typing]: https://wphomes.soic.indiana.edu/jsiek/what-is-gradual-typing/\n\nGradualizer aims to integrate well into existing Erlang code bases in a non intrusive way.\nIt does so by\n\n* having a type system that is based on the principles of Gradual Typing\n* using the existing Erlang type spec syntax\n* allowing for granular opting into type checking. Without any type specs, no static typing happens.\n  When type specs are added the program is checked against\n  these specs statically. The more type specs, the more static typing.\n\nA picture is worth more than a thousand words:\n\n[![](screenshots/exhaustive_type.png) ![](doc/screenshots/exhaustive_type.png)][examples]\n\n[examples]: https://github.com/josefs/Gradualizer/blob/master/doc/examples.md\n\n\n## Usage\n\n### Command line\n\nCompile the project as an escript. Then use it to check `.beam` files or `.erl` files.\nUse the `-h` / `--help` option for help.\n\n```\n$ make escript\n$ bin/gradualizer --help\nUsage: gradualizer [options] [PATH...]\nA type checker for Erlang/Elixir\n\n       PATH                      Files or directories to type check\n       --                        Signals that no more options will follow. The following\n                                 arguments are treated as filenames, even if\n                                 they start with hyphens.\n  -h,  --help                    display this help and exit\n       --infer                   Infer type information from literals and other\n                                 language constructs\n       --no_infer                Only use type information from function specs\n                                  - the default behaviour\n       --verbose                 Show what Gradualizer is doing\n  -pa, --path_add                Add the specified directory to the beginning of\n                                 the code path; see erl -pa             [string]\n  -I                             Include path for Erlang source files; see -I in\n                                 the manual page erlc(1)\n       --stop_on_first_error     stop type checking at the first error\n       --no_stop_on_first_error  inverse of --stop-on-first-error\n                                  - the default behaviour\n       --no_prelude              Do not override OTP specs.\n       --specs_override_dir      Add specs overrides from the *.specs.erl files in\n                                 this directory.\n       --fmt_location            How to format location when pretty printing errors\n                                 (Column is only available if analyzing from source)\n                                 - 'none': no location for easier comparison\n                                 - 'brief': for machine processing\n                                   (\"LINE:COLUMN:\" before message text)\n                                 - 'verbose' (default): for human readers\n                                   (\"on line LINE at column COLUMN\" within the message text)\n       --color [ COLOR ]         Use colors when printing fancy messages. An optional\n                                 argument is `always | never | auto'. However, auto-\n                                 detection of a TTY doesn't work when running as an escript.\n       --no_color                Alias for `--color never'\n       --fancy                   Use fancy error messages when possible (on by default)\n       --no_fancy                Don't use fancy error messages.\n       --union_size_limit        Performance hack: Unions larger than this value\n                                 are replaced by any() in normalization (default: 30)\n       --solve_constraints       Type check polymorphic calls (off by default)\n```\n\n\n### Rebar3\n\nTo run Gradualizer from rebar3, add it as a plugin in your `rebar.config`:\n\n```erlang\n{plugins, [\n  {gradualizer, {git, \"https://github.com/josefs/Gradualizer.git\", {branch, \"master\"}}}\n]}.\n```\n\nSee [examples/rebar3/README.md](examples/rebar3/README.md).\n\n\n### Elixir / Mix\n\nCheck out [Gradient](https://github.com/esl/gradient), the Elixir frontend to Gradualizer.\nIt provides a Mix task to use in your project:\n\n```elixir\ndef deps do\n  [\n    {:gradient, github: \"esl/gradient\", only: [:dev], runtime: false}\n  ]\nend\n```\n\n\n### Erlang shell\n\nLaunch the interactive prompt with all the relevant modules in the path.\nThen, use the functions in the `gradualizer` module:\n\n```\n$ make shell\n\n1\u003e gradualizer:type_check_file(\"path/to/some_file.erl\").\n```\n\nYou can also use the Rebar3 shell.\n\n\n### Prerequisites\n\nGradualizer requires at least OTP 21 and is built using plain OTP\nfunctionality and a self-contained Makefile.\nAlternatively, it can be built using [rebar3](https://www.rebar3.org/),\nas well as Mix if used as a dependency.\n\n\n## Status\n\nGradualizer is close to a beta release. Most of the Erlang language constructs and\ndata types are handled, although there are things that don't work yet.\nThat being said, pull requests are most welcome!\n\nA work-in-progress [Gradualizer manual](https://github.com/josefs/Gradualizer/wiki)\nis located on the wiki.\n\nFor a non-exhaustive list of known problems, see `test/known_problems/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosefs%2FGradualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosefs%2FGradualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosefs%2FGradualizer/lists"}