A subtyping system for Erlang

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

A subtyping system for Erlang

Sven-Olof Nystr|m-2

Hello,

I would like to announce a type system for Erlang.

This type system offers guarantees for safety; a program that types
should not fail (at least, it should not fail with a type
error). Typing a program requires specifications and declarations of
visible functions and visible data types.

As Erlang data structures such as lists and tuples cannot be modified
at run-time it is a good fit to base the type system on
*subtyping*. Among other advantages, subtyping allows some values to
be typed as the universal type.

The implementation is written in Erlang. It uses a modified Erlang
parser to process Erlang modules extended with function specifications
and type declarations. The type system can type itself, of course.


Below follows two examples of modules that type:

-module(example1).

-compile(export_all).

%: +type list(X) = [] + [X|list(X)].

%: +func append :: list(X) * list(X) -> !list(X).
append([A | B], C) ->
    [A | append(B, C)];
append([], C) -> C.


%: +func dup :: list(integer()) -> !list(!integer()).
dup(S) ->
    append(S, S).

The module starts with a declaration of the recursive parametric data
type "list". This is followed by a specification and a definition of
the recursive function append. The function "dup" is only specified
for lists of integers (but that can be changed). The exclamation marks
force the type system to check that something interested is returned
by the functions.

Let's take a look at a less orthodox example. This example gives a
hint of what the type system can express, even though it is perhaps
not very practical:

-module(tsil).

-compile(export_all).

%: +type tsil(X) = [tsil(X)|X] + [].
%: +func dneppa :: tsil(X) * tsil(X) -> tsil(X).

dneppa([], L) ->
    L;
dneppa([L1|X], L2) ->
    [ dneppa(L1, L2) | X].

%: +type list(X) = [X|list(X)] + [].
%: +func from_list :: list(X) -> tsil(X).
from_list([]) ->
    [];
from_list([X|L]) ->
    [from_list(L)|X].


%: +func to_list :: tsil(X) -> list(X).
to_list([]) ->
    [];
to_list([L|X]) ->
    [X|to_list(L)].

"tsil" is of course "list" backwards. "dneppa" concatenates two
"tsil"s. Included are also functions that convert between "tsil"s and
lists, just to show that the type system can reason about combinations
of types that use the same data type constructors in different ways.


Currently there is not much documentation of the system available,
beside what I have written here and the README file that comes with
the source. The download page also contains some paper that describe
the theory.

Download:
http://user.it.uu.se/~svenolof/scfa/


yours,

Sven-Olof Nyström



--
Sven-Olof Nystrom
Comp Sci Dept, Uppsala University, Box 337, S-751 05 Uppsala SWEDEN
[hidden email]

 
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Sven-Olof Nystr|m-2
Łukasz Niemier writes:
 > Out of curiosity, why this is using custom type specification
 > format? What are type specs lacking to work with that type checker?
 > --
 >
 > Łukasz Niemier [hidden email]

The short answer is that the Dialyzer specifications did not contain
the information I needed.

Consider for example the specification of the foldl function in the
lists module:

-spec foldl(Fun, Acc0, List) -> Acc1 when
      Fun :: fun((Elem :: T, AccIn) -> AccOut),
      Acc0 :: term(),
      Acc1 :: term(),
      AccIn :: term(),
      AccOut :: term(),
      List :: [T],
      T :: term().

foldl(F, Accu, [Hd|Tail]) ->
    foldl(F, F(Hd, Accu), Tail);
foldl(F, Accu, []) when is_function(F, 2) -> Accu.

Note that the type of Acc0 (second argument) is set to any term. I
wanted (and needed) a more specific specification so that I could give
a warning for programs that would have a type error at run:

+func foldl :: (X*V -> V)*V*list(X) -> V.

According to this specification, the accumulator must be the of the
same type as the second argument as the function parameter.

There are also other reasons. I wanted to have user-defined recursive
data types. Since the one you see everywhere is the list type I wanted
to make that one user-defined.



Sven-Olof



Sven-Olof Nystrom
Comp Sci Dept, Uppsala University, Box 337, S-751 05 Uppsala SWEDEN
[hidden email]

 
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Edmond Begumisa
In reply to this post by Sven-Olof Nystr|m-2
Hello,

This looks appetizing and quite a feat.

So I'm following the README instructions. Everything compiled fine.  
However, when I try to run the tests I get the a bunch of errors of the  
form "File operation error: ebadf. Target: ./con.beam. Function: get_file.  
Process: code_server" as shown in full shell output below.

I get similar error output with the bad tests and when type checking the  
type checker.

Any ideas?

Thanks in advance.

- Edmond -

OUTPUT >>>>

Erlang/OTP 21 [erts-10.3] [smp:4:4] [ds:4:4:10] [async-threads:1]

Eshell V10.3  (abort with ^G)
1> code:add_path("../ebin/").
true
2> c("../test/test_scfa.erl").
../test/test_scfa.erl:3: Warning: export_all flag enabled - all functions  
will be exported
{ok,test_scfa}
3> test_scfa:good(["../test/good"]).

Test g004
Specs: 1
Constraints: 7=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: ./con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/kernel-6.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/stdlib-3.8/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/xmerl-1.3.19/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/wx-1.8.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/tools-3.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/tftp-1.0.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/syntax_tools-2.1.7/ebin/con.beam. Function: get_file.  
Process: code_server.
** exception error: undefined function con:variance/2
      in function  reach:right_reachable_support/4 (reach.erl, line 169)
      in call from reach:right_reachable_supports/4 (reach.erl, line 165)
      in call from reach:reachability/2 (reach.erl, line 83)
      in call from reach:simplifyx/3 (reach.erl, line 25)
      in call from poly:solve_and_simplify/2 (poly.erl, line 152)
      in call from poly:collapse_dag/4 (poly.erl, line 122)
      in call from poly:check_fnid_list/3 (poly.erl, line 82)
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ssl-9.2/ebin/con.beam. Function: get_file. Process:  
code_server.
4> =ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ssh-4.7.4/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/snmp-5.2.12/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/sasl-3.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/runtime_tools-1.13.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/reltool-0.7.8/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/public_key-1.6.5/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/parsetools-2.1.8/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/otp_mibs-1.2.1/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/os_mon-2.4.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/odbc-2.12.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/observer-2.9/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/mnesia-4.15.6/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/megaco-3.18.4/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/jinterface-1.9.1/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/inets-7.0.6/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/hipe-3.18.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ftp-1.0.2/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/eunit-2.3.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/et-1.6.4/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erts-10.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erl_interface-3.11/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erl_docgen-0.9/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/eldap-1.2.6/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/edoc-0.10/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/diameter-2.2/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/dialyzer-3.3.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/debugger-4.2.6/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/crypto-4.4.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/compiler-7.3.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/common_test-1.17/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/asn1-5.0.8/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: ../ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: con.beam. Function: get_file.  
Process: code_server.




On Fri, 11 Oct 2019 19:11:55 +1000, Sven-Olof Nystrom <[hidden email]>  
wrote:

>
> Hello,
>
> I would like to announce a type system for Erlang.
>
> This type system offers guarantees for safety; a program that types
> should not fail (at least, it should not fail with a type
> error). Typing a program requires specifications and declarations of
> visible functions and visible data types.
>
> As Erlang data structures such as lists and tuples cannot be modified
> at run-time it is a good fit to base the type system on
> *subtyping*. Among other advantages, subtyping allows some values to
> be typed as the universal type.
>
> The implementation is written in Erlang. It uses a modified Erlang
> parser to process Erlang modules extended with function specifications
> and type declarations. The type system can type itself, of course.
>
>
> Below follows two examples of modules that type:
>
> -module(example1).
>
> -compile(export_all).
>
> %: +type list(X) = [] + [X|list(X)].
>
> %: +func append :: list(X) * list(X) -> !list(X).
> append([A | B], C) ->
>     [A | append(B, C)];
> append([], C) -> C.
>
>
> %: +func dup :: list(integer()) -> !list(!integer()).
> dup(S) ->
>     append(S, S).
>
> The module starts with a declaration of the recursive parametric data
> type "list". This is followed by a specification and a definition of
> the recursive function append. The function "dup" is only specified
> for lists of integers (but that can be changed). The exclamation marks
> force the type system to check that something interested is returned
> by the functions.
>
> Let's take a look at a less orthodox example. This example gives a
> hint of what the type system can express, even though it is perhaps
> not very practical:
>
> -module(tsil).
>
> -compile(export_all).
>
> %: +type tsil(X) = [tsil(X)|X] + [].
> %: +func dneppa :: tsil(X) * tsil(X) -> tsil(X).
>
> dneppa([], L) ->
>     L;
> dneppa([L1|X], L2) ->
>     [ dneppa(L1, L2) | X].
>
> %: +type list(X) = [X|list(X)] + [].
> %: +func from_list :: list(X) -> tsil(X).
> from_list([]) ->
>     [];
> from_list([X|L]) ->
>     [from_list(L)|X].
>
>
> %: +func to_list :: tsil(X) -> list(X).
> to_list([]) ->
>     [];
> to_list([L|X]) ->
>     [X|to_list(L)].
>
> "tsil" is of course "list" backwards. "dneppa" concatenates two
> "tsil"s. Included are also functions that convert between "tsil"s and
> lists, just to show that the type system can reason about combinations
> of types that use the same data type constructors in different ways.
>
>
> Currently there is not much documentation of the system available,
> beside what I have written here and the README file that comes with
> the source. The download page also contains some paper that describe
> the theory.
>
> Download:
> http://user.it.uu.se/~svenolof/scfa/
>
>
> yours,
>
> Sven-Olof Nyström
>
>
>


--
Using Opera's mail client: http://www.opera.com/mail/
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Sven-Olof Nystr|m-2
Edmond Begumisa writes:
 > Hello,
 >
 > This looks appetizing and quite a feat.
 >
 > So I'm following the README instructions. Everything compiled fine.
 > However, when I try to run the tests I get the a bunch of errors of
 > the form "File operation error: ebadf. Target:
 > ./con.beam. Function: get_file.  Process: code_server" as shown in
 > full shell output below.
 >
 > I get similar error output with the bad tests and when type
 > checking the type checker.
 >
 > Any ideas?
 >
 > Thanks in advance.
 >

Sorry, I have not come across this error.

In the Erlang documentation I see:

Typical error reasons:

ebadf
The file is not opened for reading.

> 3> test_scfa:good(["../test/good"]).
>
> Test g004
> Specs: 1
> Constraints: 7=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
> File operation error: ebadf. Target: ./con.beam. Function: get_file.  
> Process: code_server.


Not sure what is going on here. The system could read the test program
(g004.erl) from file, parse it and generate constraints. There should
not be any file IO after that. And there is no reason (for the
program) to read the file con.beam (I suppose the compiler has already
loaded con.beam).

> =ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
> File operation error: ebadf. Target: c:/Program Files  
> (x86)/erl10.3/lib/syntax_tools-2.1.7/ebin/con.beam. Function: get_file.  
> Process: code_server.
> ** exception error: undefined function con:variance/2
>       in function  reach:right_reachable_support/4 (reach.erl, line 169)
>       in call from reach:right_reachable_supports/4 (reach.erl, line 165)
>       in call from reach:reachability/2 (reach.erl, line 83)
>       in call from reach:simplifyx/3 (reach.erl, line 25)
>       in call from poly:solve_and_simplify/2 (poly.erl, line 152)
>       in call from poly:collapse_dag/4 (poly.erl, line 122)
>       in call from poly:check_fnid_list/3 (poly.erl, line 82)

The subtyping system contains a module con.erl. If the name conflicts
with some module in the standard library, I could rename it. But as
far as I can tell, there is no module con.erl in the library
"syntax_tools".


Sven-Olof




--
Sven-Olof Nystrom
Comp Sci Dept, Uppsala University, Box 337, S-751 05 Uppsala SWEDEN
[hidden email]

 
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Björn Gustavsson-4
On Fri, Oct 11, 2019 at 2:15 PM Sven-Olof Nystrom <[hidden email]> wrote:
>
> The subtyping system contains a module con.erl. If the name conflicts
> with some module in the standard library, I could rename it. But as
> far as I can tell, there is no module con.erl in the library
> "syntax_tools".

On Windows, CON is the reserved named for the console. Since file
names are case insensitive, "con" also refers to the console, as does
"con" with any extension. Thus, "con.beam" is a reference to the
console. You should rename your module.

/Björn


--
Björn Gustavsson, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Edmond Begumisa
Thanks Björn and Sven,

Indeed, I looked again and found that make compiled all files except  
con.beam (there's no ../ebin/con.beam --  I should have noticed that  
before, although make should have at least failed with an error instead of  
silently skipping over that target). And like Björn said, from the shell...

>>>

7> make:files(["con.erl"], [{outdir,"../ebin"}]).
Recompile: con
con.erl: bad file number
error

>>>

The previous errors make perfect sense now. It's the code server crashing  
when trying to find con.beam in all the code paths because of the reserved  
name.

- Edmond -

On Fri, 11 Oct 2019 22:29:48 +1000, Björn Gustavsson <[hidden email]>  
wrote:

> On Fri, Oct 11, 2019 at 2:15 PM Sven-Olof Nystrom <[hidden email]>  
> wrote:
>>
>> The subtyping system contains a module con.erl. If the name conflicts
>> with some module in the standard library, I could rename it. But as
>> far as I can tell, there is no module con.erl in the library
>> "syntax_tools".
>
> On Windows, CON is the reserved named for the console. Since file
> names are case insensitive, "con" also refers to the console, as does
> "con" with any extension. Thus, "con.beam" is a reference to the
> console. You should rename your module.
>
> /Björn
>
>


--
Using Opera's mail client: http://www.opera.com/mail/
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Edmond Begumisa
On Fri, 11 Oct 2019 22:40:04 +1000, Edmond Begumisa  
<[hidden email]> wrote:

> Thanks Björn and Sven,
>
> Indeed, I looked again and found that make compiled all files except  
> con.beam (there's no ../ebin/con.beam --  I should have noticed that  
> before, although make should have at least failed with an error instead

Or rather, erlc should have ...

> of silently skipping over that target). And like Björn said, from the  
> shell...
>
>>>>
>
> 7> make:files(["con.erl"], [{outdir,"../ebin"}]).
> Recompile: con
> con.erl: bad file number
> error
>
>>>>
>
> The previous errors make perfect sense now. It's the code server  
> crashing when trying to find con.beam in all the code paths because of  
> the reserved name.
>
> - Edmond -
>
> On Fri, 11 Oct 2019 22:29:48 +1000, Björn Gustavsson <[hidden email]>  
> wrote:
>
>> On Fri, Oct 11, 2019 at 2:15 PM Sven-Olof Nystrom <[hidden email]>  
>> wrote:
>>>
>>> The subtyping system contains a module con.erl. If the name conflicts
>>> with some module in the standard library, I could rename it. But as
>>> far as I can tell, there is no module con.erl in the library
>>> "syntax_tools".
>>
>> On Windows, CON is the reserved named for the console. Since file
>> names are case insensitive, "con" also refers to the console, as does
>> "con" with any extension. Thus, "con.beam" is a reference to the
>> console. You should rename your module.
>>
>> /Björn
>>
>>
>
>


--
Using Opera's mail client: http://www.opera.com/mail/
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Sven-Olof Nystr|m-2
In reply to this post by Björn Gustavsson-4
Björn Gustavsson writes:
 > On Fri, Oct 11, 2019 at 2:15 PM Sven-Olof Nystrom
 > <[hidden email]> wrote:
 > >
 > > The subtyping system contains a module con.erl. If the name
 > > conflicts with some module in the standard library, I could
 > > rename it. But as far as I can tell, there is no module con.erl
 > > in the library "syntax_tools".
 >
 > On Windows, CON is the reserved named for the console. Since file
 > names are case insensitive, "con" also refers to the console, as
 > does "con" with any extension. Thus, "con.beam" is a reference to
 > the console. You should rename your module.

Thanks. I have made a new version available.

Edmond Begumisa writes:
 > Indeed, I looked again and found that make compiled all files except  
 > con.beam (there's no ../ebin/con.beam --  I should have noticed that  
 > before, although make should have at least failed with an error instead of  
 > silently skipping over that target). And like Björn said, from the shell...

Sorry about the problems.


Sven-Olof

--
Sven-Olof Nystrom
Comp Sci Dept, Uppsala University, Box 337, S-751 05 Uppsala SWEDEN
[hidden email]

 
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: A subtyping system for Erlang

Edmond Begumisa
On Fri, 11 Oct 2019 23:02:02 +1000, Sven-Olof Nystrom <[hidden email]>  
wrote:

> Björn Gustavsson writes:
>  > On Fri, Oct 11, 2019 at 2:15 PM Sven-Olof Nystrom
>  > <[hidden email]> wrote:
>  > >
>  > > The subtyping system contains a module con.erl. If the name
>  > > conflicts with some module in the standard library, I could
>  > > rename it. But as far as I can tell, there is no module con.erl
>  > > in the library "syntax_tools".
>  >
>  > On Windows, CON is the reserved named for the console. Since file
>  > names are case insensitive, "con" also refers to the console, as
>  > does "con" with any extension. Thus, "con.beam" is a reference to
>  > the console. You should rename your module.
>
> Thanks. I have made a new version available.
>

All good now. Tests run.

Thanks for the swift fix.

- Edmond -

> Edmond Begumisa writes:
>  > Indeed, I looked again and found that make compiled all files except
>  > con.beam (there's no ../ebin/con.beam --  I should have noticed that
>  > before, although make should have at least failed with an error  
> instead of
>  > silently skipping over that target). And like Björn said, from the  
> shell...
>
> Sorry about the problems.
>
>
> Sven-Olof
>


--
Using Opera's mail client: http://www.opera.com/mail/
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions