3 ms·
> but for a streaming compiler... you just don't have liveness analysis I understand that streaming compilation wants to start compiling before the entire modu
by tom_mellior 7y ago
> but for a streaming compiler... you just don't have liveness analysis
I understand that streaming compilation wants to start compiling before the entire module has been read, but is it really that important to start compiling functions before their entire definition has been read? Seems like a huge artificial hurdle.
- snek 7y agofunctions are the part you compile, everything else is just runtime data
- tom_mellior 7y agoThe question was why one would want to start compiling a function before all of its code is available.
- Groxx 7y agoPurely guessing, but: gigantic generated funcs are A Thing™, and pretty often I'd expect that you don't even need to know the full contents of a func to being executing it. Some structures would require it, sure, but not all. You could treat it as speculative execution up to the point where you can't, and then you just wait and continue-or-error when you know more.
- nonsince 7y agoAuthor here: you got here before me but this is precisely the right answer, although it’s more about not needing the full contents to start _compiling_, rather than executing necessarily. Supporting streaming execution parallel to compilation is absolutely possible, but a tougher challenge that isn’t necessarily for our purposes.
- jacobush 7y agoWhy not... you could "just" during compilation split it into several functions and daisy-chain them if it came to that, by letting one calling the other with whatever state is needed to transfer. I'd bet it could even be part of a simple optimization pass. Single assign semantics help with eliminating useless scope and all that.