4 ms·
Well, this is pretty interesting. I’ve been wondering when someone would finally put optimisation semantics into the code.
by moomin 8y ago
Well, this is pretty interesting. I’ve been wondering when someone would finally put optimisation semantics into the code.
- weberc2 8y agoI think it's more interesting that they're in the type system. C has had inline pragmas for decades now, and one might also consider memory allocation semantics to be optimization semantics. Or more generally, one might consider any low-level semantics to be optimization semantics. The neat thing about Spiral isn't that it has 'optimization semantics', but rather that they integrate neatly into the type system.
- moomin 8y ago“Inline”, though, is a request, like a hint. It doesn’t _enforce_ it. And this is my problem with most optimisations: you can’t guarantee they’ve happened. Putting them in the type system is definitely the right way of doing this. constexpr, however, does seem to be enforced.