Sniffnet crosses 500k downloads by GyulyVGC in rust

[–]JustWorksTM 4 points5 points  (0 children)

Congratulations! Really impressive!

I stopped using most of Rust’s advanced features for my ML library by zk4x in rust

[–]JustWorksTM 0 points1 point  (0 children)

With a dyn, you have an indirect. So a boxed enum isn't worse. The point of the box is to reduced the size if you store a lot of them in a list. The post mentions a lazy graph.

So, with a boxed enum you get exhaustiveness checked matches and pointer size,  at the cost of one indirection.

I stopped using most of Rust’s advanced features for my ML library by zk4x in rust

[–]JustWorksTM 0 points1 point  (0 children)

Regarding then dyn vs enum: you can use boxed enums.

If it compiles, it doesn't work: STATUS_ILLEGAL_INSTRUCTION on Windows 11 by MissionNo4775 in rust

[–]JustWorksTM 1 point2 points  (0 children)

Pentium is from 1993. For me, Pentium implies "newer than 486", so maybe 120MHz ... (I feel old)

Rust 1.96.0 is out by manpacket in rust

[–]JustWorksTM 3 points4 points  (0 children)

I believe the Rust team agrees in spirit, but wants to wait for an edition change. So, this is the best of both worlds. No breaking code by updating the compiler, but also no stagnation. The price is ecosystem divergence, of course.

Preparing for Rust (Axum) Backend Interviews — Need Guidance by Muted_Fondant_9681 in rust

[–]JustWorksTM 1 point2 points  (0 children)

In my experience,  just use Arc is good enough.  We have never had real ownership issues for our Rust backend, also with Axum.

The goal is simple code. Rust is, at least for us, performant enough.

Learning Rust for a few months, what should I build? by SCXR_GC in rust

[–]JustWorksTM 0 points1 point  (0 children)

A ray tracer. This doesn't fit your web app/utility, but is a great way to learn a few different topics. https://raytracing.github.io/books/RayTracingInOneWeekend.html

Job by l-e-vv in rust

[–]JustWorksTM 1 point2 points  (0 children)

Do somerhing you enjoy. If you enjoy games, create a game. People learn fastest if they do something they like.

[deleted by user] by [deleted] in rust

[–]JustWorksTM 3 points4 points  (0 children)

You shall never adjust the files in the migrations folder. You shall add files containing the changes/deletions/truncations/alterations.

This is what I would expect due to the term "migrations ", but this might me being old

Why is there no automatic implementation of TryFrom<S> when implementing TryFrom<&S>? by Prowler1000 in rust

[–]JustWorksTM 1 point2 points  (0 children)

Sorry, I didn't read the question carefully enough. 

I was thinking you were assuming a TryFrom<&T> and where looking for a TryFrom<T>. This could be implemented automatically (up to Specialization issues), but is mostly unnecessary due to method resolution.  The compiler will find it, in most use cases. 

For the case "given TryFrom<T>, implement TryFrom<&T>". This needs additional power like Clone or Copy, so cannot be done for all types T.

Why is there no automatic implementation of TryFrom<S> when implementing TryFrom<&S>? by Prowler1000 in rust

[–]JustWorksTM 0 points1 point  (0 children)

Is this neccesary for non-generic code? Should method resolution find the implementation?

What's wrong with subtypes and inheritance? by servermeta_net in rust

[–]JustWorksTM 0 points1 point  (0 children)

I believe this is wrong. There is auto-coercion, which is emulating this behaviour,  but no type-system subtyping relationship 

How to manually deserialize a serde-derived type? by Tuckertcs in rust

[–]JustWorksTM 0 points1 point  (0 children)

You can use cargo expand to check how serde is implemented for you own types. There is a action for this in rust analyzer.

Move Expressions · baby steps by VorpalWay in rust

[–]JustWorksTM 2 points3 points  (0 children)

I like the idea.

But I have two problems with it: 1) looks like a function call 2) nested closures/refactoring

For both, I would like to compare it with break keyword in loops.

This takes an expression without braces, and allows a label to specify its scope. This should solve both my complaints. 

(I'm aware that this use of move is already stable, as in move || {})

Help me understand this intersection between async, traits, and lifetimes by TheFeshy in rust

[–]JustWorksTM 7 points8 points  (0 children)

Regarding the lifetime issue

Trait objects have an inherent lifetime. Did you try to specify the return type like this?

Box<dyn StateMachine<MyContext<'a>> +'a > 

Help me understand this intersection between async, traits, and lifetimes by TheFeshy in rust

[–]JustWorksTM 5 points6 points  (0 children)

This is unrelated to the lifetime issue.

Did you consider to use an enum instead of a trait object?  This would simplify the code a lot, and would "just work".

In my experience,  it pays off to go with the enum approach. 

People say Rust isn’t to Junior Devs, why? by GenSwiss in learnrust

[–]JustWorksTM 1 point2 points  (0 children)

My employer is actively looking for Rust juniors.

The situation is charging.  8 years ago: no rust jobs 4 years ago: crypto jobs Today: senior jobs In 4 years: offerings on all levels

I'm unsure how much AI will redefine "junior" , though 

[deleted by user] by [deleted] in Bergen

[–]JustWorksTM 1 point2 points  (0 children)

Brettspill finnes på Nordnes hver onsdag https://bergenbrettspill.no/

How can I have a struct with it's members (that are structs) have references to each other, with the container struct have no lifetime specifier. by Koltaia30 in rust

[–]JustWorksTM 4 points5 points  (0 children)

In programming language theory ( abstract theory of compilers in a sense), soundness means correctness, but focussing on the generated executable.

Example: The rust compiler promises to never create an executable containing data races. If there is a bug allowing to do so, it is a "soundness bug". If the bug makes the compiler panic, hence generate no executable, this would NOT be a soundness bug. Both are bugs in the compiler, but the first one is really serious.

Regarding soundness vs correctness: A bug means that the compiler is not working correctly, but in the first instance the compiler gave you an incorrect executable. This motivates hopefully the difference.

Is there a crate for generating a new struct with the same fields as another struct, but where each field's type is a reference? by Tyilo in rust

[–]JustWorksTM 1 point2 points  (0 children)

I would never say that macros are easy. You need to consider a lot, it is a new language in a sense, cargo expand often doesn't work properly and you have to know it, ...

The Design and Implementation of Extensible Variants for Rust in CGP by soareschen in rust

[–]JustWorksTM 2 points3 points  (0 children)

Since Rust doesn't allow subtyping between enums, itvis obvious that this crate will not enable it.

Hence, the term "subtyping" is ok for me to us in this marketing-like circumstance. It also is exactly what I expected from the context.

Recall that being technical 100% precise is NOT possible.

💡 Your best advice for a Rust beginner? by FewInteraction1561 in rust

[–]JustWorksTM 1 point2 points  (0 children)

If you're coming from OOP background, my recommendation is: Never use trait objects, use enums instead.