Comments (6)
Now, I haven't tried to type check any Elixir programs myself. But from what I understand it is already possible to typecheck quite a few programs although there are a few wrinkles that need to be sorted out for full Elixir support. Don't take my work for it though.
I've done it, it works well enough sans Gradualizer is still missing some types but those are being added over time. :-)
I've been waiting for someone to make a mix plugin to use Gradualizer, then you could do it all at once and built-in'ish, I might get around to it sometime when I get some free time. :-)
from gradualizer.
@jeremyowensboggs I made a mix plugin at: https://github.com/overminddl1/gradualixir
That error means that you didn't link in the Elixir library location (-pa .../path/to/elixir/ebin
).
I plan to PR my plugin here sometime, just not got around to it yet, way busy in real life. ^.^;
from gradualizer.
People have already experimented with running the Gradualizer on Elixir programs! The way we can currently support this is as follows: beam files compiled with the debug_info flag includes an "abstract form" of the program, which Gradualizer can use as a basis for typechecking. As luck would have it, the Elixir compiler includes the abstract form when compiling programs. So the Gradualizer can easily be run on beam files originating from Elixir programs.
Now, I haven't tried to type check any Elixir programs myself. But from what I understand it is already possible to typecheck quite a few programs although there are a few wrinkles that need to be sorted out for full Elixir support. Don't take my work for it though.
I'd love to see people trying out Gradualizer for Elixir and reporting any success and/or problems they have. Ideally, also submitting patches to fix any encountered problems. Unfortunately, I don't have any bandwidth to work on Elixir support and the main contributors are focused on finalizing typechecking for Erlang so that we can make a beta release. But I'd be happy to have people contribute Elixir support as well.
from gradualizer.
Makes sense! Is there an option for languages such as LFE? It compiles to Core directly and I believe do not have the same abstract form as Erlang and Elixir as a result.
from gradualizer.
I've not actually checked about LFE, @rvirding would be the one to ask there, but from my understanding the abstract form's should be the same for everything that compiles to the BEAM via any method as long as they add in the debug chunk (which I'm not sure if LFE does, but I would expect it to do so considering LFE is made by @rvirding?).
from gradualizer.
@OvermindDL1 How did you get it running with Elixir? I have it compiled, but when I try to use it my elixir directory, I get:
~/d/blaster2 (BV2-66-display-on-screen-for-technical-issues)> ../Gradualizer/gradualizer _build/dev/lib/blaster/ebin/Elixir.Blaster.Cart.beam
escript: exception error: undefined function elixir_erl:debug_info/4
in function beam_lib:chunks_to_data/7 (beam_lib.erl, line 652)
in call from beam_lib:read_chunk_data/3 (beam_lib.erl, line 521)
in call from beam_lib:read_chunk_data/2 (beam_lib.erl, line 509)
in call from gradualizer_file_utils:get_forms_from_beam/1 (/Users/jowens/dev/Gradualizer/_build/default/lib/gradualizer/src/gradualizer_file_utils.erl, line 36)
in call from gradualizer:type_check_file/2 (/Users/jowens/dev/Gradualizer/_build/default/lib/gradualizer/src/gradualizer.erl, line 40)
in call from gradualizer:'-type_check_files/2-fun-0-'/4 (/Users/jowens/dev/Gradualizer/_build/default/lib/gradualizer/src/gradualizer.erl, line 99)
in call from lists:foldl/3 (lists.erl, line 1263)
from gradualizer.
Related Issues (20)
- Refine bound vars with guards
- Uncaught case clause error #{'Value' => {type,0,tuple,any}} HOT 1
- Keep track of variable bindings & types HOT 5
- Crash with Uncaught error: function_clause HOT 6
- Crash with `Uncaught error: {case_clause, ..` in `typechecker:do_type_check_expr/2`
- Crash with Uncaught error: {badkey, ...} HOT 1
- No clause for gradualizer_lib:pick_value(module()) HOT 2
- No clause of gradualizer_lib:pick_value(any()) HOT 2
- Support the new dynamic() type
- `ok bsr ok` crashes erl_eval:do_apply/7 HOT 4
- An invalid utf32 value can crash eval_bits:eval_exp_field/6
- Crash in gradualizer_fmt:format_type_error: no function_clause_matching
- Crash in typechecker:do_type_check_expr_in/3: bad_key in map_get/2
- Invalid polymorphic code accepted HOT 2
- Support old-style 'catch' keyword HOT 5
- Wrong type in receive...after Timeout
- `binary_to_atom/1` breaks compatibility below OTP 23 HOT 4
- Solving local constraints at each function call to a polymorphic function HOT 6
- support for OTP 26 map comprehensions
- Wrong type location reported?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradualizer.