5 ms·
My understanding is (from your twitch stream), that the type system will initially be obscured from developers. I guess this means it's going to hook into the e
by bongobingo1 3y ago
My understanding is (from your twitch stream), that the type system will initially be obscured from developers. I guess this means it's going to hook into the existing `type` and `spec` features of elixir?
Do you think we'll end up writing
$ integer() -> integer()
@spec inc(integer) :: integer()
def inc(i), do: i + 1
or can the new type system be entirely expressed in `@spec` (perhaps with a slightly upgraded syntax), or perhaps we'll have the choice of @spec or $ (or @spec2.0, whatever).
Additionally, do you feel there is any chance/desire/need of this bleeding up into Erlang? I can only assume the work done mapping the type system onto elixir would not require as much work to then map to Erlang if there were any interest.
- anne_biene 3y agoThere is interest from the Erlang community. Etylizer is a set-theoretic type checker developed for Erlang. We have different objectives, though, as we try to remain backwards compatible with the existing type specs. https://arxiv.org/pdf/2302.12783.pdf https://arxiv.org/pdf/2302.12783.pdf
- manusachi 3y agoAFAIR, it should be possible to convert dialyzer specs to that new type system annotations. It would probably be not as precise, but could be a good enough starting point to then gradually make them more precise
- josevalim 3y agoInitially we will only leverage information from pattern matching and guards. There are no plans to leverage typespecs for now (as someone said below, they likely won't be as precise). And yes, the semantics should map 100% cleanly to Erlang.