4 ms·
Jon's language is not about the compiler being smart and fixing your code. It's about letting the programmer write good code without the compiler getting in the
by hsn915 5y ago
Jon's language is not about the compiler being smart and fixing your code. It's about letting the programmer write good code without the compiler getting in the way.
I'm not aware of anything in his language that would make it easy for the compiler to automatically decide a better memory layout.
It's rather the opposite: preventing the compiler from doing such things.
For example, struct layout is always the order that you declare. There's no "feature" in his language that would re-order struct fields to minimize padding or anything like that.
- MaxBarraclough 5y agoAll good points. To put that another way then, it's aiming to introduce language features which make it much easier for the programmer to transform their data layouts. gnuvince mentioned that the Zig language seems to be making inroads here too: https://ziglang.org/documentation/master/std/#std;MultiArrayList https://ziglang.org/documentation/master/std/#std;MultiArray...
- kristoff_it 5y agoThe important point about Zig's implementation is that this is all userland code. No extra syntax was added to the language to enable it, which is a great display of how flexible comptime can be.
- MaxBarraclough 5y agoVery cool, Zig must have some powerful compile-time introspection facilities. > this is all userland code I imagine you meant library code here?
- kristoff_it 5y agoI meant to say code that isn't part of the compiler or special cased in any way. So, yes, code that could very well be a normal third party library.