Reminds me of a recent blog post on exactly this topic. Apparently the Jai language might make some progress on this point.
• https://blog.royalsloth.eu/posts/the-compiler-will-optimize-...
• Discussion: https://news.ycombinator.com/item?id=27010965