Re:The Spiral Language
by moomin on Thursday July 12, 2018 @07:35PM
(#17519486)
Well, this is pretty interesting. I’ve been wondering when someone would finally put optimisation semantics into the code.
[ Parent
| on HN ]
I 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.
“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.