[wg-camlp4] Reconciling Merlin and ppx

Frédéric Bour defree at gmail.com
Mon Nov 4 13:46:17 GMT 2013


Le lun. 04 nov. 2013 14:25:19 CET, Alain Frisch a écrit :
> On 11/04/2013 02:02 PM, Frédéric Bour wrote:
>> − the transformer relies on some global state, that has to be threaded
>> across different invocations.
>
> This will indeed be the case for some transformers -- think about a
> macro system with macros defined in the same unit.
>
> But if you use the same representation as the compiler for the AST,
> couldn't you simply apply the transformers to the whole AST?  Why do
> you need to apply them to individual chunks?

Merlin is used in an interactive context (were we expect a response in 
less than ~ 60ms, on average).

If we retransform the whole AST during each invocation, we also need to 
retype the whole AST after. Then an "open Core.Std" alone is enough to 
blow up the time budget. (And this existimation is done on a desktop 
computer, some users have EEE).

However, I wonder how this state threading would be handled in the 
REPL ?

>
>
> Alain


More information about the wg-camlp4 mailing list