Live data from Hacker News

Lessons from Zig

vinniefalco.com

21–28 of 28 posts

Re: Lessons from Zig

#21
> Every ABI concern constrains future evolution permanently

Why caring about ABI stability? It's easier just to link anything statically. Benefits of dynamic linking are negligible or even negative and thus it doesn't have any sense to have headache maintaining ABI stability. That's exactly what Rust does.

Re: Lessons from Zig

#22
post #4

There is a much simpler solution to the C++ language: just freeze it. Fork it if you want or just create your own language. This is what zig creator did. The idea is that C++ can’t move because of its own weight. Too much history, too much responsibility. Just freeze it, let new languages create new ways. It’s not that software written in it will become unmantainable. A frozen, feature complete language can still wor…

> just freeze it.

They did. It's called C++14.

> Fork it if you want or just create your own language.

They did. It's called C++17, etc.

Re: Lessons from Zig

#23
post #4

There is a much simpler solution to the C++ language: just freeze it. Fork it if you want or just create your own language. This is what zig creator did. The idea is that C++ can’t move because of its own weight. Too much history, too much responsibility. Just freeze it, let new languages create new ways. It’s not that software written in it will become unmantainable. A frozen, feature complete language can still wor…

C++ instead needs language editions, legacy and modern. Let compilers implement a switch for which edition you're targeting. Legacy does not touch backwards incompatibly changes or language features. Modern cleans up everything.

Re: Lessons from Zig

#24

> Every ABI concern constrains future evolution permanently Why caring about ABI stability? It's easier just to link anything statically. Benefits of dynamic linking are negligible or even negative and thus it doesn't have any sense to have headache maintaining ABI stability. That's exactly what Rust does.

I think there are some smaller Rust ecosystems where they try to have some kind of ABI stability or dynamic linking. For instance, Bevy has some support for dynamic linking.

Edit:

Redox OS might be a better example, though its dynamic linking is for its Rust implementation of the C standard library.

https://www.redox-os.org/news/release-0.9.0/

> Relibc is also now key to our “stable ABI” strategy. The plan is for files to dynamically link against Relibc, which will provide a stable ABI for the dynamic linker. New POSIX functions will be added to Relibc, but none will be removed. That will leave us free to change the implementation of the services as Redox evolves, but still be able to run binaries compiled for older Redox versions.

Re: Lessons from Zig

#25
post #23
post #4

There is a much simpler solution to the C++ language: just freeze it. Fork it if you want or just create your own language. This is what zig creator did. The idea is that C++ can’t move because of its own weight. Too much history, too much responsibility. Just freeze it, let new languages create new ways. It’s not that software written in it will become unmantainable. A frozen, feature complete language can still wor…

C++ instead needs language editions, legacy and modern. Let compilers implement a switch for which edition you're targeting. Legacy does not touch backwards incompatibly changes or language features. Modern cleans up everything.

I don't think that would be a silver bullet nor without drawbacks. It can be a rather bitter footgun when the same code can have different semantics in different editions or epochs. Automatic or semi-automatic conversion, as Rust has, helps it a bit, but not fully.

Re: Lessons from Zig

#26
post #24

> Every ABI concern constrains future evolution permanently Why caring about ABI stability? It's easier just to link anything statically. Benefits of dynamic linking are negligible or even negative and thus it doesn't have any sense to have headache maintaining ABI stability. That's exactly what Rust does.

I think there are some smaller Rust ecosystems where they try to have some kind of ABI stability or dynamic linking. For instance, Bevy has some support for dynamic linking. Edit: Redox OS might be a better example, though its dynamic linking is for its Rust implementation of the C standard library. https://www.redox-os.org/news/release-0.9.0/ > Relibc is also now key to our “stable ABI” strategy. The plan is for fil…

Almost by definition, you have ABI stability as long as all artifacts are compiled with the same version of the same toolchain on the same platform with all the same compiler flags. That's not enough to let you generally ship pre-compiled artifacts with the intent for users to dynamically link them, but it might be enough to let you leverage dynamic linking for hot-reloading within a single developer's workflow.

Re: Lessons from Zig

#27

> The Zig language, created by Andrew Kelley, takes a deliberate position on standard library scope. I'm missing the significance of this callout. Is Andrew Kelley synonymous with/well known as a representative of a particular approach to language or software design?

...yes? Does he need to create more than one language to take stance on library scope?

I meant that the name of the language creator is irrelevant to the point being made in the article, unless the name has some out of band meaning that the intended audience knows and I do not.

Turns out the article is AI slop, so makes sense.

Post reply on HN