[erlang-questions] Private message regarding: adding compile pass

Karlo Kuna kuna.prime@REDACTED
Wed Apr 26 23:14:45 CEST 2017


thank you,
i was looking something like command line version, although if would be
nice to compile module programatically and non invasive (-compile option).

On Wed, Apr 26, 2017 at 3:27 PM, Juan Martín <juan.facorro@REDACTED> wrote:

> Nice! I didn't know about that one, obviously :P.
>
> On Wed, Apr 26, 2017, 2:25 PM Richard Carlsson <carlsson.richard@REDACTED>
> wrote:
>
>> You can add a core transform pass, just like a parse transform, but there
>> is no support for adding passes below that level.
>>
>> In the source file: -compile({core_transform,Module}).
>>
>> or on the command line: erlc +'{core_transform,Module}'
>>
>> will cause Module:core_transform(Code, Options) to be called during
>> compilation.
>>
>>
>>
>>         /Richard
>>
>> 2017-04-26 13:23 GMT+02:00 Karlo Kuna <kuna.prime@REDACTED>:
>>
>>> it's a shame, looking at source of compliler.erl this feature would be
>>> easy to add. Are you aware of any such proposal? Also it would be
>>> interesting to hear opinions on adding such proposal.
>>>
>>> thank you
>>>
>>> On Wed, Apr 26, 2017 at 10:29 AM, Juan Facorro <juan.facorro@REDACTED>
>>> wrote:
>>>
>>>> On Saturday, April 22, 2017 at 8:58:59 PM UTC+1, Karlo Kuna wrote:
>>>> > can one add custom compile pass when compiling module??
>>>>
>>>> It is not possible to arbitrarily insert a compiler pass in the Erlang
>>>> compiler. Only parse transforms are currently available as a hook as a sort
>>>> of preprocessing pass that handle Erlang AST.
>>>>
>>>> Cheers,
>>>> Juan
>>>
>>>
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170426/0b7304b3/attachment.htm>


More information about the erlang-questions mailing list