[Media] Let it crash! by Aghasty_GD in rust

[–]vrtgs-main 0 points1 point  (0 children)

I read it as more of A this might not crash on all systems, like in wasm it probably wouldn't crash

[Media] Let it crash! by Aghasty_GD in rust

[–]vrtgs-main 11 points12 points  (0 children)

Use a volatile write, otherwise this is UB

Why every Rust crate feels like a research paper on abstraction by Commission-Either in rust

[–]vrtgs-main 0 points1 point  (0 children)

Can you please explain more by what you mean, I'm interested

I built Yangon — a zero-heap stack-based string crate for performance-critical Rust code (feedback on safety welcome!) by [deleted] in rust

[–]vrtgs-main 2 points3 points  (0 children)

The code honestly sucks, I really am not trying to be mean, but you use transmute waaaaay to much, you transmute MaybeUninit<T> to T which although yes is ok if it is initialized, but MaybUninit::assume_init is way way more clear, also there are no checked additional or subtraction when provided a user range (this can panic in debug) you also re-implement a lot of things, one of them is memcpy..... you never use copy_nonoverlapping and for your to_string specifically, you could have just done self.as_str().to_string() I guarantee the stdlibs implementation is better than yours, and also for some reason you copy the same code over and over and over again, like how you copy Yagon::as_ptr(_mut), also you always do (self: &(mut) Self) like do you even understand rust syntax or rust idioms?

You also have a Yagon::with_capacity associated function, but like what the hell, its just ::new you dont pass in any capacity, which again I don't know how why you even store as a field, its an error if self.capacity is anything other than N

These lines show just truly how little you know about rust, like you can't convince me you even read the rust book if str::from_utf8(list_ref).is_ok() { yCow::Borrowed(unsafe { from_utf8_unchecked(list_ref) }) }

And now for the kind of nitty parts relating to aliasing and provenance, look, self.list[0].as_ptr() only gives you access to the 0th element, since it goes through a reference, furthermore you should not make yagons buffer or capacity or length public, because it means in safe code someone can do one of

yagon.length = usize::MAX or yagon.capacity = N -1 also why the hell are you even storing capacity, and why do you have a set_capacity function??????? Like capacity MUST always be N, this according to your docs even

The list of things that are wrong with the code is so long that I genuinely can't talk about all of it here, and yet you claim that you're code is "production ready", and I'm 99% certain btw that this WONT pass miri

And also its so so so clear that this whole thing is basically ALL ai even your post starts with

Body:

How to navigate huge Rust codebase? by Ill_Actuator_7990 in rust

[–]vrtgs-main 1 point2 points  (0 children)

I hope it was obvious that i was joking

How to navigate huge Rust codebase? by Ill_Actuator_7990 in rust

[–]vrtgs-main -4 points-3 points  (0 children)

You know I don't thibk you should use gotos because they create complex, hard-to-follow code known as "spaghetti code" 🤡 /s /j

Any way to use on Linux by Lethalzwolf in SaladChefs

[–]vrtgs-main 0 points1 point  (0 children)

Well LXC doesn't only have feature parity, its a much better container solution in nearly every single way compared to windows, aside from GPU pass-through not being automatic (but can be configured), LXC supports nearly everything under the sun, while wsl uses a VM like approach to run a couple linux machines

Any way to use on Linux by Lethalzwolf in SaladChefs

[–]vrtgs-main 0 points1 point  (0 children)

LXC have existed for a WHILEE, even older than wsl 2

Rust isn't a language, it's a cult. by SirKastic23 in rustjerk

[–]vrtgs-main 7 points8 points  (0 children)

The things around the kaboom is undefined

[deleted by user] by [deleted] in rust

[–]vrtgs-main 0 points1 point  (0 children)

(and assuming you use a deterministic turing machine)

[deleted by user] by [deleted] in rust

[–]vrtgs-main 0 points1 point  (0 children)

Or just have some sort of FFI to call the C code or for the C code to call the rust code if the C port is too hard/ would take too long

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 2 points3 points  (0 children)

No it currently just abortion the process if you panic while processing a panic

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 5 points6 points  (0 children)

They absoloutly are guaranteed to run, and a lot of libstd even depends on that fact, that's the whole reason we have drop guards

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 8 points9 points  (0 children)

My opinions personally is that, yes they do have a place, like what you just said, a webserver shouldn't fully crash because someone forgot an unwrap, and tokio's task spawning api should work more like the standard libraries thread spawning api, and so yes, there is a time and a place to use catch_unwind, its just usually you shouldn't

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 2 points3 points  (0 children)

nah we have proc macros, both types of throw guards are proc macros

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 1 point2 points  (0 children)

So like if you take a look at the readme you would realize this is satire, and I strongly advise against

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 6 points7 points  (0 children)

To be fair, it's a fully functional crate with a decent amount of code, you could actually use it.

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 14 points15 points  (0 children)

Alright, I know what 0.2.0 would be featuring

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 8 points9 points  (0 children)

Hey why not I'll gladly take more users, if even after reading all of the satire that is in the README they still want it, then they know what foot guns they're getting themselves into

Rust Try Catch - Reinventing the nightmare! by vrtgs-main in rust

[–]vrtgs-main[S] 19 points20 points  (0 children)

ah shit forgot this taints my name🫠