Giter Site home page Giter Site logo

dwango / fialyzer Goto Github PK

View Code? Open in Web Editor NEW
56.0 6.0 8.0 2.01 MB

[WIP] Faster Implementation of Dialyzer

Home Page: https://dwango.github.io/fialyzer/

License: Apache License 2.0

Makefile 0.42% OCaml 94.01% Standard ML 2.10% Shell 0.40% Erlang 3.06%
erlang type-checker

fialyzer's Introduction

fialyzer

CircleCI

Faster Implementation of Dialyzer

How to Use

Using Docker

docker run --rm -v $(pwd):/home/opam/fialyzer yoshihiro503/fialyzer --plt <plt_file> <beam_files>

Commandline Options

Option Description
--plt <plt_file> Use the specified plt as the initial plt (optional)
--debug Print debug logs (optional)
--help Display this list of options

How to Build (for developers)

Prerequisite

  • ocaml-4.07.0 or higher
  • opam-2.0.0 or higher
  • GMP
  • Perl
  • odoc (optional, for make odoc)
  • Erlang/OTP (optional, for make test)
  • Docker (optional, for make pdf)

Build

# If you prefer to use per-package environment, do:
$ opam switch create fialyzer ocaml-base-compiler.4.07.1
$ eval $(opam env)

# Clone repo:
$ git clone [email protected]:dwango/fialyzer.git
$ cd fialyzer

# Install dependencies:
$ opam pin add -y fialyzer .

# Build package:
$ make

fialyzer's People

Contributors

amutake avatar cedretaber avatar yoshihiro503 avatar youxkei avatar yuezato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fialyzer's Issues

Plt: erl_type: support BinaryTag type

Read PLT file and take BinaryTag types generated from following type contracts:

-spec foo() -> binary().
-spec bar() -> bitstring().
-spec baz(<<_:M, _:_*N>>) -> ok.

Support match expr

ref: #78

Pattern = Expression form is called match expression and = operator is called match operator.
(NOTICE: case E of ... end is case expression, not match expression)

but match expr is so crazy...

Erlang/OTP 21 [erts-10.1.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Eshell V10.1.3  (abort with ^G)
1> {A, B} = {1, [Z = 2]}, Z.
2

blackbox tests with PLT

Currently, it cannot specify PLT file to run blackbox-tests.
We have to make it possible to specify PLT file because PLT is needed to test various codes.

Refactor AST-related things

Decided in the previous fialyzer weekly meeting.

  • Rename ast_intf.ml to ast.ml
    • expr, spec_fun, decl_fun, module_,
  • Create type.ml
    • Move typ and constraint (constraint_)

constraint solver

introduce the solve function:

type sol = (type_var, typ) Map.t
val solve : sol -> constraint_ -> sol Result.t

MFA should be record

Currently, the data constructor MFA is defined as follows:

type expr =
   ...
    | MFA of expr * expr * expr

However, using 3-tuple of expr is not good for readability. So, I think that it should be:

type expr =
     | MFA of { module_name: expr, function_name: expr, arity: expr }

How do you think? @yoshihiro503 @amutake

Plt module

Abstract

introduce Plt module that treat dialyzer plt file.

type t
val from_file : filename -> (t, exn) Result.t

Related link

  • dialyzer_plt.erl
  • abstract_term_format

Show line number (Constant, Var)

Currenlty, fialyzer doesn't show line number. To do so, Ast.expr should have line number.
At first, add line number support for Constant and Var.

PatStruct should be supported

Currently, ast_intf.ml has PatStruct of string list * expr, which means struct pattern. However, it cannot be implemented since it seems that obeam doesn't support such pattern currently.

Support list expression

Add two variants to Ast_intf.expr

  • ListNil
  • ListCons of expr * expr

and fix conversions From_erlang.expr_of_erlang_expr

  • string literal should be ListCons or ListNil
  • [] shold be ListNil
  • [<expr> | <expr>] and [<expr>, ...] shold be ListCons

Don't support:

  • list patterns
  • list comprehension expression

type derivation

introduce the function:

val derive : context -> expr -> (constraint * type) Result.t

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.