3 ms·
C++ 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 compi
by jbapple 12y ago
C++ 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.