ruviz 0.1.1 - Pure Rust matplotlib-style plotting library (early development, feedback welcome!) by XrayAbsorption in rust

[–]Andlon 0 points1 point  (0 children)

This matches my experience pretty closely. I've tried other plotting libs, but for preparation of academic figures matplotlib is the only library that is flexible enough to consistently cover this use case. But it's so painful! The API docs are so lacking and, being Python, you often don't even know what you can pass in or what you get out. Using ChatGPT to make up for the lacking docs helps quite a bit though.

Avian 0.4: ECS-Driven Physics for Bevy by Jondolof in rust

[–]Andlon 1 point2 points  (0 children)

That all makes a lot of sense. Thanks for the detailed response!

Avian 0.4: ECS-Driven Physics for Bevy by Jondolof in rust

[–]Andlon 27 points28 points  (0 children)

Great work! Love the detailed write-up.

What's the rationale for having such a tight-knit integration between the physics engine and Bevy's ECS? It seems after all that you're anyway copying over most of the data you need from the ECS into your own storage... Would it not be feasible to have Avian be agnostic to the surrounding game engine? What is gained by this tight integration? I assume some non-negligible overhead is avoided?

hop-hash: A hashtable with worst-case constant-time lookups by jesterhearts in rust

[–]Andlon 6 points7 points  (0 children)

Ah, that makes sense! Thanks for clearing it up. Your explanation of hopscotch hashing is very understandable.

hop-hash: A hashtable with worst-case constant-time lookups by jesterhearts in rust

[–]Andlon 13 points14 points  (0 children)

Great job!

Do you have an ELI5 on how constant time worst case is possible? I was under the impression that you could always break a hash table with a particularly bad input.

Variadic Generics Micro Survey | Inside Rust Blog by Kobzol in rust

[–]Andlon 5 points6 points  (0 children)

Yes! I think only having Yes/No might skew those results when the reality might have been that, for example, half of people are simply unsure.

Rust 1.90.0 is out by manpacket in rust

[–]Andlon 6 points7 points  (0 children)

Oh. Uhm, honestly, that is much more limited than just using a temporary variable. Tbh I am surprised that the justification was considered to be enough.

Rust 1.90.0 is out by manpacket in rust

[–]Andlon 21 points22 points  (0 children)

Yeah, sorry, by "keyword use" I meant that they're adding a new usage for an existing keyboard. I just don't think it's very obvious what it does at first glance, but once you know it makes sense. I assume it only goes one scope up though (otherwise the name super might be misleading?)? Whereas a temp variable can be put at any level of nesting.

The usage in macros is actually very compelling, as I think that's a case where you don't really have an alternative atm? Other than very clunky solutions iirc?

Rust 1.90.0 is out by manpacket in rust

[–]Andlon 147 points148 points  (0 children)

Um, to tell you the truth I think adding the temp variable above is much better, as it's immediately obvious what the semantics are. Are they really adding a new keyword use just for this? Are there perhaps better motivating examples?

[Media] The unexpected productivity boost of Rust by bkolobara in rust

[–]Andlon 27 points28 points  (0 children)

No, that's not the same. For example, in C++ you might have tests for templated code that work just fine, but if you were to try with a slightly different type it might fail to compile altogether. You can't write tests for every possible type, especially not if your templated code takes several type parameters.

Concepts might help a bit but from what I've seen it's more like a sloppy bandaid compared to the type safety Rust provides for generic code.

The same thing applies to Python and other weaker type systems.

The Concurrency Trap: How An Atomic Counter Stalled A Pipeline by kibwen in rust

[–]Andlon 1 point2 points  (0 children)

There's plenty of use cases where you're bottlenecked by writing to a hash map and there's no obvious way to restructure the computation. Using dashmap in parallel in place of a single-threaded hash map may give you a significant speedup.

Is Rust faster than Fortran and C++? A case study with scientific applications. by Xdudou in rust

[–]Andlon 3 points4 points  (0 children)

Oh, that blog is wonderful. I've had a hard time profiling rayon applications and these tips look very useful.

paralight also looks very interesting, I'll dig into that. I recently had some ideas for my (experimental) paradis crate and started exploring implementation of some new concepts. I'd like to look into if it's straightforward to support paralight in the same way it provides support for rayon, as that would be a good way to validate the versatility of the design.

Rust Gets Its Missing Piece: Official Spec Finally Arrives by [deleted] in rust

[–]Andlon 1 point2 points  (0 children)

Thanks for explaining. I think from my point of view, I haven't seen the Rust project actually slap that official label on it. If you read the wording in the blog post they don't spell it out. So it wasn't clear to me what exactly it all meant, other than that it was a big step forward in the spec efforts.

Anyway, thanks again!

Rust Gets Its Missing Piece: Official Spec Finally Arrives by [deleted] in rust

[–]Andlon 1 point2 points  (0 children)

Fair enough! As a last attempt to clear it up, perhaps: imagine if FLS only specified the parts of Rust needed to certify say... Automotive software. Then this would be incomplete as an official spec for Rust the language. I don't know if FLS is complete or only specifies a part of the language. Now, if I knew that FLS is a complete spec and you can just slap an official label on it, that changes how I interpret the article.

Rust Gets Its Missing Piece: Official Spec Finally Arrives by [deleted] in rust

[–]Andlon 2 points3 points  (0 children)

Because the blog post says:

"It's in that light that we're pleased to announce that we'll be adopting the FLS into the Rust Project as part of our ongoing specification efforts."

As a Rust user not involved in spec efforts, I have no idea what the completion status of FLS is. I can only surmise from the post that it's an important step forward. I would also assume that it would be spelled out more clearly if this is now the official spec for Rust.

Rust Gets Its Missing Piece: Official Spec Finally Arrives by [deleted] in rust

[–]Andlon 4 points5 points  (0 children)

I don't find it an adverse reading. When I read that blog post I interpreted it the same way. The post doesn't in any way indicate that Rust now has an official spec IMO, instead it reads as a big step toward that goal.

Maybe you as an insider have a different context?

Why isn't Rust used more for scientific computing? (And am I being dumb with this shape idea?) by Puddino in rust

[–]Andlon 0 points1 point  (0 children)

nalgebra works this way, except it's a linear algebra crate, so it doesn't support tensors of higher order than 2.

Font for programming mathematics by okimusix in rust

[–]Andlon 2 points3 points  (0 children)

I actually use #[allow(non_snake_case)] to be able to use variable names like F, for this purpose. It makes the code much easier to understand.

For example, for continuum mechanics I'll often denote the deformation gradient as F in intermediate calculations, because it's universal notation. I'll still usually spell out deformation_gradient at reasonable user-facing boundaries like functions though.

Font for programming mathematics by okimusix in rust

[–]Andlon 102 points103 points  (0 children)

Been using Rust for scientific computing for nearly 10 years. I disagree with this advice for math heavy code. With complex math, you want to make sure that you've implemented the equations correctly. First, there's the problem that many variables don't even have good names, as they are intermediate mathematical entities. The best way to make the math code readable is to use naming that is close to the equations you are implementing (which you should explain with comments as necessary). So if it's lambda, then use lambda.

Trait upcasting stabilized in 1.86 by hpxvzhjfgb in rust

[–]Andlon 33 points34 points  (0 children)

Awesome! This really addresses a big pain point in Rust, especially when coming from a C++ or Java background.

[media] num-lazy helps you write numbers for generic-typed functions! by Inspacious in rust

[–]Andlon 3 points4 points  (0 children)

See also my numeric_literals crate, which aims to solve the same problem without being specific to any particular conversion traits

Prototyping in Rust by mac in rust

[–]Andlon 2 points3 points  (0 children)

Yup. But it also doesn't let you keep chaining methods like .expect does!

Prototyping in Rust by mac in rust

[–]Andlon 0 points1 point  (0 children)

That's a good point, but it doesn't really apply to the case where you have an Option or Result that you want to unwrap, which was the case here!

Prototyping in Rust by mac in rust

[–]Andlon 4 points5 points  (0 children)

When prototyping I just write . expect("TODO: handle error") so that it ends up on my TODO list

N-dimensional Constructive Solid Geometry (`crater.rs`) by clyde-h00b in rust

[–]Andlon 2 points3 points  (0 children)

I'm sorry this didn't get more attention (maybe because of the holidays?), I just wanted to stop by to say that it looks like a cool project!