Remix.run Logo
tsimionescu 3 hours ago

> arrayref is a small crate of four macros.

Why do so many languages fall into this horrible practice?

wasmperson 3 hours ago | parent | next [-]

There was a recent talk which explored this question (Dependency Cultures, by Richard Feldman):

https://www.youtube.com/watch?v=E82ly38YEEQ

Summary: it's cultural. Rust likely inherited the practice from Nodejs, who inherited it from Ruby. I think in Rust online spaces in particular there is also this undercurrent of "you're not smart enough to use certain parts of the language, so download libraries that handle that stuff for you."

igsomething 2 hours ago | parent | next [-]

The language also takes backwards compatibility very seriously, anything that goes into std "must be maintained forever". It is also argued that a large stdlib means the maintainers have less time to work on the language itself.

I understand not every language can have Go's amazing stdlib, but I would much prefer Pyhton's approach where every now and then some package/function from the stdlib gets deprecated/removed. Rust's 3rd party ecosystem is the worst thing from the language, worse than the compile times.

neutronicus 2 hours ago | parent | prev | next [-]

The "npm-ness" of Cargo (centralized and standardized dependency management used at every opportunity) is generally pitched as one of the primary developer experience advantages over C++.

superxpro12 3 hours ago | parent | prev | next [-]

i'd like to welcome you to the hell that is c/c++ dependency management. Make? cmake? qmake? conf? autoconf? configure? autotools? submodules??? AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

bayindirh 2 hours ago | parent | next [-]

I'd just select a tool, vendor the libraries I need to the codebase and call it a day. Did these for Eigen, liboption++, Catch2, Easylogging++ (now archived and not maintained anymore, sadly).

Build a simple makefile, and you're off to the races.

At least, for my cases, that is.

nelup20 2 hours ago | parent | prev | next [-]

Conan, Meson, Ninja, Bazel, meta-build tool / dependency manager #231 etc. etc. And then you have to deal with all the modern C++ and STL footguns.

It never ends .·°՞(っ-ᯅ-ς)՞°·.

account42 an hour ago | parent | prev | next [-]

I'll take all that over downloading and immediately executing random unreviewed code any day.

skydhash 2 hours ago | parent | prev | next [-]

None of those (other than submodules which is just vendoring) does dependency management. They are more configuration management than anything. C, Python, Perl (and maybe ruby?) relies on flag switches and environment variables to find all the necessary files and modules for compiling/running a script. Cmake and autoconf just configure those.

With NPM and Rust's focus on project's level dependencies, there's no longer emphasis on API stability. Instead we have breakage every months, forcing everyone on the upgrade treadmill. It's easier to audit C library because they focus mostly on security updates instead of redesigning the API for the nth time.

SSLy 2 hours ago | parent | prev | next [-]

xmake, build2, whatever msvc and xcode insist upon…

justinhj 2 hours ago | parent | prev [-]

vcpkg is pretty good. cmake is complex but very flexible. just need an llm to help and it's pretty much solved (if your dep is in autopkg)

irishcoffee 3 hours ago | parent | prev [-]

[flagged]

ux266478 2 hours ago | parent | next [-]

Rust as a language is mostly alright in my opinion. The problems I have with it are similar to the problems I have with C++, and it makes up for them in other really compelling ways.

Where it loses me is Cargo and everything surrounding it. I'm essentially forced into an extreme where I just never use anything in the Rust ecosystem, or I have to deal with insane dependency graphs that have the density and microstate complexity of a neutron star.

andsoitis 2 hours ago | parent [-]

> Rust as a language is mostly alright in my opinion.

> Where it loses me is Cargo and everything surrounding it.

High praise!

josephg 3 hours ago | parent | prev [-]

> Rust is very much a schlong-measuring contest

What? Its just a programming language. Go dependency free if you want. Or vendor everything. Nobody is forcing you to pull in 3rd party dependencies.

silverlinex 2 hours ago | parent [-]

[flagged]

bayindirh 2 hours ago | parent [-]

As a person who doesn't like Rust very much, no, it doesn't suck. Some of its features make some folks very excited for very right reasons, and evokes "Silver Bullet Syndrome" in others for all the wrong reasons.

People weaponizing Rust rewrites with permissive licenses is another problem, but it's not about the programming language itself.

vablings 3 hours ago | parent | prev | next [-]

There are two reasons you might want to use a crate, The first being that you want to use a good solid implementation that you know someone has spent more time doing and works better than almost any solution you could integrate. The second is you don't want to spend time implementing that.

Writing macros in rust is a pretty horrible experience but it's not difficult

bcjdjsndon 3 hours ago | parent | prev | next [-]

Just like c++ thought threads wasn't a std library concern and then later changed they minds, rust will also change tac I predict

nicoburns 3 hours ago | parent [-]

Rust is actively incorporating more functionality into the stdlib. The functionality of this crate has been in std since 2024. The ecosystem is just slow to update (not everything is maintained, etc).

silverlinex 2 hours ago | parent [-]

[flagged]

chaps 2 hours ago | parent [-]

Are you okay?

account42 an hour ago | parent | prev | next [-]

Only the ones that make it easy. Language package managers are a mistake.

2 hours ago | parent | prev | next [-]
[deleted]
rvz 3 hours ago | parent | prev | next [-]

The languages that have a poor standard library support have this issue and other languages encourage you to import tons of libraries to fix the problem.

This is why Javascript and Typescript suffer from this the most and has little to nothing to do with "popularity" and likely 9/10 of these npm packages import an external library.

Golang on the other-hand is just as popular and has a stronger standard library which people build against and it is encouraged to use its standard library rather than rolling your own or importing another package to solve the problem.

weinzierl 3 hours ago | parent | next [-]

Rich official standard library vs "import tons of libraries" are not the only two options.

Java's standard library had arguably also been poor for a very long time and "import tons of libraries" just had not been practical for most of that time because the tooling and ecosystem for that did not exist yet.

The solution was apache-commons and guava. Two large libraries with everything the developers heart desired and well maintained by large organizations.

For Rust be probably will never have anything exactly like that because requirements from no-std development to fully fledged backend service are too diverse, but there is still room for a small number of well maintained backed by reputable developers convenience libraries in my opinion.

wahern 28 minutes ago | parent [-]

Namespacing. Mandatory namespacing. It's an essential prerequisite for any kind of reputation building and managememt, before you even get into the gritty technical or security details.

And it has to be mandatory. Top-level package names will always have more cachet. Developers are suckers for good package names, literal or imaginative. Plus it helps address, but by no means completely solves, name and typo squatting.

I understand people and groups can run their own crates.io-like repository, but that's a tangential aspect. Even if this were ubiquitous, you'd still want mandatory namespacing. You want provenance, or at least intended/nominal provenance, to be as transparent as possible, not implicit or buried. By no means a complete solution, but an important foundation for better technical and culture patterns.

trembolram 2 hours ago | parent | prev | next [-]

I don't want to see a large standard library for Rust. If something is added to the standard library, then it is very difficult to change it afterwards because backwards compatibility.

It would be better to have blessed crates in crates.io. The Rust core team would release or audit them. If the blessed crates need breaking changes, it can be done by increasing their major semantic version number. That can't be done to the standard library.

Actually, there could be a "trust" level for crates: 1. blessed crates by the Rust core team, 2. trusted developers, 3. untrusted developers. Or something like that..

sfdsfef3f3f 2 hours ago | parent | prev | next [-]

Go has a stronger standard library for certain use cases like basic CRUD web applications, but a lot of the Go standard library is also extremely low quality (flag, container, image, json, log, math, path, regexp, sync, time). Many of these aren't usable outside of toy use cases and have weird edge cases all over the place. Over time many will probably get new incompatible versions just like json. The container package in Go is the worst collection library in any mainstream programming language by a huge margin. It's actually astounding how bad it is.

wasmperson 3 hours ago | parent | prev | next [-]

I don't think this is true. People like to scapegoat the JS standard library but in reality most JS implementations have pretty featureful standard libraries, especially browsers. I've never felt the need to use any third-party libraries in the javascript projects I've worked on (except for maybe `ws`).

bryanlarsen 3 hours ago | parent | prev | next [-]

I've never seen a non trivial Python or Go project without external dependencies. The dependency tree of comparable Go and Rust projects seem comparable, IMO.

QuadmasterXLII an hour ago | parent [-]

Pytorch has 9 transitive dependencies for cpu-only execution, or 29 to bring in cuda.

candle, the most popular rust ml library I found in a cursory search, has 119 for cpu only, and 150 to bring in CUDA.

I guess it's taste whether that's comparable

this would have been a way more satisfying dunk if nvidia hadn't split the cuda functionality needed by pytorch into 19 (!) packages on pypi but such is life.

tsimionescu 3 hours ago | parent | prev | next [-]

I don't think it's just that, though I agree they are clearly correlated.

The reason I don't think it's a sufficient explanation is that there is a clear history of large, 3rd party libraries being created exactly to supplement poor standard libraries. C++ has Boost, Java has Apache Commons (though Java also has a pretty huge standard library), arguably we could even say C has Posix/Win32/Cocoa.

I believe there is some deeper cultural reason why certain language ecosystems coalesce large utility libraries, while others prefer myriad tiny dependencies.

whstl 2 hours ago | parent | next [-]

The important difference IMO is in the small vs big libraries culture.

Lots of languages have a bad stdlib but don’t fall into the trap of having thousands of micro libraries.

The reason people do it is because it brings clout and money. Just look for articles defending micro libs: the popular ones are by people who make a living on donations, due to maintaining 1000+ packages.

And collaborating in larger libs/stdlib is hard. Plus: Rust, Node, all have a lot of visibility.

You need a good stdlib culture to avoid it (like Go did).

DanielHB 3 hours ago | parent | prev [-]

The reason is simple: the package manager works well. Helps if the package manager is standardized and there is a "default" registry for open source projects.

I remember the days where I had to manually put the Spring .jar files into my project. No way I am doing that for 100s of dependencies.

insanitybit 2 hours ago | parent | prev | next [-]

Total nonsense. Python has a massive stdlib and there are malicious packages.

fukaiall 3 hours ago | parent | prev [-]

Can’t agree more. If you take security seriously, you should consider using Go.

MallocVoidstar 3 hours ago | parent | prev [-]

They aren't trivial, at least: https://docs.rs/arrayref/0.3.9/src/arrayref/lib.rs.html#202-...