[erlang-questions] dialyzer working with lfe, joxa, et. al?

26 views
Skip to first unread message

Raoul Duke

unread,
Mar 7, 2013, 12:10:21 PM3/7/13
to erlang-questions
fingers still crossed... :-)
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Robert Virding

unread,
Mar 7, 2013, 12:48:46 PM3/7/13
to Raoul Duke, erlang-questions
Keep them crossed. :-) It's definitely not impossible, it "just" needs the dialyzer people to implement hooks to which we (LFE, Joxa, ...) can write plugins. It that were to happen I might even add type specifications to LFE.

Robert

Loïc Hoguin

unread,
Mar 7, 2013, 1:04:46 PM3/7/13
to Robert Virding, erlang-questions
You just need to add different debugging information to the beam
(typespecs + Core Erlang), and Dialyzer just needs to read that if it
can't find Erlang AST. Dialyzer do most of its work on Core Erlang code
already, it (correct if I'm wrong) only uses the Erlang AST to extract
typespec information.

Shouldn't be a patch too difficult to write, just needs time.
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu

Raoul Duke

unread,
Mar 7, 2013, 1:18:18 PM3/7/13
to erlang-questions
> Shouldn't be a patch too difficult to write, just needs time.

is there anybody on this list who can do it + will do it? :-) i don't
know jack about any of this! (nor do i have any free time :-)

Kostis Sagonas

unread,
Mar 7, 2013, 4:50:05 PM3/7/13
to erlang-questions
On 03/07/2013 06:48 PM, Robert Virding wrote:
> Keep them crossed. :-) It's definitely not impossible, it "just" needs the dialyzer people to implement hooks to which we (LFE, Joxa, ...) can write plugins. It that were to happen I might even add type specifications to LFE.

Even disregarding for the moment the question why would "the dialyzer
people" care about lfe, joxa, et al., (dialyzer: Discrepancy Analyzer of
*Erlang* code) if you are not more specific than the above wish how
exactly do you expect them to know about the details of possible hooks
that are needed by non-standard uses of dialyzer by other more exotic
languages out there?

Better yet, dialyzer's code base is on github, and thus one can submit
patches (hint, hint!) that have a very good chance of being included in
its code base if they do not break dialyzer's current functionality and
come with tests that ensure that the extra functionality will not be
accidentally broken in the future.

Cheers,
Kostis

Robert Virding

unread,
Mar 9, 2013, 7:57:45 PM3/9/13
to Kostis Sagonas, erlang-questions
> From: "Kostis Sagonas" <kos...@cs.ntua.gr>
>
> On 03/07/2013 06:48 PM, Robert Virding wrote:
> > Keep them crossed. :-) It's definitely not impossible, it "just"
> > needs the dialyzer people to implement hooks to which we (LFE,
> > Joxa, ...) can write plugins. It that were to happen I might even
> > add type specifications to LFE.
>
> Even disregarding for the moment the question why would "the dialyzer
> people" care about lfe, joxa, et al., (dialyzer: Discrepancy Analyzer
> of
> *Erlang* code) if you are not more specific than the above wish how
> exactly do you expect them to know about the details of possible
> hooks
> that are needed by non-standard uses of dialyzer by other more exotic
> languages out there?

Well, if you want to be really strict then dialyzer works on *Core erlang* code. This is what dialyzer means by Erlang. So in this sense anything which generates Core erlang is *erlang* code from dialyzer's point of view. Whether it be LFE, Joxa, Elixir or whatever.

> Better yet, dialyzer's code base is on github, and thus one can
> submit
> patches (hint, hint!) that have a very good chance of being included
> in
> its code base if they do not break dialyzer's current functionality
> and
> come with tests that ensure that the extra functionality will not be
> accidentally broken in the future.

To be practical the people working with dialyzer could restructure it's input phase to use plugins based on file extension much faster than anyone else. Using it on erlang code would then just be another plugin, but one that is provided with dialyzer.

Robert

Kostis Sagonas

unread,
Mar 10, 2013, 6:17:45 AM3/10/13
to Robert Virding, erlang-questions
On 03/10/2013 01:57 AM, Robert Virding wrote:
>> From: "Kostis Sagonas"<kos...@cs.ntua.gr>
>>
>> On 03/07/2013 06:48 PM, Robert Virding wrote:
>>> Keep them crossed. :-) It's definitely not impossible, it "just"
>>> needs the dialyzer people to implement hooks to which we (LFE,
>>> Joxa, ...) can write plugins. It that were to happen I might even
>>> add type specifications to LFE.
>>
>> Even disregarding for the moment the question why would "the dialyzer
>> people" care about lfe, joxa, et al., (dialyzer: Discrepancy Analyzer
>> of
>> *Erlang* code) if you are not more specific than the above wish how
>> exactly do you expect them to know about the details of possible
>> hooks
>> that are needed by non-standard uses of dialyzer by other more exotic
>> languages out there?
>
> Well, if you want to be really strict then dialyzer works on *Core erlang* code. This is what dialyzer means by Erlang.

No, it's not. Just because dialyzer does its analysis on Core Erlang,
this does not mean that it was ever designed to analyze languages other
than Erlang.

I grant you that dialyzer's analysis is in principle applicable to other
languages that compile to Core Erlang, but I think that my previous mail
makes it clear that I also think that the responsibility for doing any
changes that are required lies with the developers of languages who are
interested in having such a tool for their language.

It's probably irrational to expect that non-users of a language care
about the tools that are available for it more than the community of
that language, isn't it?

Kostis

Robert Virding

unread,
Mar 11, 2013, 9:20:40 AM3/11/13
to Kostis Sagonas, erlang-questions
As I see it there are two separate parts to making dialyzer be able to handle other languages:

1. Modify dialyzer to be able to handle language specific plugins.
2. Write the language specific plugins.

It is clearly not the dialyzer implementor's job to do 2., that should be left to the various language implementers. But 1. need only be done once if it done properly and generically. It is 1. which I mean would be better if the dialyzer implementers did it as it only needs doing once and they would do it much faster and better than anyone else.

That was all.

Robert

----- Original Message -----
Reply all
Reply to author
Forward
0 new messages