Giter Club home page Giter Club logo

gradient's Introduction

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.

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!

gradient's People

Contributors

eksperimental avatar erszcz avatar fl4m3ph03n1x avatar kianmeng avatar luk-pau-es avatar premwoik avatar rodrigues avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.