[erlang-questions] If you are homesick for object.selector

Loïc Hoguin <>
Tue Jan 29 03:16:35 CET 2013


On 01/27/2013 07:28 PM, Eric Merritt wrote:
>> Garrett
>>
>> [1] https://github.com/languages
>>
>> [2] I'm reminded of the coding horror that is jQuery
>>
>> [3] I'd point to Eric Merrit's outstanding with with Joxa
>> (http://joxa.org) as an example of what can be done with core Erlang
>> and the Erlang tool chain
>
> We will probably be hoisting Joxa up from Core Erlang to the higher
> level Erlang AST sometime soon. Unfortunately, Core Erlang isn't
> really the first class language target that it is claimed. The main
> problem is it does not produce Abstract Code in the resulting beam.
> This makes it impossible to use both Erlang's built in debugger and
> Dialyzer on things compiled to Core Erlang. It could be argued that
> this isn't a major problem. In Joxa, at least, the lack of those
> features have been somewhat painful for new folks.

It sounds like it'd be more work than improving the Core Erlang support 
in OTP.

Correct me if I'm wrong:

Dialyzer works on Core Erlang. It needs the abstract code because Core 
Erlang has no support for typespecs. When Dialyzer works on beam files, 
it extracts typespecs, compiles the abstract code to Core Erlang and 
continues with it. It does a similar process from source.

Instead the compilation process could perhaps add a beam chunk 
containing the typespec information that Dialyzer would use, and another 
with the Core Erlang AST. This'd likely also make Dialyzer a little 
faster as it would not need to compile the AST to Core Erlang and to 
retrieve values from it.

The debugger application, but not dbg from what I understand, is indeed 
making heavy use of the Erlang AST. This sounds like a minor issue 
though if dbg still works. I'll need to confirm this later on.

The last two issues are the tools cover and xref. I don't think xref 
would be too difficult to port to Core Erlang, cover I'm not sure.

> On the plus side Core Erlang is a nice, simple AST to target that
> gives a lot of flexibility.

And we should help make it viable for many languages to come.

-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-questions mailing list