Re:Why Polars rewrote its Arrow string data type
by throwaway48540 on Tuesday August 06, 2024 @08:47PM
(#41177115)
I remember some C++ colleagues raving on about the standard library having anything and everything they might ever need. Makes sense in a world without sane package managers and package registries, but that mindset just doesn't carry over.
Re:Why Polars rewrote its Arrow string data type
by adrianN on Tuesday August 06, 2024 @11:31PM
(#41178007)
That development is quite recent. The stdlib used to be very barebones. It still is compared to for example the Python one.
Re:Why Polars rewrote its Arrow string data type
by kalaksi on Wednesday August 07, 2024 @01:26AM
(#41178481)
A decent standard library very much makes sense even with sane package managers and registries. Just look at JS. It's awful that you need to hunt for packages for simple stuff (or implement yourself). Stdlib is usually straightforward to use, good quality, trustworthy and good and lasting support
Re:Why Polars rewrote its Arrow string data type
by rob74 on Wednesday August 07, 2024 @02:29AM
(#41178746)
The "good and lasting support" part is the most important IMHO. Nothing is more annoying than having to switch to another library because the one you are currently using goes unmaintained. This can happen in the "stdlib" too (e.g. PHP deprecating the mcrypt library), but it happens much less often, and typically with much more time to prepare. Also important is that, when there is a "standard" stdlib package, other dependencies you might use will probably use that - having two dependencies that use different packages for doing the same thing is also annoying.
Re:Why Polars rewrote its Arrow string data type
by giancarlostoro on Wednesday August 07, 2024 @08:32AM
(#41180706)
I attribute Go's success to a rich OOTB standard library. You can build so much before you reach for third party packages. Heck, for web services, the built-in + their templating gets you pretty far.
Re:Why Polars rewrote its Arrow string data type
by tux3 on Wednesday August 07, 2024 @09:13AM
(#41181113)
That's a bit silly, the C++ standard library is pretty small ("the intersection of your needs, not the union" is what they say), and it's often not even really good at the few things that it does. Whether that's core stuff like hashmaps and iostreams, or more niche stuff like std::regex.
Re:Why Polars rewrote its Arrow string data type
by saagarjha on Wednesday August 07, 2024 @06:20AM
(#41179861)
> I guess the confusion arises because C++ people tend to assume that anywhere Rust differs from the practice in the C++ community it's a mistake, even though that's often because C++ made the wrong choice?
Funny, I hear that a lot from the Rust folks.
But yeah, it's pretty ignorant to assume Rust can't do this since the best available examples (as with many things) are in Rust. CompactString is really nice. On a typical modern (64-bit) computer CompactString takes 24 bytes and holds up to 24 bytes of UTF-8 text inline, while also having a niche.
I guess the confusion arises because C++ people tend to assume that anywhere Rust differs from the practice in the C++ community it's a mistake, even though that's often because C++ made the wrong choice? Rust's &str is "just" &[u8] plus a rule about the meaning of these bytes, and Rust's String is correspondingly "just" Vec<u8> plus a rule about the meaning of those bytes. C++ couldn't have done the former because it only belatedly got the fat pointer slice reference (as the troubled std::span) years after having a string data type.
Rust didn't do this in the stdlib, but not because it's impossible, because it's a trade off and they wanted the provided stdlib type to be straightforward. If you need or even just want the trade off, you can just cargo add compact_str