Live data from Hacker News

Show HN: A 166 KB file for cross compiling glibc for any version, any target

github.com

31–34 of 34 posts

Re: Show HN: A 166 KB file for cross compiling glibc for any version, any target

#31

Earlier quoted context omitted.

I find Rust's array style more confusing than prefix, since prefix matches the order you index into the arrays (arr: [5][2]i32 can be validly indexed as arr[<5][<2]), and Rust's style is written backwards from how you index the array. Can you clarify how you find Rust unambiguous?

It's just obvious to me that it works the correct way by way of elimination of alternative parsing. The example below can be unwrapped mentally and unambiguously as "an array of 5 items of (an array of 2 items of i32)". Indexing into the array is not backwards: the outer array is deref'd first, giving you one of those five items which has length two. fn main() { let mut a: [[i32; 2]; 5] = [[0,0],[0,0],[0,0],[0,0],[0,…

> Note that the Rust array declarations are also homologous to other types in the ecosystem, such as nested Option types or nested collections (eg: Option> or List>).

To me, [[i32; 1]; 10] is homologous to Items, Unlimited>, not Vec>. To me, it make more sense to put the size before the inner type (either [1; i32] or [1]i32), since you need to index the array before getting an instance of the type.

Re: Show HN: A 166 KB file for cross compiling glibc for any version, any target

#34

Something is very wrong with the state of C/C++ compiler development that it takes a different language to come in and make these obviously useful convenience features. Why are GCC and Clang not doing this?

This is not an issue with GCC or Clang as far as I'm aware, but with glibc and the way it handles backwards compatibility. Versioned symbols get added when a function or object breaks binary compatibility. You keep around the old version, and compile against the new version. This might be something simple like a struct layout change, or a change in the size of an array. Both versions have the same name. When you comp…

Well, but zig just... does it?
Post reply on HN