Today I learned: It only takes about 35µs to spawn a thread in #RustLang (on my machine) 🚀
Might help you to decide whether you should run something in parallel or not ⚙️
Of course, this is not the whole overhead. You might need some kind of synchronization etc.
nostr:npub1t7yau7dhg6pfh5xfn7h9ajjpm9mjgzge2ljen3wczdfweszhmg9qq5346f Could you please add the RustLang tag? 🥰
Background: https://fosstodon.org/@mo8it/112056453394255413
🔪 Killing in the name of Privacy
https://mo8it.com/blog/privacy
How an AD blocker killed my work of months and how is this related to telemetry in #FOSS
#OxiTraffic #Linux #IndieWeb #Privacy #AdBlock #AdBlocker #uBlockOrigin #Blog #Telemetry #Analytics #OpenSource #Selfhosting #Selfhosted

nostr:npub1gfdrrw9629qxwvwaa3vwnvzhtaqu2c5m9wf6vcwjnmdnhs7hl4jsux7gg6 Python now, Rust later.
nostr:npub16pdljvqw3ld0f2mz8mq39tgcvhy3paqmc96kukn9cfscqa29u4wshq3nda One might ask, why not just put the file `submod.rs` inside the `submod` directory (instead of next to it or `mod.rs` inside it)?
Well, that would make having a submodule with the same name (submod::submod) impossible with variant 2! (Not that I would recommend that design)
More importantly, it makes expanding from variant 2 to variant 3 very easy! Or actually, it makes variant 3 only an extension of 2.
nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg yes, I don’t mean to suggest that Rust can only do things one way. That wasn’t really the point I was making. As I said, the Rust book’s explanation of how Rust makes mutexes safer improved my understanding of Go’s concurrency and the tradeoffs involved.
nostr:npub1jx3dzll682rmfgzla5wwyjjsk5f05eml4845nrxvww3ulnt3shxqq0m6x6 Then I misunderstood it. Sorry ❤
nostr:npub1jx3dzll682rmfgzla5wwyjjsk5f05eml4845nrxvww3ulnt3shxqq0m6x6 Rust offers both, channels and locking with a Mutex or RwLock. There also more flexible channels in crossbeam:
https://github.com/crossbeam-rs/crossbeam
It doesn't force you to use the easier and less error prone channels, but it also makes sharing memory much easier. It is proven that data races are not possible in Rust. On the other hand, Go knows about the problem and tell you to run a program with an optin tool as long until a data race is detected (if it was reached):
nostr:npub1ha2lruw3206t0vvrkum95nwc5vqj5rx4nyssfn3j4mjfwur3x8nsymk5hs One could create a new web framework that is synchronous which offers trivial parallelization (launch multiple instances). But how do you share state then without a database? A required database increases the complexity.
And what about performance? Such a framework would not have the same performance like Axum. Who would use it then?
nostr:npub1wwqyr8ftmcazjpt4vnuyy6v7yjuewe3k3w9phx0l5s735lnvpyzsz8gkse Yeah, Helix is similar but without braking plugins. An editor with LSP support is more than enough!
nostr:npub18sg73ul8fqckpwttdyu9fczkmhkhnent2z7q3n9d4xjzeskku6fqr4f898 Nice!
Now that you have set up your environment, don't try to just start hacking! Start with the Rust book before coding:
https://doc.rust-lang.org/stable/book/
There are many concepts that are new in Rust and should be learned first. Finish the first theoretical chapters in the book and then start with Rustlings and maybe a pet projects.
https://github.com/rust-lang/rustlings
Have fun! I would love to answer any question on your learning journey :D
nostr:npub1eqghrdelwyf920kghgwlmkjve6ptgnjy3jzkpfvxjmmjsh4em83sq6fncn Fish is awesome!
For renaming files, I personally like to use pipe-rename:
https://github.com/marcusbuffett/pipe-rename
It lets you just use your editor for renaming! You can use whatever regex, macros etc. you want :D
nostr:npub1kj80ke3032gd467cw3ln44s2ewwg8flhe9dn858kgrvf3mjm75lqfc0urt "… So the problem is inherent to the programmer but not the language. Rust programmers shouldn't claim otherwise."
nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg suppose next time you post a different rant about not being able to express something in Rust without a bunch of boilerplate and I reply you with an elegant solution in Haskell that uses Arrows or Cartesian Closed Categories... Would you switch the language or stick to generating boilerplate with macro? :)
nostr:npub1xl6v22tg44a3jkymxkd2u2ejh4s497maklu4ccyunt8g5zpjsgkqc5kvze If it is a question about how to do something in Rust and you give a pure Haskell reply, then that would be rude.
But if it was a rant, then I would love to know how other languages handle it. Haskell is on my learning list anyway ;)
I wouldn't switch to Haskell directly. One feature is not enough. But at least I hope that my future me doesn't give a close minded, technically false reply and instead try to objectively reflect on my language of choice.
nostr:npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg I’m an avid Rust evangelist, and I use a lot of Rust in embedded dev, but this is a dumb hot take.
Programming languages are tools. There are tools for different jobs. In Rust, you could have an unwrap which panics instead of a nullptr deref in C. Both are a skill or tooling or testing methodology issue.
Please don’t taint Rust with this mindless drivel. Be better than this.
nostr:npub159jtdf8xjp5tmkn3np828yp26l3e4wrzsnjqshne9y40cca226sqlmkfaf Unwrapping is an explicit madness.
I was able to catch it and even reproduce it this time!
A NULL pointer dereference… 🤦♂️
Again, dear programmers, please use #Rust and stop using (old) languages with very old problems.
No, it is not a skill issue. Look at statistics.
Today, using something like #C and #Cpp when you are able to use #RustLang means at least to me that you don't give a fuck about your users and their security.
BTW, "new" is not always better as #GoLang shows with its nil 🤦♂️
#FlipperZero

nostr:npub1z9dhnnualnmtk53q6wmzapl9xptrau0pr59mwtmqgre3qtvghgmqpxt8s6 I really want to try it out again after it has completions similar to Fish.
nostr:npub17508cep9glvmthq0txez5psr5st0yd8n9gjxcydz9gr5wtrcg8fqupjjsv Data race? Was it safe Rust?
Now that the #Serde issue is resolved by removing the binary, I want to thank nostr:npub1d7l4vup9k4fvq6zcn9mnwnvuftsfl58kulrvgj7h3qg7cglnpacqfv546q again, not only for reporting the issue, but also for all his efforts in the #Rust and #Fedora communities ❤
For others: Please don't call things like this "drama" again. This is pushing back against mistakes that would affect the whole community. I love how much the community cares and that such problems are not ignored 🥰
We are not here to only get things done, we are building a future ❤
#RustLang
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSS
https://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust

nostr:npub1z593nnjdmh5yam2f07g2ck7g4zmgf5nk3kh9kc3y9jy9z05z5l8q3xnpt7 Thanks for sharing!
I already love the Axum + Askama + TailwindCSS stack. But I always avoid to write horrible JS. Maybe I should take a look at htmx for required interactivity then. Bookmarked for later reading :ablobcatheart:
nostr:npub1e2gdujuadycgmzwfj7zz33k089rdx0q4j8r4wyz7g28p029h552s4w6q8w nostr:npub1ayjffhx6tm7p2ddhdw6et70qgdmqf4u9rc0evzztnlavjyxkp6fqx9hw9x I did consider Bulma before starting with Tailwind. Bulma did seam to me like Bootstrap and I didn't want something like it. Bootstrap is very limiting.
Tera is awesome! I use it for my static websites (since Zola uses it). But for my own binaries, I much prefer Askama for its compilation checks.
