How do I compile the editor to WebGL to make it faster?

I need it for a Snap! mod I'm planning on making. I want it to run faster than Snap!.

If I were you I'd start with a project that'd still be quite difficult, but less so than what you are proposing: compile the scripts in a Snap! project to WebGL, or even just to Javascript. Then if you warp a script it'll run plenty fast.

But I see that what you really want to compile to WebGL is the redisplay code, the part that actually does graphics. Even that would be easier than trying to do the entire editor at once.

Where do I find the redisplay code? Does it lag Snap!?

I guess mostly in morphic.js. And, I dunno how you define "lag," but certainly displaying everything that moves takes a good bit of time; that's why turbo mode can speed up computation-heavy projects.

Loops are performed one iterations at frame, so 60 iterations per seconds. This can be perceived as lag.

Webgl can be fast at colision detection but not at actual painting of 2D canvas. Transformation of object data, already in renderer memory, is fast in webgl but changing data and interaction with JS is quite time consuming.

As first step you may search for some canvas to webgl simulator/emulator as base for experiments.