5 ms·
This is kind of radical, I wonder how well it works in practice: "The Ur/Web compiler is unconventional in that it relies on a kind of heuristic compilation. N
by ajb 12y ago
This is kind of radical, I wonder how well it works in practice:
"The Ur/Web compiler is unconventional in that it relies on a kind of heuristic compilation. Not all valid
programs will compile successfully. Informally, programs fail to compile when they are “too higher order.”
Compiler phases do their best to eliminate different kinds of higher order-ness, but some programs just won’t
compile. This is a trade-off for producing very efficient executables. Compiled Ur/Web programs use native
C representations and require no garbage collection."
- jbapple 12y agoC++ has a similar (though more carefully specified) limit on template instantiation depth. I would be surprised if this were not true in practice for all compiled languages - some programs will be too large to compile given the memory constraints of the machine the compiler is running on.
- Dewie 12y ago> I would be surprised if this were not true in practice for all compiled languages - some programs will be too large to compile given the memory constraints of the machine the compiler is running on. Clearly this is different to a compiler which intentionally rejects programs that can't be efficiently implemented/compiled.
- jbapple 12y ago> Clearly this is different to a compiler which intentionally rejects programs that can't be efficiently implemented/compiled. I agree. I wonder what happens when the heuristic fails in the Ur/web compiler. When my C++ compiler runs over its template instantiation depth, I get a nice error message telling me what happened and how to increase the depth.
- ajb 12y agoThat wouldn't be radical, I agree. But unless I'm missing something the limitation is much less easy to predict: it's which programs can the compiler analyse the runtime memory usage of. That's why I'm curious about what it means in practice.