Code Monkey home page Code Monkey logo

Comments (7)

OvermindDL1 avatar OvermindDL1 commented on August 29, 2024 2

Thanks @OvermindDL1! We're aware that self-gradualization doesn't work just yet. Indeed, we just recently celebrated that the gradualizer doesn't crash when run on itself.

I figured, it's mostly just for fun as well as it's a useful issue to have as a Target since I didn't see one otherwise. :-)

Since the gradualizer is not what you would call a typical Erlang program, I haven't made it a priority to get self-gradualization to work. I've focused on programs that most people write.

As has been learned by the Elixir's Dialyxir project, any possible type that is representable by the BEAM is indeed used in the wild far more often than you'd think, so even Gradualizer itself is still a 'usual' erlang program. :-)

from gradualizer.

josefs avatar josefs commented on August 29, 2024

Thanks @OvermindDL1! We're aware that self-gradualization doesn't work just yet. Indeed, we just recently celebrated that the gradualizer doesn't crash when run on itself.

Since the gradualizer is not what you would call a typical Erlang program, I haven't made it a priority to get self-gradualization to work. I've focused on programs that most people write.

That being said, we certainly want to make this work eventually. So thanks for opening this ticket.

from gradualizer.

Zalastax avatar Zalastax commented on August 29, 2024

Only partially fixed, right?

from gradualizer.

josefs avatar josefs commented on August 29, 2024

@Zalastax, indeed! The ticket was automatically closed by github. Thanks for reopening it.

from gradualizer.

zuiderkwast avatar zuiderkwast commented on August 29, 2024

It would nice to require that gradualizer doesn't crash when checking itself. Perhaps we can add that to the .travis file?

Sometimes these crashes are fixed but every now and then, we introduce new crashes. Currently, I get this crash:

$ make gradualize 
rebar3 escriptize
===> Verifying dependencies...
===> Compiling gradualizer
===> Building escript...
cp _build/default/bin/gradualizer .
./gradualizer -pa src/ src/*.erl
src/constraints.erl: The record field Cs#constraints.exist_vars on line 21 at column 58 is expected to have type set(Element) but it has type sets:set(string())
src/constraints.erl: The record field C1#constraints.exist_vars on line 50 at column 40 is expected to have type set(Element) but it has type sets:set(string())
src/gradualizer.erl: The variable Forms on line 52 at column 36 is expected to have type [erl_parse:abstract_form()] but it has type [erl_parse:abstract_form() | erl_parse:form_info()]
src/gradualizer.erl: The variable File on line 69 at column 29 is expected to have type file:filename() but it has type cover_compiled | non_existing | preloaded | [char()]
src/gradualizer.erl: The function filename:join on line {87,55} is expected to return atom() | [char()] | [char() | atom() | deep_list()] but it returns file:filename_all()
escript: exception error: no case clause matching false
  in function  typechecker:list_op_arg_types/2 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2529)
  in call from typechecker:type_check_list_op_in/6 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2506)
  in call from typechecker:type_check_expr_in/3 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 1962)
  in call from typechecker:check_clause/4 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 3024)
  in call from typechecker:'-check_clauses/4-fun-0-'/4 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2999)
  in call from lists:foldl/3 (lists.erl, line 1263)
  in call from typechecker:check_clauses/4 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2997)
  in call from typechecker:do_type_check_expr_in/3 (/home/viktor/repos/gradualizer/_build/default/lib/gradualizer/src/typechecker.erl, line 2179)
make: *** [Makefile:50: gradualize] Error 127

from gradualizer.

Zalastax avatar Zalastax commented on August 29, 2024

@zuiderkwast I can add that to the CI!

from gradualizer.

zuiderkwast avatar zuiderkwast commented on August 29, 2024

That's great @Zalastax ⭐ but before we merge that, we should fix the crash too I guess.

from gradualizer.

Related Issues (20)

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.