[erlang-questions] Why do we need modules at all?

Tim Watson watson.timothy@REDACTED
Wed May 25 07:46:52 CEST 2011


> Unfortunately information about individual functions is
> scattered all over the place. I want the source, the type signature,
> the documentation. These are available in a variety of different
> formats in different places. Documentation is in untagged comments
> in @tagged edoc format or in XML in a completely different file.

Yes, this is a really important part of it. Being able to slurp in
Erlang projects from the file system (and github, etc), access all
this information and provide it in a searchable fashion would
*already* put us way ahead of the crowd in terms of discovery.

> Silly design question: if multiple people can edit (say) a wiki
> of functions what formatting standards should be enforced?
>
>    - the last person who edited the text
>    - some "moderator" (who)
>    - by a pretty printer
>     (is there a *really good* pp? - with color syntax marking)

I think there are reasonable ones around. Take a look at
http://tidier.softlab.ntua.gr:20000/tidier/getstarted. I would also
propose that you let the viewer configure the pp to their own
preferences. Given that you're actually storing abstract code (or AST
or something like that) rather than lines of source code anyway, this
is just human readable representation after all. Let people view with
whatever (potentially hideous) whitespace &c convention they like.

>> I'm guessing this will require patching the compiler to preserve the
>> type specs in the beam code. That is something I would need help with,
>> but may be trivial for others.
>
> Easy - it is there already (I think) poke around in beam_lib.erl
> this analyses the .beam files.
>

I was pretty sure this wasn't the case. I'll dig in to beam_lib at
lunch time and have another look.



More information about the erlang-questions mailing list