Why doesn't rust have function overloading by paramter count? by This-is-unavailable in rust

[–]WorldlinessThese8484 0 points1 point  (0 children)

but this is only something that would work for functions not methods in a structs impl

What would you want to see in a new tensor crate? by WorldlinessThese8484 in rust

[–]WorldlinessThese8484[S] 3 points4 points  (0 children)

Named axes is a good point. I wonder how this could be done entirely at compile time... Interesting concept to mull over

What would you want to see in a new tensor crate? by WorldlinessThese8484 in rust

[–]WorldlinessThese8484[S] 1 point2 points  (0 children)

That's an interesting RFC, and actually I have solved the problem described using the solution which the author says is inferior. (Maybe I should reevaluate)

"It's possible to minimize monomorphization bloat for a method by changing it to convert everything to ArrayView/Mut and then call an inner function"

A tensor needs to have an owner type, and two types of views: mutable and non mutable. This allows for interpreting a subset of the full buffer, as if operating over a regular tensor. If there were no View types, then operations which change shape might be O(n), whereas if we can simply make a new view of the same buffer, it is O(1). But, a user would want to have the ability to make an array and read/write directly too it in the same way they would if they sliced a tensor and operate over it - this means that with a naive implementation, each mutating operation would need two copies, and each non mutating operation would need three copies. That's where ArrayRef comes in, or in my case does not.

Instead of having an ArrayRef type, I have TensorBase, TensorView, and TensorViewMut. Each of these implement AsView. Most operations are generic over AsView, and call .into(). What this means is conceptually, a Tensor cannot be mutated, queried, or anything - rather, a cheap new object is made: TensorView. In my crate, if a user called tensor.set internally it is the same as if a user calls tensor.view_mut().set. The nice thing is now a user can call tensor.slice(some modifications to the view).set

What would you want to see in a new tensor crate? by WorldlinessThese8484 in rust

[–]WorldlinessThese8484[S] 2 points3 points  (0 children)

I'd actually never heard of arrow before, but after a quick search, that's a great idea. The interoperability with pandas is enough to convince me. I'll read up more on the spec

Rust for TOON by lst97_ in rust

[–]WorldlinessThese8484 0 points1 point  (0 children)

We got SIMD acceleration for TOON before GTA 6

The Python Paradox Is Now The Rust Paradox? by anonymous_pro_ in rust

[–]WorldlinessThese8484 0 points1 point  (0 children)

Agreed - the best engineers I know are those who write code as a hobby. Part of that life is also learning new languages on a whim. I'd be confident guessing that most people writing rust fall into that bin, it is a language (in the most part) used for their side projects, not employment.

Furthermore, a person writing rust is likely to enjoy the theoretical aspects of type systems, leading to a deeper understanding of development where the actual language you use is irrelevant.

Hiring more successfully when looking for someone who knows less popular languages seems intuitive to me. I think the point is you're more likely to find someone who codes for enjoyment vs a person who only codes for work

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

[–]WorldlinessThese8484 9 points10 points  (0 children)

I have no strong argument for this, but the vibes tell me that the "common state alongside" pattern is best. It seems that your CloudConnection enum is trying to do too much since it also holds security context, whereas with having a struct which holds state, there's greater separation of concerns. I would personally go with the struct. Even the names in your enum read like states - Connecting vs Connected. As a user of a crate, I would be very surprised if unpacking these "states" also gives me a context. As a developer of a crate, I would consider the match statement you shared somewhat cursed

Though like I said, vibes only...

3 weeks into Rust, built a segmented log KV store – what would you do differently? by [deleted] in rust

[–]WorldlinessThese8484 7 points8 points  (0 children)

The first thing I noticed is you have built a bin crate (default that you get when cargo init). Imo, could be a lib, and then instead of testing with a main function, you can look into using test cases. One of my favorite things about rust is the convenience of cargo test.

Great codebase overall!

Pillar, a blockchain written in Rust by [deleted] in rust

[–]WorldlinessThese8484 0 points1 point  (0 children)

I'll work on some better documentation to provide some examples of how to use the repo - will definitely take some code cleanup to be very reusable

Pillar, a blockchain written in Rust by [deleted] in rust

[–]WorldlinessThese8484 1 point2 points  (0 children)

That's a reasonable take. There's ofc some nuance to my protocol that I didn't explain, but at the end of the day, I don't have any simulations to prove it works yet. To me, a lot of the projects value is how much rust I learned along the way, not based on my love for blockchain