Re:Why Zig when there is already C++, D, and Rust?
by whatshisface on Friday January 15, 2021 @06:36PM
(#25798120)
I'm using math in a colloquial sense to refer to "mathy math," not "computer science math." So linear algebra would be a leading example, along with stuff like vectors and complex numbers. Accounting math would be another example, because it requires a bignum implementation that doesn't drop decimals like float can.
[ Parent
| on HN ]
Re:Why Zig when there is already C++, D, and Rust?
by Quekid5 on Friday January 15, 2021 @06:37PM
(#25798132)
Ah! Might be helpful to specify that up front. Even so: Interval math could be quite helpful for lots of things that ... aren't using it.
Re:Why Zig when there is already C++, D, and Rust?
by hnlmorg on Friday January 15, 2021 @07:00PM
(#25798317)
> Might be helpful to specify that up front
I thought his post was pretty clear tbh. For example he mentions complex types so that should be an indicator that he's not talking about the kind of high school maths that the average developer can coast along with.
Re:Why Zig when there is already C++, D, and Rust?
by im3w1l on Saturday January 16, 2021 @02:42AM
(#25800800)
Do you have an example of someone solving a real-world problem with interval math? I've only ever seen toy examples and theoretical justifications.
Re:Why Zig when there is already C++, D, and Rust?
by Quekid5 on Saturday January 16, 2021 @04:08PM
(#25805524)
1) Most of (micro-)benchmarking in computing. Of course you want a tiny bit more analysis in that case.
2) Slightly more real-world: Measuring things when you only have approximate rulers, have difficult things to measure (odd surfaces, etc.), or have to calculate from 2nd hand measurements (pictures with rulers, etc.)
Not sure if that qualifies as Real World, but...?
Re:Why Zig when there is already C++, D, and Rust?
by im3w1l on Saturday January 16, 2021 @11:28PM
(#25808122)
By real world I mean code running in production and making someone money. Or a popular open source package. And I'd be interested in which company or project that is and if they have a writeup.
Re:Why Zig when there is already C++, D, and Rust?
by hobofan on Friday January 15, 2021 @06:44PM
(#25798190)
So for those use cases where you will be using a library with custom types anyway, choose one that doesn't overload the operators for those types? This very much seems like a problem on the library- and not the language-level.
Re:Why Zig when there is already C++, D, and Rust?
by Ar-Curunir on Friday January 15, 2021 @07:39PM
(#25798645)
Also, in Rust if you don't want to use the overloading, you can still write your code to directly use function calls `a.add(b)`, where `a` is a type that implements the `Add` trait.