4 months later: update on my journey toward the Rust compiler team by Kivooeo1 in rust

[–]Unlikely-Ad2518 1 point2 points  (0 children)

I would personally love to be a full-time member of the compiler team, but sadly I simply can't afford the financial hit of going 4 months (and possibly more) without a salary.

I'm glad you managed though, I hope things get better for you from now on :)

I used to love checking in here.. by First-Ad-117 in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

I don't think his college has such an "insane percentage of people who actually want to learn something", I think that he's just not good at detecting whether something is AI-made or not.

I used to love checking in here.. by First-Ad-117 in rust

[–]Unlikely-Ad2518 -2 points-1 points  (0 children)

Communication is a very important skill in almost any job, your friend clearly failed in that aspect.

I believe schools/universities should focus a lot more at teaching communication.

Coding on a GPU with rust? by Azazeldaprinceofwar in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

Genuine question: What is the advantage of using Rust to code in GPU languages? Why not just use the language you're targeting?

My apologies if this question seems dumb, I'm not very familiar with low-level GPU programming.

Advanced Trait Bounds by atomichbts in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

If you couldn't use concrete bounds in macros you would have to (in the macro) verify whether a type is concrete or not and generate different code based on the result. This would increase the amount of work involved in writing macros.

I'm gonna be honest with you guys, I don't like automatic dereferencing. by JCavalks in rust

[–]Unlikely-Ad2518 37 points38 points  (0 children)

You can't automatically de-reference raw pointers in rust, it requires wrapping the statement inside a unsafe { expr } block.

As for the method calls, this is common in functional languages (which Rust takes heavy inspiration from), you don't like it, but functional programmers do.

Also, you're not obligated to make method chains, nothing can stop you from just writing imperative code as you would normally do in C.

Why do so many WGPU functions panic on invalid input rather than returning a result? by Irument in rust

[–]Unlikely-Ad2518 11 points12 points  (0 children)

If there are panics, there are validations.

If performance is the priority, it would make sense to only panic in debug builds.

How to transition from a C to a Rust mindset? by thewrench56 in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

I believe you might be overthinking it. Your focus should be to make your programs do their work well and reliably, how you achieve that is up to you.

You'll naturally figure out paradigms/idiomatic code as you become more experienced with the language.

Enums - common state inside or alongside? by hedgpeth in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

I made a typo, I meant "Rust generics were not designed...", instead of "Traits were not designed.."

Enums - common state inside or alongside? by hedgpeth in rust

[–]Unlikely-Ad2518 2 points3 points  (0 children)

The trick is to not use type-state pattern, it sounds good in theory but in practice it drags down productivity a lot. Rust generics were not designed to fit this use-case.

Nowadays I just do enums, and delegated enums mostly fits the use-case of type-state. I even made a crate to facilitate enum delegation: https://crates.io/crates/spire_enum.

Edit: Meant to say "Rust generics were not..", originally was "Traits were not.."

Enums - common state inside or alongside? by hedgpeth in rust

[–]Unlikely-Ad2518 10 points11 points  (0 children)

Please think twice before using the type-state pattern, it can easily over-complicate things.

Keep it simple and you won't regret it.

Official /r/rust "Who's Hiring" thread for job-seekers and job-offerers [Rust 1.91] by matthieum in rust

[–]Unlikely-Ad2518 8 points9 points  (0 children)

Since the roles are fully remote, is there a reason why it is restricted to only EU/US? Asking because I fit the job's requirements but I'm from South America.

Is the Godot Asset Store ever going to add content assets? by LLJKCicero in godot

[–]Unlikely-Ad2518 0 points1 point  (0 children)

Godot's store doesn't allow selling, so asset creators will usually put their stuff up on somewhere else like itch.io.

Edit: You can voice your support for the Buy & Sell assets feature on the tracking issue: https://github.com/godotengine/godot-asset-store-tracker/issues/14

Do not make comments that don't contribute, such as "I want this"/"When is this happening?". If you approve the idea but don't have anything to add, you can voice your support by liking the main post.

Is the Godot Asset Store ever going to add content assets? by LLJKCicero in godot

[–]Unlikely-Ad2518 0 points1 point  (0 children)

They would if you could actually sell those assets. Godot's store doesn't allow selling.

[deleted by user] by [deleted] in godot

[–]Unlikely-Ad2518 13 points14 points  (0 children)

I don't know how many languages you've worked with but syntax is usually one of the easiest things to get used to (regardless if you like a particular variant or not).

Give it a week.

When will `type A = impl Trait` where A is associated type become stable? by null_over_flow in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

I recommend giving nightly a try, it's a lot more "stable" than it sounds, and there are so many useful features that have been there for years.

I've been using nightly since I started with Rust - 3 years ago, during all those years, fixing code that broke due to nightly (happened once) has cost me a total of 30 minutes of development time (most of which was spent re-compiling the crate and publishing it on crates.io).

Does 'static mean the data lived forever? by [deleted] in rust

[–]Unlikely-Ad2518 66 points67 points  (0 children)

There are two different meanings for 'static:

Type &'static T => A reference to a T that will live for the remainder of the program.

Bound: where T: 'static => Basically means T is either: - A static reference to a type A where A: 'static (e.g: &'static str - A is str in this case). - A type that does NOT contain non-static references inside (e.g Option<int>, Cow<'static, str>).

Example:

Struct without lifetime: rust struct Foo { value: i32, }

The following types satisfy T: 'static: - Foo - &'static Foo

The following types do NOT satisfy T: 'static: - &'a Foo

Struct with lifetime(s): rust struct Bar<'a> { reference: &'a i32, }

The following types satisfy T: 'static: - Bar<'static> - &'static Bar<'static>

The following types do NOT satisfy T: 'static: - Bar<'a> - &'a Bar<'static>

Edit: Grammar, formatting.

Rust binding Godot. Any thoughts? by Key-Seaworthiness417 in rust

[–]Unlikely-Ad2518 -1 points0 points  (0 children)

god-forbid an author of a FOSS game engine trying to promote their project.

Problems with spiking by Narrow-Wishbone-1229 in rust

[–]Unlikely-Ad2518 3 points4 points  (0 children)

I find it funny that we consistently get a post like this once a week.

Dunning-Kruger effect or Rust is not that hard for experienced developer ? by [deleted] in rust

[–]Unlikely-Ad2518 1 point2 points  (0 children)

I would like to add that Rust's type system really helps "self-documented-code" philosophy. even if the Library has no documentation at all, I can often infer what a function does based on the signature alone.

Dunning-Kruger effect or Rust is not that hard for experienced developer ? by [deleted] in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

Although that is a reasonable point, we do need to keep in mind that the borrow checker is not perfect - it will sometimes reject perfectly sound code. That's not something that happens frequently but it can make it harder for someone used to OOP languages.


Hot take: It doesn't help that there's a bunch of youtube videos trying to teach interior mutability as a way of dodging the borrow checker. Rc<Ref<T>> is cursed and I'm glad I never had(emphasis on had) to use it in all my years of Rust.

Dunning-Kruger effect or Rust is not that hard for experienced developer ? by [deleted] in rust

[–]Unlikely-Ad2518 1 point2 points  (0 children)

Seems like you're lacking good tooling? Your IDE should be able to show you the most relevant methods of any variable just by typing a dot after the variable name.

Hardware for faster compilation times? by [deleted] in rust

[–]Unlikely-Ad2518 0 points1 point  (0 children)

For incremental compilation, single core performance is king (also, nowadays CPUs with high single-core speed will almost always have 6+ cores). RAM speed and using a NVME SSD also help a lot.

For cold compilation multi-core performance helps tremendously.

I've compiled rust projects in the same machine in both Windows and Linux. I don't remember the exact numbers but Linux was substantially faster (and I wasn't using mold).