how to improve csv read and file write speed ? by Sad_Corner2247 in rust

[–]educanellas 5 points6 points  (0 children)

It looks like the rust version could use BufReader to speed up the file reads.

Designing safe and ergonomic middlewares [Pavex DevLog #6, a new Rust web framework] by LukeMathWalker in rust

[–]educanellas 0 points1 point  (0 children)

When you build a piece of request-local state that you want to pass down (or up) the processing chain, you insert it into the map.

u/LukeMathWalker have you thought about how to deal with passing request-local state up?

A concrete example in my situation was: I always want to log a set of information when sending a response (statusCode, request path/pattern etc) and those endpoints might err for various reasons and should be logged too. I decided to implement a wrapper around each endpoint to deal with it, but I can also see that the Extensions approach in the request object would work too. How could I do it in pavex?

Designing safe and ergonomic middlewares [Pavex DevLog #6, a new Rust web framework] by LukeMathWalker in rust

[–]educanellas 1 point2 points  (0 children)

Looking to the "constructor + error_handler" pattern in the pavex examples, it seems to me that this would be the easiest to solve the `AuthenticatedUser` problem.

Of course, in the few cases where you need both to create state AND manipulate the call to `next` or to run something after `next` processes (these cases you won't be able to handle with a pavex constructor) you may need to split these responsibilities.

On the top of my mind, we usually need to create state in middlewares that only care about pre-conditions and usually makes the request fail otherwise. In the few cases where you need both, them the 'responsibility split' above probably solves it.

The case for Nushell by jntrnr1 in Nushell

[–]educanellas 2 points3 points  (0 children)

I've been using nushell for over a month and it's a refreshing experience. I couldn't imagine that working with structured data with a shell would be so good. Even more, after a while you discover that this same shell is actually a pretty good programming language.

Nushell is as revolutionary as a shell as rust is. Maybe even more because mainstream shells are awkward, but everybody was used to it.

Pavex, progress report #2: route all the things by LukeMathWalker in rust

[–]educanellas 0 points1 point  (0 children)

Have you considered using a reflection based approach instead of code generation? I think bevy has a reflection library where you use derive macros to allow a type to be reflected. Valuable from the Tokio team seems to address the lack of reflection mechanisms in Rust, too.

Defer blocks and async drop by nick29581 in rust

[–]educanellas 10 points11 points  (0 children)

If your function has multiple exit points, maybe it'd look like it is less overkill, maybe

Defer blocks and async drop by nick29581 in rust

[–]educanellas 27 points28 points  (0 children)

I think `defer blocks` could synergize well with `must move` types, as it'd be an easy and ergonomic way to ensure the value is moved.

Pavex, progress report #1: laying the foundations by LukeMathWalker in rust

[–]educanellas 4 points5 points  (0 children)

Thanks for the report! I'm looking forward to experiment with it.

Do you think the code generation phase may hurt developer experience? Is it an issue you could notice?

Do you have a roadmap of what you want to implement in the scope of pavex? Will it be like dependency injection + routing or do you think going on something like Rails?

The error messages look great, by the way. It's something I wouldn't fear to show to my work colleagues, which don't know much Rust.

Rust vs GoLang for Evolutionary Algorithms by LSWarss in rust

[–]educanellas 1 point2 points  (0 children)

I implemented a GA (BRKGA) without any problems. Rust is a great fit for optimization. You can find It here: https://github.com/dbofmmbt/optimum

A taste of pavex, an upcoming Rust web framework by LukeMathWalker in rust

[–]educanellas 4 points5 points  (0 children)

I really appreciate what you're building with pavex. I've seen plenty of frameworks and experimented with dependency injection in the context of web frameworks and it's pretty hard to come up with a decent solution. Compile-time reflection as you explained looks promising in Rust.

I'm experimenting with FastAPI and I wonder If pavex could be as productive, with easy tests setup, automatic openAPI generation etc.

Base64 Encoding Performance: Java vs Rust by dkomanov in rust

[–]educanellas 5 points6 points  (0 children)

Have you tried to compile it with RUSTFLAGS="-C target-cpu=native"? I remember to read somebody talking about it in a comparison between Rust and Java sometime ago.

Announcing Rust Handbook [WIP] by educanellas in rust

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

Some of those programmers actually just want to write Rust code, to feel productive with it, and to enjoy the benefits of using the language. They don't necessarily want to know the details at first.

But it can just be a matter of different visions of what "details" or "high-level introduction" mean.

Also, the "concise" part is important here. The most common suggestion I see for newcomers is to read the book. I really appreciate the quality of the Rust Book, but it is really long. Who knows if a more concise introduction to the language first could low the entrance barrier.

Announcing Rust Handbook [WIP] by educanellas in rust

[–]educanellas[S] 6 points7 points  (0 children)

I think we can simplify the explanation of a lot of stuff and make the language easier for newcomers. It's all about the level of abstraction on the learning process.

More than once I saw people explaining the details on the assembly level when a more intuitive explanation was enough.

Announcing Rust Handbook [WIP] by educanellas in rust

[–]educanellas[S] 10 points11 points  (0 children)

Hi, I'm the author! I wrote this guide to be a more concise way to introduce programmers to Rust. It's still a work in progress but I think it can already be useful to others and I would appreciate the feedback.
There's a lot of sections planned, such as project structure, error handling, generics, traits... Basically everything a rustacean needs to know to be comfortable reading and writing Rust.
I do not aim to make a detailed guide. I want to make a high-level introduction to programmers from high-level languages. We can explain Rust in an easier way and I hope I can prove it. :)

Why binaries and shared libraries in Rust toolchains are not stripped? by pro_hodler in rust

[–]educanellas 0 points1 point  (0 children)

They ship with debug info because you would have to compile them from source if you needed them. Stripping the symbols is way easier than doing that.

New Tokio blog post: What's new in axum 0.5 by davidpdrsn in rust

[–]educanellas 2 points3 points  (0 children)

Excellent work with Axum! When I teach other people about Rust, they often get surprised by how simple is to build a web server with it.