Caterpillar

Daily Thought - 2024-09-09

< back to list

There are other interesting things you can do with comptime in Zig. It also lets you control which parts of your code get evaluated at compile-time.

I was going to to say, that we don't need this in Caterpillar. We can just guarantee that everything that can happen at compile-time does happen at compile-time. And then make that explicit using Caterpillar's tooling. But now I'm not so sure.

I think this might work for many programs, but if you're working on some one-off calculation that you'd like to later run on a powerful machine, then this could get very inconvenient. You'd need some way to control this behavior, and eagerly doing stuff at compile-time would be the wrong default. Not sure what the answer is here. I think it's fine to defer this question until later.

<< previous thoughtnext thought >>