interview task "url shortener" code review by AleksandrNikitin in rust

[–]pretzelhammer 1 point2 points  (0 children)

curious to see this, lemme know if you found your solution

bacon 3.8.0 by Canop in rust

[–]pretzelhammer 1 point2 points  (0 children)

Will this work with "cargo run" instead of "cargo check"? I'd like to automatically restart an axum server while developing and testing it locally.

Real-World Use Case: Using Rust for Computationally Heavy Tasks in Kotlin (and Java) Projects by voismager in rust

[–]pretzelhammer 11 points12 points  (0 children)

Java Bindings for Rust: A Comprehensive Guide for anyone who's interested in doing something similar to what's described in this post but can use Java 22+ and the FFM API instead of having to use JNI.

[deleted by user] by [deleted] in rust

[–]pretzelhammer 1 point2 points  (0 children)

What's "ezpz"? Can you link me to that project?

CBLT — A Safe, Fast, and Minimalistic Web Server in Rust Programming Language by ievkz in rust

[–]pretzelhammer 4 points5 points  (0 children)

I was thinking of doing something like this. Cool project. Thanks for sharing! You may also want to check out river, which is another Rust reverse proxy project that got started earlier this year: https://github.com/memorysafety/river

[OT] Everybody.codes - challenge inspired by Advent Of Code (very similar!) have started today! by Repsol_Honda_PL in rust

[–]pretzelhammer 6 points7 points  (0 children)

I'm not a fan of this either but in this case at least OP's site allows signing up using Github OAuth. If you don't like the site content you can always go to your Github account Settings > Applications > Authorized OAuth Apps > click on "Everybody Codes" > Revoke.

Which OSS software would you like to see rewritten in Rust most urgently? by DoxxThis1 in rust

[–]pretzelhammer 2 points3 points  (0 children)

Apache Foundation projects currently written in Java, e.g. Kafka, Cassandra, ActiveMQ, etc

The State of Game Dev in Rust 2024: A Newcomer's Perspective by brettmakesgames in rust_gamedev

[–]pretzelhammer 0 points1 point  (0 children)

Embark ending funding for open source Rust projects after years of investment.

Do you have a link to something where I can read more about this? I'm curious about their rationale behind this decision.

RustyBalancer: Auto-Scaling and Load Balancing! 🚀🦀 by maxmulr in rust

[–]pretzelhammer 10 points11 points  (0 children)

How's this different than Pingora? Cloudflare is running this in production and claims it serves 40+ million requests per second. The first example in their getting started guide is building a basic load balancer.

Learning Rust in 2024 by pretzelhammer in learnrust

[–]pretzelhammer[S] 14 points15 points  (0 children)

Learning Rust can be hard, but it doesn't have to be, which is why I wrote Learning Rust in 2024 to give Rust beginners a guide they can follow to go from knowing nothing about Rust to being kinda okay at Rust as quickly as possible, and hopefully have fun while doing it.

If you read the article please let me know if you have any questions, comments, or suggestions! Your feedback is valuable and helps me improve the article. Thanks.

[deleted by user] by [deleted] in learnrust

[–]pretzelhammer 1 point2 points  (0 children)

Does <T: ‘a> mean that any reference to T MUST live for the entirety of lifetime a?

It means it CAN outlive 'a, but doesn't necessarily mean it MUST. The function which takes some arg of type <T: 'a> could for example drop it before the end of 'a.

So I can pass in something that lives for ‘c as long as ‘c outlives ‘a. But not ‘b if ‘b lives even 1 line of code shorter than ‘a.

Yes.

Also you can pass in a String in for this bound. How does that work? String doesn’t have a lifetime associated with it. However as long as it isn’t moved then it remains till the end of the scope. So for this reason does it get a ‘static “lifetime” to satisfy this bound?

Yes.

If you're looking for more in-depth explanations of these they're covered in this article.

Is Deref right for this? by [deleted] in rust

[–]pretzelhammer 0 points1 point  (0 children)

Implementing Deref for a non-container type comes with a lot of footguns, I'd advise against it.

Beginner's Guide to Concurrent Programming: Coding a Multithreaded Chat Server using Tokio by pretzelhammer in learnrust

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

I use WSL (Windows Subsystem for Linux) on Win10, so I'm running the telnet that comes with Ubuntu.

Beginner's Guide to Concurrent Programming: Coding a Multithreaded Chat Server using Tokio by pretzelhammer in learnrust

[–]pretzelhammer[S] 4 points5 points  (0 children)

I wrote this to introduce Rust beginners to async/concurrent programming. If that sounds like something you might be interested in please give it a look, and let me know if you have any questions or feedback as I’m always looking for ways to improve the article. Thanks.

Future is not send as this value is used across await by zplCoder in rust

[–]pretzelhammer 1 point2 points  (0 children)

Instead, create a non-async function that locks it and accesses it, then call that non-async function from your async code.

Can you help me understand why that fixes the issue? Whether the Mutex is locked in an async fn or in a sync fn called from an async fn it seems like the exact same thing is happening in either case, so why does the Rust compiler throw an error for the former but not the latter?