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

It is an interesting question of definitions. Is control flow only at runtime? Is `#if` control flow in C?

If I had to define it, I would go with runtime-only, but I could see the other way too.




Macros can have control flow, so compile-time control flow is definitely possible, but perhaps we trained ourselves to not think of control flow in this way because using complicated compile-time logic is generally frowned upon as a footgun.

Perhaps Zig is the language that on purpose blurs the line between what runs when (by basically having what looks like macros integrated into runtime code without any conspicuous hashtaggy syntax), and so a Ziggy would not see compile-time control flow as something weird.


Zig’s comptime is just code that runs at compile time. Unless we have another term, we must call it control flow




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

Search: