Details
-
AboutAAAAAAAAAAAAAAAAAAA
-
SkillsRust and other things
-
Locationhere
-
Website
Joined devRant on 12/8/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
@kiki Here's the actual version:
Communism: you have two cows. Because you dared having someone not everyone has, the communist agitators rile up the indoctrinated townsfolk so that they lynch your family and rape your wife
The two cows are taken by the bureau and put into a communal form. Due to corruption and mismanagement the cows starve to death before ever producing any milk
After waiting for 4 hours in line you notice that there is no more milk available, so you have to go hungry another day -
> and get everyone unconditional free milk
Surely... -
Sounds like you've got your priorities in order
-
@CoreFusionX Depends on the definition
I know zero cost abstractions as "you couldn't write it any better by hand"
In that sense bounds checking are zero cost abstractions if that's what you wanted, and it's pretty much always what you want. Seriously, branch predictors are really good so bounds checks cost like 1% of performance even in the worst case which is very array heavy code
Do note that Rust doesn't force bounds checks, you are free to use the unsafe methods if you know what you're doing.... probably not a good idea most of the time though -
Sometimes it can be really great for finding stuff since you can just explain your idea in plain english unlike on google
But it's mostly just good as a quick encyclopedia, I don't trust much of the math or code it gives me -
@CoreFusionX Sure, but that's what I'm saying. Both Rust's and C++'s zero cost abstractions aren't always zero cost if you don't know how to use them properly
-
Not using the latest gulp -> webpack -> rollup -> esbuild -> vite pipeline 🤦♂️
-
Because the world isn't black and white
Sometimes a little nuance goes a long way -
@lorentz LLVM apparently sucks at optimizing it and Rust hasn't put any effort in optimizing it at the IR stage
But yeah, it really shouldn't be too difficult -
@CoreFusionX The compiler can't always prevent stuff like that since sometimes it's in the semantics of the program
E.g. if you return a string as const, the compiler HAS to copy it, it can't move from it -
@Demolishun Basically the same, but like I said, I'm not sure you can make it much better
Normally the bottleneck is pause times. But if it crashes because of memory usage there's really nothing even a literally magic gc like shenandoah can do
(for real though, look up the shenandoah gc, it's actually black magic. Sub millisecond pause times regardless of heap size.... literally how) -
@Demolishun The java vm the ide runs in. Under Help > Edit VM Settings and Help > Change Memory you can turn up the memory and tune the gc
Though I'm not sure it'll help if it's already overflowing the mem to swap lol -
Have you tuned the vm settings?
-
@lorentz I mean... you could also just use a type alias
C++ and Rust are really similar when it comes to generated machine code. Both are suboptiomal for a lot of very specific reasons
In Rust for example a for loop over an inclusive range like 1..=10 can be quite a bit slower since it has to guard against overflow
In C++ you can get bad codegen if you use std::move where you shouldn't because I think that prevents named return value optimization
Fun! -
What part of Option<Arc<Vec<Option<dyn Foobar + Send>>>> did you not understand
-
Scheibenkleister
-
Is this real chat
-
@Demolishun I read the Rust reddit fairly actively and I can't say I have ever seen political activism (though my memory isn't that great)
Only pretty drama every now and then -
@Demolishun Not using Rust because some people are idiots is extremely foolish
Not to mention that Rust is one of the lesser political communities. Rust never had a BLM or feminism or whatever banner on any of their websites like Go and SASS did. They don't have any DEI programs or shit like that. Even their reddit (with reddit being as insufferably left wing as possible in general) isn't political at all. There's no rainbow flags or nothing
I think you have a seriously false impression -
@jestdotty Rust is used in crypto but I think it's only a small part of the rust community. Rust is used a lot where C++ makes sense, so more low level stuff like load balancers, databases, game engines
Dropbox and Cloudflare have a bunch of their backbone infrastructure in Rust for example -
@jestdotty But if it smells good I don't see the problem
-
@jestdotty You're already taked about you hate going to other languages due to some of the things Rust does great
Don't pretend ;) -
@MM83 Rust's pretty great but also frustrating some times
Still my favorite language by far, it's so beautiful -
@MM83 Wrong
(queue trump clip) -
I know this doesn't help much but when you're wrapping a bunch of stuff in mutexes, it's often not a great idea
For very multithreaded code I think a more actor-ish approach works best where you send "messages" to each other instead of locking global datastructures
For less multithreaded code it's often best to have your data be owned by a "context" object or something inside a slotmap and only reference the objects with indices. This way, instead of Arc<Mutex<T>>, the ownership is so much simpler since it's now all just dependent on the context object. Then you can pass that context object as a reference down the call stack
Doesn't always work of course, but just some of my thoughts. Code architecture in Rust is hard! -
The reddit is very active unlike c++
-
@cafecortado carrier grade nat? If so, did you try calling them? A friend of mine had the same issue and they just disabled it for him so now he has a proper ipv4
-
Aw that's sweet
-
uefi was SO CLOSE to being a good idea
But then microsoft and intel were involved
And then it wasn't a good idea anymore -
And let's not even get started on COM interfaces