News for hackers. Stuff that matters.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by adwn on Wednesday March 31, 2021 @01:58PM (#26650653)
> Why would you need operator overloading in a low-level language?

Have you ever heard of matrices and vectors? You need them in a lot of DSP (digital signal processing) applications, like audio and video filters, or in 3D graphics. Being able to write

    x = m * y
instead of

    x = m.vector_mult(y)
makes life so much more pleasant.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by johnnycerberus on Wednesday March 31, 2021 @02:01PM (#26650712)
In Zig you write libraries that should be explicit and maintainable.
Re:Android's new Bluetooth stack rewrite (Gabeldorsh) is wri... by adwn on Wednesday March 31, 2021 @02:47PM (#26651343)

    x = m * y
is even more explicit than

    x = m.vector_mult(y)
because the * operator is side-effect free by convention, while a method like vector_mult() might or might not be mutating (i.e., it could work like the *= assignment operator).