

Or hardware issues (i still have night sweats over wifi on laptops even though that has been better for decades now).
Or hardware issues (i still have night sweats over wifi on laptops even though that has been better for decades now).
Jetbrains IDE’s do love their fair share of memory. I can verify that.
I am starting to appreciate vscode more and more but it is a challenge to find the right plugins sometimes.
Without supported loadbalancer Kubernetes is no fun / not doable in my opinion.
For Hetzner for example, there are some recipes to be found to use an LB and also volumes.
I’ve stepped back to docker compose with a traefik proxy which takes labels from the containers to decide where to route what.
Highly recommended!
It is just because people are sensitive. Period.
His comment should be read as “I don’t get the borrow checker”.
Response of the Rust community: “lets vote him to oblivion”.
Response should be: what part of it is not clear, hand him reference material etc.
This was the same with scala (which has its userbase cut in 1/10th of what it is). Scala is now almost extinct.
I would hate for Rust to become the next Scala because it offers so much nice features (for me that is native binaries) among others.
I’ve had my share of response to honest questions which resulted in comments that I should be using language X, or that I have some nice term wrong (which does not relate to the problem I was experiencing), I am asking the wrong question and so on.
Luckily there also were helpful comments, which kept me in the Rust ecosystem.
The other behaviour is not productive and just makes Rust look like a niche, elite and too hard language.
Be nice to each other. It will only make Rust and its community stronger.
I am in the process of learning rust by creating software for my own use.
While the borrow checker feels like “fighting the compiler” at times (it took me a week before it started to land, and i have used my share of programming languages!), you will learn.
I compare this to the C world where you can have quite complex constructs with pointers and references. That used to be hard as hell as well. Until it clicks.
The only difference is that in C land, your software will segfault during runtime. In Rust your code will complain during compilation.
Rust without borrow checker is just a bad version of C in my opinion. Rust with borrow checker actually brings value.
In rust it is still possible to make circular references and cause memory leaks but it is very less likely.
So: i understand where you are coming from but give it a chance to land. I am glad I did.
The only thing which is bothering me at times is that the Rust community can come across as highly unfriendly/intolerant at times (comparable to the scala community, which in effect killed the adoption of scala).
The response to your comment should not have been burning it to the ground but to ask why the borrow checker does not click for you.
I can highly recommend the series “lets get rusty” on YT from Bogdan. He is explaining the main constructs in very easy to follow instructions videos.
Have a look and see if it makes it work for you!
Same here.
Daily driver is a mac but I always use a desktop Linux machine at home.
Thank you for your sacrifice. It will not be forgotten.
Thanks for the correction 👍
Thank you again and I will.
Exactly the same. Kicking of the binary now, but library could solve a lot of the security issues I was worried about.
Not talking threads here, more Tokio tasks.
DUDE!
You are the man!
I did know it was built in rust but never realized I could also use it as a library!
🎉
It is now quite clear that I have to let go of OO paradigms. Maybe the package approach is perfectly fine.
Thank you for the insights and useful answer!
I have the idea that I am still only scratching the surface of rust, although I seem to manage it better every day.
As long as I leave my OO hat on the rack 😉
Well. I did read up on the “XY” problem and apparently you assume that what I want to do is somehow bad practice.
To elaborate more on the problem: I am writing an axum backend which (like other backends) needs to do stuff in the database. As some endpoints update the database (and sometimes over multiple sql statements) I want to pass around the transaction as this embodies the connection I am using to update the database.
To separate the axum stuff (parameters, urls and whatnot) from the actual database logic, I’ve first pulled out all the database interactions into separate functions. Because those functions are logically groups (e.g. stuff happening with invoices, others with contacts etc), I thought it was a good idea to create a “dao” struct (and agreed: my OO brain kicked in here which might be debatable). This would group the interactions for each logical domain into a short-lived data access struct.
To prevent passing around the transaction/connection, i wanted to pass that along during construction, so the functions in the DAO could just access the connection when needed.
Non “OO” would be fine to be honest (just having all the DAO as functions in a separate package).
Sorry, no code, not at the computer atm.
(And yes, I am aware that rust is not OO, put away the pitchforks please 🙏)
deleted by creator
Thanks! Will try that!
Seems like the into_inner is the way (i see other references to it).
And yes, transactions should be short-lived, this is just about delegating it to the responsible component.
So your answer is “you are doing it wrong”.
Thank you, very helpful 😉
I am currently using it from a backend to generate pdfs.
One thing that prevents me from letting users build their own templates is the scripting capabilities. A joker creating an endless loop could block the whole server.
What would be nice is a “safe” mode in which no access to the file system (include and sorts) and limited runtime makes it safe to let users build their own templates.
Its also an easy way to access and fix your system if the windowing environment does not work (wich almost never happens unless Nvidia drivers, although that has improved a lot as well).