matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

Break-out the loader & indexer #88

Open matthewmueller opened 6 years ago

matthewmueller commented 6 years ago

This stuff is separate from the actual translation and useful in really any program that transforms Go ASTs. I'm finding myself copying a lot of the logic for the React framework.

Maybe this should be in a separate repo or at least isolated and abstracted a bit.

matthewmueller commented 6 years ago

There's also improvements we can make that GopherJS already does around loading. They do custom archiving to speed up importing large packages like "fmt". We don't really have this problem yet, but having a standard place to put these Go files would be nice.

I think gopher's loading logic predates https://godoc.org/golang.org/x/tools/go/loader, so we'll probably want to use the standard but add in the archiving.