Re:Rue: Higher level than Rust, lower level than Go
by Ar-Curunir on Monday December 22, 2025 @06:26AM
(#46353292)
Plenty of languages, including very serious ones like C and Rust, have bounded recursion depth.
Re:Rue: Higher level than Rust, lower level than Go
by mrkeen on Monday December 22, 2025 @07:53AM
(#46353771)
Then let me rephrase:
If every iteration of a while-loop cost you a whole stack frame, then I'd be very rude about that language.
This works, btw:
#include <stdio.h>
long calc_sum(int n, long acc) {
return n == 0
? acc
: calc_sum(n-1, acc+n);
}
int main(void) {
int iters = 2000000;
printf("Sum 1...%d = %ld\n", iters, calc_sum(iters, 0));
return 0;
}
Re:Rue: Higher level than Rust, lower level than Go
by zephen on Monday December 22, 2025 @01:51PM
(#46357347)
> If every iteration of a while-loop cost you a whole stack frame, then I'd be very rude about that language.
Well, sure, but real programmers know how to do while loops without invoking a function call.
If I put out a language that crashed after 1000 iterations of a loop, I'd welcome the rudeness.