Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Regarding 2. How are comptime values restricted to total computations? Is it just by the fact that the compiler actually finished, or are there any restrictions on comptime evaluations?


Yes, comptime evaluation is restricted to a configurable number of back-branches. 1000 by default, I think.


They don't need to be restricted to total computation to be referentially transparent. Non-termination is also a reference.




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

Search: