• Stars
    star
    431
  • Rank 100,866 (Top 2 %)
  • Language
    Elixir
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gradient is a static typechecker for Elixir

Gradient

Build Status

Gradient is a gradual typechecker for Elixir.

Gradual typing is a bit like static typing, because it provides error messages if your code has types and specs - and any errors, obviously. Gradual typing is also a bit like dynamic typing, because it doesn't require all the functions to have specs and just agrees when you say: "Trust me, I'm a (software) engineer!"

Gradient relies on Gradualizer as the actual typechecker, but aims to make jumping the hoops between your Elixir code and the Erlang abstract syntax tree that Gradualizer works on effortless.

Usage

Gradient can be installed by adding gradient to your list of dependencies in mix.exs:

def deps do
  [
    {:gradient, github: "esl/gradient", only: [:dev], runtime: false}
  ]
end

Gradient comes with a Mix task that runs the typechecker on an Elixir project:

mix gradient

And presents errors in Elixir syntax.

Here is an example with some errors:

Result of app with errors

And here is an example of an application that has no issues:

Result of app without errors

Also, did we mention the analysis process is lightning fast?

Speed of analyzing app with errors

The examples/ folder contains example applications showing how the produced error messages look like.

Ignore warnings

It's possible to ignore specific warnings by adding a .gradient_ignore.exs in a project root folder.

.gradient_ignore.exs should contain a list of ignore rules:

  [
    # Ignores all errors in a file
    "lib/ecto/changeset.ex",

    # Ignores errors in a specific line in a file
    "lib/ecto/schema.ex:55",

    # Ignores all files that match a regex
    ~r|lib/ecto/.*|,

    # Ignores an error kind in a file
    {"lib/ecto/changeset.ex", {:spec_error, :no_spec}},

    # Ignores an error kind in a specific line
    {"lib/ecto/changeset.ex:55", {:spec_error, :no_spec}},

    # Ignores an error kind in all files
    {:spec_error, :no_spec}
  ]

Caveats

Gradient is experimental! Please use it and let us know how it feels. We're especially looking for code snippets where it doesn't work the way you'd expect it to, together with an explanation of what's happening and what's expected. Together, we can make it robust and convenient to work with, so that we all feel more productive!

More Repositories

1

MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Erlang
1,660
star
2

erlang-handbook

A concise reference for Erlang
TeX
296
star
3

erlang_ale

Erlang Actor Library for Embedded -- An embedded framework from Erlang Solutions
C
208
star
4

escalus

An XMPP client library in Erlang for conveniently testing XMPP servers
Erlang
127
star
5

lhttpc

lhttpc is a lightweight HTTP/1.1 client implemented in Erlang.
Erlang
127
star
6

MongooseICE

STUN/TURN server written in Elixir
Elixir
118
star
7

MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Elixir
108
star
8

elarm

Erlang
102
star
9

amoc

A load-testing framework for running massively parallel tests
Erlang
96
star
10

ex_rabbit_pool

RabbitMQ connection pooling in Elixir
Elixir
73
star
11

erlang-web

Erlang
50
star
12

parcv

Computer vision demo running on the parallella board
C
38
star
13

mangosta-android

MongooseIM client for Android
Java
31
star
14

mangosta-ios

MongooseIM client for iOS
Swift
30
star
15

sparrow

iOS and Android push notifications for Elixir.
Elixir
30
star
16

mongooseim-docker

Shell
27
star
17

segmented_cache

Modern, performant, and extensible, Erlang in-memory cache
Erlang
27
star
18

ex_docker_build

docker build with support for bind mounts at build time via Docker Remote API
Elixir
25
star
19

ejabberd_tests

Erlang
23
star
20

flex

A simple Elixir InfluxDB client.
Elixir
20
star
21

erl_fuzzy_match

Erlang Fuzzy String Matcher
Erlang
18
star
22

lager_graylog

Lager is a standard logging tool for Erlang, this project crates lager formatter to output messages in gelf format and lager backend to send messages via UDP.
Erlang
17
star
23

arnold

Time series data forecasting tool made in Elixir using Axon library
Elixir
17
star
24

fast_scram

Fastest SCRAM's implementation for Erlang & OTP, aiming at performance and statelessness for ease-of-use
Erlang
17
star
25

tracerl

Dynamic tracing tests and utilities for Erlang/OTP
Erlang
17
star
26

cets

A library to synchronise records from the ETS tables between nodes
Erlang
15
star
27

jerboa

STUN/TURN encoder, decoder and client library in Elixir
Elixir
14
star
28

MongooseHelm

Helm chart definitions for the Mongoose stack (MongooseIM, MongoosePush)
Erlang
11
star
29

rebar3_codecov

A rebar3 plugin which converts .coverdata files to JSON format, compatible with
Erlang
11
star
30

elibcloud

Erlang wrapper for Libcloud
Erlang
10
star
31

packages

Makefile- and Docker-based build system for ESL's erlang and elixir binary packages.
Python
9
star
32

fast_pbkdf2

Erlang's best pbkdf2 implementation
C
9
star
33

rabbitmq-docker

Dockerfile
8
star
34

usec

Convert anything to microseconds and back.
Erlang
8
star
35

c3card

A workshop at CodeBEAM America 2024 showcasing custom hardware and Erlang-based firmware development using AtomVM.
Erlang
8
star
36

esl-rabbitmq-client

RabbitMQ Client for Erlang, built by ESL
Erlang
7
star
37

amoc-arsenal-xmpp

Erlang
7
star
38

erlang-osx-installer

Erlang Installer & Auto-Updater for macOS
Swift
6
star
39

buildex_api

Elixir
6
star
40

mongoose_jid

Erlang
5
star
41

movim-docker

Dockerfiles for movim application
Shell
5
star
42

jaguar

Elixir
5
star
43

wombat_discovery

Erlang
5
star
44

logger_graylog_backend

Elixir's Logger backend for Graylog
Elixir
5
star
45

opuntia

Opuntia is a basic set of tools for traffic shaping for erlang and elixir. Because if you touch it too fast, it stings you.
Erlang
5
star
46

gradient_macros

Slim Gradient compile-time support
Elixir
4
star
47

chirp_cockroach

Demo project: Chris McCord's Twitter clone with a CockroachDB backend
Elixir
4
star
48

buildex_jobs

Buildex service which receives and processes build instructions
Elixir
4
star
49

throttle

Experimental implementation of a simple throttle
Erlang
4
star
50

wombat-discovery

Plugin for Wombat to automatically add nodes
Elixir
4
star
51

buildex_poller

Buildex service which polls github (others to follow) and triggers builds via RabbitMQ
Elixir
4
star
52

release_poller

Elixir
4
star
53

base16

The last time I hexadecimify Erlang binaries...
Erlang
4
star
54

poc_tensorflow_mushrooms

Elixir
3
star
55

beam_olympics_nerves

Getting Beam Olympics to run on a Raspberry Pi through Nerves. Phoenix leaderboard included.
Erlang
3
star
56

erlang-plts

Pregenerated Dialyzer PLTs for a number of Erlang versions
Python
3
star
57

exometer_report_statsd

Erlang
3
star
58

seta

Work-stealing scheduler
JavaScript
3
star
59

ice_demo

Elixir
3
star
60

loadex

simple small open load generator
Elixir
2
star
61

MongooseDocs

Documentation for MongooseIM, in this repo's gh-pages: https://esl.github.io/MongooseDocs/latest/
HTML
2
star
62

buildex_ui

Buildex service which provides Oauth login and build configuration management
2
star
63

rabbitmq-queue-info

Makefile
2
star
64

gapp

Erlang
2
star
65

ex_github_poller

An elixir application to poll github repositories ... wip
Elixir
2
star
66

helm-chart

Shell
2
star
67

elarm_mailer

SMTP reporting for elarm
Erlang
2
star
68

Mercutio

Erlang
2
star
69

percacdat

Persistent Cached Data structures
Erlang
2
star
70

elixirconf-eu-jekyll

HTML
2
star
71

ice

Erlang
2
star
72

jekyll-codesync-global

jekyll version of codesync-global
SCSS
2
star
73

buildex_common

Modules shared by buildex projects
Elixir
2
star
74

cfg

Erlang
2
star
75

foo-phx-cowboy-2.6

phoenix 1.4 / cowboy-2.6 bootstrap project
Elixir
2
star
76

exometer_report_graphite

Erlang
2
star
77

mongooseim-ct-reports

Autogenerated repository for Common Tests reports. Used by MongooseIM team
JavaScript
2
star
78

bryan_cb_sf_2020_talk

bryan hunt codebeam talk
Makefile
2
star
79

amoc-swarm

Dockerfile
2
star
80

node-with-build-tools

node with build tools pre-installed
Dockerfile
2
star
81

release_tasks

Elixir
2
star
82

graphql-erlang

Erlang
2
star
83

amoc_rest

The generated server code for AMOC REST API
Erlang
2
star
84

elixometer

Elixir
2
star
85

observability

Examples for the Erlang and Elixir Observability tutorial
Erlang
1
star
86

jekyll-codesync-global-2

CSS
1
star
87

erlangusergroup

1
star
88

circleci-mim-results

JavaScript
1
star
89

sappan

Erlang
1
star
90

virtual-elixirconf-eu-jekyll

HTML
1
star
91

tanka-alpine

devops docker image with tanka, jsonnet, and jsonnet-package pre-installed
Dockerfile
1
star
92

ml-hackathon

Python
1
star
93

circleci-kubernetes-deployer

docker image with helm, kubectl, google cloud tools, etc baked in
Dockerfile
1
star
94

code-beam-america

HTML
1
star
95

plantproxy

Elixir
1
star
96

lambdadays-jekyll

convert lambdadays from custom webserver to jekyll
HTML
1
star