[erlang-questions] Type specs unavailable in code compiled from core erlang?

Eric Merritt ericbmerritt@REDACTED
Thu Jan 5 16:29:23 CET 2012


On Wed, Jan 4, 2012 at 7:57 PM, Tim Watson <watson.timothy@REDACTED> wrote:
> On 3 January 2012 22:36, Eric B Merritt <ericbmerritt@REDACTED> wrote:
>>
>>
>> This may argue for something Kenneth suggested back in may, that is
>> keeping spec and types in their own dedicated chunk that does not
>> disappear with the absence of debug information.
>>
>
> Well +1 for keeping the types/specs *somewhere* in the beam regardless of
> debug_info for sure. Personally I favour the idea that types/specs should be
> present all the time, as they make up part of its public API. IIRC in the
> previous thread someone had mentioned the abstract_code parse transform,
> which is nice and all but I think this should be just happen and the
> information should be available at runtime as proper module attributes.


Agreed on all most all points, except the module attributes (depending
on what you mean by module attributes). It should be in the beam chunk
data, and absolutely should be returned by module_info. However, I
don't like overloading the attributes chunk with this additional data.
It should be in its own place. Time for an EEP I think.

>
> How are record member/element types handled in the abstract code?



More information about the erlang-questions mailing list