[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: file.png (113 KB, 623x351)
113 KB
113 KB PNG
Why does Rust not have libraries?
>>
>200MB of libraries
Literally never happens, but a retard nocoder like vaxry wouldn't know that.
>>
>>107818973
is that really how it works? i thought it still loaded a copy for each program for speed
>>
>>107818998
OS can optimize loading of shared libraries I think they would still be dupped in memory or maybe it uses some kimd of copy on write or something like that.
>>
Static with LTO is superior. I want to run one video game faster not 8 video games faster.
>>
>>107818973
>Rust
>>
>>107819013
>copy on write
>libraries
>>
>>107818973
this whole imaginary meme about the "OS optimizing shared libraries" is only true for core OS libraries such as kernel32 and user32 and so on. Any DLL that's used in an application which isn't an OS DLL is already going to be duplicated purely for compatibility reasons.
Trying to share non-system libraries just isn't practical, and that's why Linux has such a DLL hell situation.
>>
>>107818973
If your "app" loads 200MB of anything just to start up, I will mail you a bomb. A zip bomb. In minecraft.
>>
>>107818973
>ram shortage
I love how every retard suddenly wants to buy RAM all of a sudden... right during a price hike... as if they actually need it. Literally women toilet paper logic.
>>
>>107818997
>he doesn't know about %systemroot%\WinSxS
>>
>>107818998
>>107819013
In the case of windows, there’s a bunch of shit in going on in the background to load the right version of the DLL, unless it’s already bundled with the application. I’m not that familiar with Windows on that front though, I’m just aware that they resolved “DLL hell” by allowing multiple versions of the same DLL to coexist, and they’re loaded some other way than just name. On Linux, it’s loaded by name, and libraries handle maintaining compatibility between major versions themselves.

It also depends on whether it’s runtime loading, or compile time loading. In the former case you just get a handle to the loaded library and query the kernel for symbol locations. In the latter, the kernel will map the library into the specified address spaces in the executables linking info. No copies involved, it just makes not that when the program access X address range, remap the access into the real address space the library sits in. Any program using the library will be using the same code.
>>
>>107819098
t. Never played a video game
>>
>>107818973
>Why does Rust not have libraries?
The rust compiler itself isn't even finished and stable yet, why would they have libraries too?
Plus, rust operates like nodejs and other languages where you create a project and download everything into there and compile everything into one package, C libraries usually are shipped with the operating system, so they can be reused by everyone else.
>>
>>107818973
>>107819796
Rust does have libraries. C and C++ people used to be against dynamic linking and shared libraries because UNIX only had static linking. Dynamic linking was something from mainframe operating systems and Windows that is against the UNIX philosophy. Plan 9 and Go people are still against it.
https://doc.rust-lang.org/reference/linkage.html
>--crate-type=dylib, #![crate_type = "dylib"] - A dynamic Rust library will be produced. This is different from the lib output type in that this forces dynamic library generation. The resulting dynamic library can be used as a dependency for other libraries and/or executables. This output type will create *.so files on Linux, *.dylib files on macOS, and *.dll files on Windows.
>>
>>107818973
i saw this posted inline a couple of days ago. and i thought it was just yet another /g/eet tard. i mean it was. but of course the content wasn't original. /g/eets can't do original.

https://desuarchive.org/g/thread/107806865

i mean, everyone has gaps in their knowledge. but being this clueless about static vs. dynamic linking is quite something.
like, this doesn't even require trying rust. at least build your own shit statically and compare sizes for fucks sake. and get the realization that you only link what you need. at least know that very basic part of the equation. at least have some actual numbers to use as an anecdote. not even having an actual factual anecdote to base your fallacious brain deification on is quite something. it almost rivals /g/eeting.
>>
>>107818973
>200mb of libraries
>rust has no libraries
lmao. these losers can't even lie properly. this retarded faggot has no idea what he's talking about.

>>107820612
> but being this clueless about static vs. dynamic linking is quite something.
welcome to 2026 where schizophrenic losers go onto cringe social media platforms and just lie about anything for attention.
>>
>>107818973
Naming a coding language after a form of decay probably wasn't the best decision.
>>
>>107818973
You can dynamically link whatever the hell you want.
Does it really matter, though? Usually your program won't take gigabytes of RAM because you have some pages of code from a UI library mapped into RAM but because you're using a fucking web browser running JS to show your UI.

Also, thanks to WinSxS, Flatpak and co, most programs that use dynamic linking just combine the downsides of dynamic and static linking for none of the upsides.
>>
>>107820748
it's a C is bad, rust is good shill post by a fucking moron that doesn't understand C or rust. i wish these larping losers of humanity would just fucking die already. they contribute absolutely nothing to humanity while truly believing they're a genius
>>
>>107819925
You almost never want dylib. You want cdylib.
Rust doesn't really have a stable ABI so even Rust programs linking to your dylib will eventually break in unexpected ways.

This sucks really bad of course because exposing a C ABI compatible library makes you lose most of Rust's benefits.
And that's why almost every Rust library just links statically.
>>
>>107820790
>And that's why almost every Rust library just links statically.
friend sent me his rust program that had a gui with text editor: 100mb. i can write the same thing using opengl and C, all statically linked: few hundred kilobytes for exe. rust trannies are literally insane and think 100mb for an exe is fine yet you can static link all day with c and not even get close to a fraction of that.
>>
>>107819534
No video game is going to share load assets with another video game in the way dynamic libraries do.
>>
>>107820824
>100mb
Skill issue
>>
>>107820824
You don't get binaries that fuckhuge in Rust unless you're fucking retarded.
If you associate with people like that, you must be retarded as well.
>>
>>107820839
>>107820840
>rust tranny not coping very well with the shill thread gone wrong and people that know how this tranny language works won't stop slapping them
livestream suicide when?
>>
>>107820847
What?
>>
>>107820853
The guy's off his meds. He can't help himself.
Nobody cares enough about him to make him take them.
>>
>>
>>107820736
Just like github lol.
>>
>>107818997
>qt
>boost
ngmi
>>
>>107820864
>rust tranny mental breakdown time
it's always great to see threads where chad programmers, that know how languages work, turn rust shill threads into a comical farce because rust tranny's are the most delusional and hilarious liars that can't even lie properly. couldn't lie straight in bed.
>>
>>107819013
cow pages are for forks. for mmaped files like libraries I think it's just many owners to the same files paged into memory. they both use the same concept of having the mmu show the same physical page to many virtual pages.
>>
>>107820947
Why do you really hate Rust? Rust is made by people with more C and C++ experience than you will ever have.
>>
>>107820853
Bak2skool.Lrn2read.
>>
File: rewrite-in-rust.png (285 KB, 642x762)
285 KB
285 KB PNG
>>
>>107818973
>a ram shortage
It's not like they're taking the RAM right out of your computer. Yet...
>>
>>107823694
why wouldn't you resell your ram for 5x what you paid? i can do with no rust apps.
>>
>>107820918
All of Qt6 and Boost combined is 90 MB. your point?
>>
>>107819205
do you seriously use windows? LOL
>>
>>107820947
are you ok?
>>
>>107818973
wasn't that retard saying a while ago the "unused ram is wasted ram" meme due to its monitor background program loading every pape all at once?
>>
>>107818973
Rust and c++ have no stable ABI, making libraries cludgy.
>>
>>107824102
Why would you sell something you're using regularly? I mean I guess I can understand why if you're in such an unfortunate financial situation that you really need the money, but other than that people generally don't sell things they use.
>>
>>107818973
>caring about this
Why? CoW is behavior you cannot rely on and can be a detrimate if your library has a lot of mutable state. Instagram wrote about how they had to tweak cpython so GC behavior wouldn't cause a massive blow up in memory when the pages get deduped in write.
Just buy more fucking memory. Monomorphisation and LTO are better for performance anyway.
>>107825250
Well... C++ ABI is kind of a complex thing. Usually your std impl will have some stability in layout for types like array and vector and what not. It's not worth depending on, but some people do. C++ isn't a monolith like Rust.
>>
>>107820824
You can't statically link an UMD retard.
>>
>>107824515
>All of Qt6
>90 MB
lmao 90 MiB doesn't even cover qt6-webengine.. alone.. without dependencies
>>
>>107820612
Holy shit. That retard soundboards off /g/ before xitting his retardation to his fans?
>>
>>107818973
You can link dynamically in rust.
Literally a non issue.
>>
>>107819013
It's complex. While that is possible, one problem you have to contend with is side-channels. Two distinct programs can bypass memory protection by using cross-process page dedup as a side-channel. Usually such dedup only happens on processes in the same process tree for this reason.

Linux has some kernel "daemon" that can do whole memory dedup, by the way. It's a bit strange honestly.
>>
>>107820790
>Rust programs linking to your dylib will eventually break in unexpected ways.
>implying it isn't also the case with C
Lol



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.