Hacker News new | past | comments | ask | show | jobs | submit login

I agree, very readable.

One interesting thing: the sieve array does not have static bounds, the size of it is an argument. Presumably that means it’s stack-allocated dynamically a la ”alloca” (I doubt it’s heap-allocated, given there’s no freeing of it). C didn’t get that feature until C99 and adding it has been almost universally been seen as a mistake.

I imagine that’s an example of one of the many, many things that makes Algol-68 a pain to implement. Does make it easier for the developer though.




I've looked up alloca() and it's considered about as safe to use as recursion, and potentially safer than stack-allocating one big fixed-size array. Its bad reputation might be because of poor implementations in certain compilers.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: