Comment

Comment by steveklabnik

const fn is used for compile-time programming. "pure" is a bit over-loaded of a term, but you can sort of think of it that way, sure.

You can of course also run these functions at runtime; they're a more restricted kind of function. You cannot even currently use if inside of them, for example. We're working on expanding it out, but we're going slow because it's important for soundness reasons.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton