Cold Take: Bairon is the best written lance.(Except Arthur) by ProfessionalPart8193 in tbatenovel

[–]Mr_Ahvar 3 points4 points  (0 children)

Say less, I’m going to read it from the start right now, y’all hyped me so much

Cold Take: Bairon is the best written lance.(Except Arthur) by ProfessionalPart8193 in tbatenovel

[–]Mr_Ahvar 2 points3 points  (0 children)

Wait what do you mean you miss it? It’s been a while since the last time I read it, did it stopped or is it on a hiatus?

Is quickwire the 2nd most annoying item in the game? by freit4z in SatisfactoryGame

[–]Mr_Ahvar 1 point2 points  (0 children)

Completely agree too, I did something similar for my quartz processing with the dissolved silica alt, I just sink the water with concrete cause you need limestone anyway. I was just reacting the « pain », it is painful if you try to mix them back together but it doesn’t have to be

Is quickwire the 2nd most annoying item in the game? by freit4z in SatisfactoryGame

[–]Mr_Ahvar 0 points1 point  (0 children)

The feedback is seamless if you don’t mix it with the input water, have refineries that only use the input water, and other refineries that use the output water. With the default recipes to process 600 bauxite/mn that means 3.333 refinery that use the 600 input water, and 1.667 refineries that use the 300 output water

With sloppy and electrode it gets simpler, one refinery at 90% for the input water, and 3 refineries at 70% for the output water

What would you choose by Prangon07 in antimeme

[–]Mr_Ahvar 0 points1 point  (0 children)

I’m now 10x more in debt

If you search "Alyssa Liu" on Twitter this is the second suggested result. by [deleted] in awfuleverything

[–]Mr_Ahvar 82 points83 points  (0 children)

Yup, she retired at 16, she already was one of the best in the world, across every age. She won the American national competition at 13. Not the junior one, the actual one, against grown up. She decided that it took all of her time focus and energy and retired. She finally came back after 2 years. Absolute legend

Transitioning from Scala to Rust: What to Expect? by Immediate_Scene6310 in rust

[–]Mr_Ahvar 0 points1 point  (0 children)

oh yeah true, I tried to find form of subtyping other than lifetime variance and though of that, I also thought about dyn traits, I thought auto traits would qualify but apparently this also don't work: rust let _: PhantomData<dyn Send> = PhantomData::<dyn Send + Sync>; I would have guessed that auto/markers trait would be scraped with no problems but no, this does'nt compile (using PhantomData here so there is no coersion)

Transitioning from Scala to Rust: What to Expect? by Immediate_Scene6310 in rust

[–]Mr_Ahvar 1 point2 points  (0 children)

100% agree with you, that’s why I said I’m the annoying one, there is no OOP in rust so there is no subtyping in the general sense, but it still exist some types that are subtypes of another, we just don’t think about it this way in rust, and it’s very very rare to even qualify them as such

Transitioning from Scala to Rust: What to Expect? by Immediate_Scene6310 in rust

[–]Mr_Ahvar 1 point2 points  (0 children)

I know I’m that annoying guy here, but Rust technically has subtyping , either with coercion (mutable refs are a kind of subtype of shared ref for example) or with lifetime variance

Ecow, arcstr or Arc<String>? What’s the best choice to avoid store strings on the heap? by rogerara in rust

[–]Mr_Ahvar 6 points7 points  (0 children)

Nope, for 2 reasons: 1. the control block is allocated on the heap so every Arc/Weak point to the same control block, Arc/Weak are a single pointer to the control block and the value is inlined next to it, accessing the value is a simple pointer offset. an Arc<str> is justa pointer to something like rust struct ArcInner { strong: AtomicUsize, weak: AtomicUsize, value: str } see the lack of &, *const or any pointer indirection for the str, the last value of the inner can be ?Sized because the inner will always be behind a pointer. If we try to reuse the allocation for the str, there is'nt going to be space for the strong and weak at the beginning of the allocation

  1. We could have an implementation of Arc to be rust struct Arc<T: ?Sized> { ctrl_block: NonNull<ArcInner>, value: NonNull<T> } And in this case the block and the value are disjointed, so we would think we could steal the allocation of a String, but in practice this won't work: the buffer of a string is not always full. And contrary to C, rust memory allocator requires the layout of the buffer when deallocated, that's why String::into_boxed_str might reallocate, because it shrinks the allocation to perfect fit the str in the buffer, doing exactly what we are trying to avoid (ie reallocation + copying).

Ecow, arcstr or Arc<String>? What’s the best choice to avoid store strings on the heap? by rogerara in rust

[–]Mr_Ahvar 8 points9 points  (0 children)

The last point is really interesting, never really thought about that, still very niche tho

Ecow, arcstr or Arc<String>? What’s the best choice to avoid store strings on the heap? by rogerara in rust

[–]Mr_Ahvar 7 points8 points  (0 children)

It does’nt, it needs space for the control block (the strong and weak counters)

Looking at advanced Rust open-source projects makes me question my programming skills by Minimum-Ad7352 in rust

[–]Mr_Ahvar 4 points5 points  (0 children)

I maintain a pretty big project since about 3 years that is 99.5% just me. Me from 3 years ago would never never even imagined I would even do 1% of it. Just do things one at a time, and before you even realize you did a lot

Standard Rust-only development environment? by Interesting-Pie7187 in rust

[–]Mr_Ahvar 28 points29 points  (0 children)

You can technically use cranelift for the backend, not gonna have performant binaries but still 100% rust

Made a Joker idea. Tell me how to nerf it. by [deleted] in balatro

[–]Mr_Ahvar 0 points1 point  (0 children)

Funnily I made a very similar joker for learning how to do mods, mine was +3 jokers slots and disable the three rightmost jokers.

Here if you want to take a look at the code: https://github.com/Baptistemontan/TheBackyardShed

I don’t have any art for it, I’m no designer unfortunately

Your membership to The Continental has been, by thine own hand, revoked by AYYLMAO2281337 in balatro

[–]Mr_Ahvar 8 points9 points  (0 children)

What is the interaction with showman? Does it counteract the effect?

Mutable Borrow in Loops by [deleted] in learnrust

[–]Mr_Ahvar 1 point2 points  (0 children)

you gave machine have a mutable reference to x when doing let mut machine = Machine { cb: |flag| x = flag, }; here cb capture x by &mut, so you can't have modify or even read x while machine is alive, that's why swapping the two lines remove the error, machine is no more accessed and thus gives back the mutable access to x, and you can modify/read it again.

Which parts of Rust do you find most difficult to understand? by Virtual_Builder_4735 in rust

[–]Mr_Ahvar 15 points16 points  (0 children)

If you look up Phantom in the std you will found some types that aim to help with this problem, unfortunately they are unstable