TIL: Asterinas is a secure, fast, and general-purpose OS kernel that provides Linux-compatible ABI. It can serve as a seamless replacement for Linux while enhancing memory safety and developer friendliness.
Written in rust of course
github.com/asterinas/aste…
@5422m4n@zeddotdev Offtopic, but I'm interested in your setup: Everything I do with git I do in the terminal except merge conflicts and when I checked Zed a few weeks ago it's lacking any git integration, so I went back to vscode. How do you work?
@ChromiumDev There is no error. It's just an overcomplicated way to say:
setTimeout(() => {console.log(5); console.log(5); console.log(5); console.log(5); console.log(5); }, 1000)
you're welcome.
Calling all web development debugging detectives! 🕵️ Put your skills to the test and help us uncover what the error is in this code.
for (var i = 0; i < 5; i++) {
setTimeout(() => console.log(i), 1000);
}
@5422m4n At first I thought "cool", but I'm not a big fan of asymmetry. cargo run and running the binary directly should both do the same. I guess it's more for build scripts and rustc variables.
Do you still use .env files in your #rustlang project?
TIL: the `env` section in your workspace .cargo/config.toml can be a drop-in replacement
read more about it:
#env" target="_blank" rel="nofollow noopener">doc.rust-lang.org/cargo/referenc…
Everyone always shares code that they're proud of.
I want to see code you wrote that makes you cringe.
Here's mine, and it's been in production for years, and there's a very good chance you've executed it before.
No, I will not be taking questions. 😅
It is with great excitement that we announce the Bevy Foundation: a non-profit that exists to develop Bevy and educate people about its usage!
Know that the Bevy Foundation exists for YOU and we wouldn't be where we are today without your support!
bevyengine.org/news/bevy-foun…
Oh cool, Rust for Rustaceans is in the latest "Learn You Some Code" @humble Bundle! That means you can get it discounted together with a bunch of other tech books from @nostarch *and* support the Python Software Foundation in the process!
humblebundle.com/books/learn-yo…
🤦 What a successful day. Took me 6h to find out that MacOS sucks for embedded programming an #esp32.
🌈 2h later from scratch on Ubuntu I wrote a 20LOC programm that makes a LED blink.
Guess my stack, hint: 'cargo run' and it's done.
#rustlang#embedded
@hmemcpy In Rust 'unsafe' has a different meaning. '.unwrap' in comparison is very safe. At some point you will write unwrap because you know it will not fail and also you don't want to implement error handling.
Every time I see .unwrap() in Rust code I immediately get flashbacks to people using Option.get in Scala.
If you have to do those unsafe operations, you're missing the entire point!
@Legend_Ori I started @chunklands about 10yrs ago as a C++ exercise. The main reason is probably that I was missing game concepts and started somehow and ended somewhere 😃. Nevertheless I learned #rustlang and #vulkan so I don't regret anything and I made progress in every iteration 👍.
@techsavvytravvy@typescript At some point it's enough TS typing magic. I don't want it. Just get it and check it with "if" 🙄. Also juniors will understand ...
Did the #blender Donut beginner tutorial by @andrewpprice, but just placed them on my kitchen's table instead of the plate. Incredible how things get realistic with just a few clicks.
@mattpocockuk I think we tried this for an opaque date type which is a number and the value itself was a utility class with static methods for it. But in the end we decided to use 2 names.
Fun fact: you can export a value and a type with the SAME NAME.
This is great for when you have runtime things in your app that feel like types, like Zod schemas.
Are you using this technique? I'm a convert.
@mattpocockuk@GhosteTheDev correct. It shows horrible code that is 100x easier to write as simple stupid if-statements. If your type system needs such crazy constructs probably also that sucks kind of 😃.
Prettier is thinking about improving the auto-formatting of ternaries.
This would be MASSIVE for improving conditional types in TypeScript, as well as improving life for devs all over.
Which of these do you prefer?
@JoseMedina724@hollylawly@LinggBomb Yes! 😂 write a book "how to make 200K in one day" and print it 20K times. Do as much as advertising as possible and give a very short timeslot to buy for $10. In the book you only print: "It's already happening, thank you."