👽 072004

installing couple rust dependencies (tauri for app development) for a gemini project, this thing sure is heavy!

3 months ago

Actions

👋 Join Station

8 Replies

👽 aelspire

@m0xee Well, I’m not actually Rust evangelist but I think I should clarify something. Not everything need to be statically linked in Rust. Rust is capable of both linking with dynamic libraries (https://github.com/rust-lang/libc) and producing dynamic libraries (https://gitlab.gnome.org/GNOME/librsvg).

The problem is that .so files contain compiled objects and it doesn’t play nice with generics or templates (this is why templates in C++ need to be defined in header files) and they are not worth much when they are not universal enough, see: https://drewdevault.com/dynlib.html. So its hard to justify creating Rust-specific dynamic libraries. · 3 months ago

https://github.com/rust-lang/libc

https://gitlab.gnome.org/GNOME/librsvg

https://drewdevault.com/dynlib.html

👽 m0xee

@aelspire the examples are a bit… outlandish IMO — software of that scale, that relies on dozens of dynamically linked libraries would have hundreds of crates as dependencies. But point taken — and like I said, I don't hate this approach — it's just a bit unusual to me. Linking everything statically is controversial, but it definitely has its pros and making dependencies more atomic is sure a good thing, but all that became possible because storage space, network bandwidth and even the compilation time became orders of magnitude cheaper that what it used to be. · 3 months ago

👽 aftergibson

Damn is zed really slow? I thought the sales pitch was that it's really performant. · 3 months ago

👽 aelspire

I suggest you to read this article: https://wiki.alopex.li/LetsBeRealAboutDependencies

And there is other point: Unit of compilation in Rust is crate, so I’m often seeing that something which would be one library in C is separated into multiple separate crates in Rust.

I’m not telling that there isn’t problem, because I’m seeing crates being used as dependency for just one few-lines function. But 200 crates doesn’t equal with 200 C libraries. · 3 months ago

https://wiki.alopex.li/LetsBeRealAboutDependencies

👽 m0xee

@072004 Never used Node.js — hate that thing, but I'm checking out Rust now. I can't say I hate this approach: very compact standard library, and everything else being brought in as dependencies, but I'm kinda old-school and I'm just not used to this.

Sometimes I use very old machines with limited disk space and when I'm close to running out of, I'm like: "Okay, let's just clean old object files up",— and I do "cargo clean" in my tiny little project that uses just ureq, serde_json, clap and their dependencies, and it's like: "Okay, here: 800 megabytes cleaned"

And I'm like wow, where did all that come from?! 😂 · 3 months ago

👽 072004

@m0xee i've seen comparisions online between rust and javascript, ecosystem wise: there's lots of tiny packages, and most popular packages depend on those... · 3 months ago

👽 lufte

I tried the Zed editor (and was quite optimistic about it) but I just found it slow, as in noticeable-delay-after-every-key-stroke slow. The issue kind of went away as I made the window smaller and smaller, so I guess it's a video thing. · 3 months ago

👽 m0xee

Rust moment 😅

Check out this Zed editor — it pulls over a thousand crates as dependencies (!)

I still couldn't manage to make it work 😩 · 3 months ago