3 ms·
It would effectively become a stack-only language (heap allocations' sizes would always have to be known at compile time, just like on the stack). I could see t
by _bxg1 6y ago
It would effectively become a stack-only language (heap allocations' sizes would always have to be known at compile time, just like on the stack). I could see that serving an interesting special subset of use-cases, but I was under the impression we were talking about a general programming language, which that would not be.
- philipkglass 6y agoFortran didn't have dynamic memory allocation until Fortran 90. If you wanted to run a problem larger than the original code's author had anticipated, you needed to recompile the source with larger values. This could indeed be an annoying restriction. But you might be surprised how much software was successfully written in Fortran.
- zokier 6y agoFor example MISRA C disallows dynamic memory allocations completely and still pretty complex applications have been written to that spec. Similar guidelines are pretty common in other high reliability or safety critical software specifications. Another example is "JPL Institutional Coding Standard for the C Programming Language", which specifies "Do not use dynamic memory allocation after task initialization"
- pjmlp 6y agoAda/SPARK does not allow for dynamic allocations, all of them must be proven at compile time.