2 ms·
I wonder whether this would be better as an external tool? It seems almost inappropriate for a systems language. It seems like a great way to boost performance
by jeffdavis 10y ago
I wonder whether this would be better as an external tool? It seems almost inappropriate for a systems language.
It seems like a great way to boost performance, but performance isn't everything. Compiler simplicity should also be a goal (though perhaps difficult with rust, I think it's worth some effort). Debuggability should be a goal.
And I think some kind of ABI guarantees would be nice eventually after the rest of the language stabilizes.
- CAMLORN 10y agoIn fairness, the compiler is actually simpler now. Perhaps not as simple as if fields were always in order, but we only determine what type layouts should be in one place instead of two now, and 99% of what you have to do in the rest of it is just foo.memory_index[i] instead of i in all the places you want a field index. There's also a helper function that lets you invert it. The part of the compiler that builds LLVM types just uses this. The cost here isn't complexity, it's that "Fields are in increasing order by offset" has been baked into the compiler for years and you have to make sure to change them all.