Contract programming for optimizations #12
alilleybrinker
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Contract programming is obviously a thing (hello, Racket), but I'm not sure if it's ever been applied to requiring that certain things receive an optimization during compilation, erroring out or warning if they don't. For example, you may have some code which you need to be vectorized to be worthwhile. Having the ability to express this requirement to the compiler, and have compilation fail if that function or block of code isn't vectorized, would be really nice. Even better if the accompanying error message explained perhaps why that optimization was deemed impossible, to hint how to resolve it.
As another example, imagine being able to mark a function as needing to be inlined, with compilation failing or producing a warning if the function isn't inlined.
Beta Was this translation helpful? Give feedback.
All reactions