mo8it, to rust
@mo8it@fosstodon.org avatar

I think I am now addicted to writing and implementing traits to be able to chain function calls :ablobcatheartsqueeze:

For example, implementing your own trait on Result makes error handling much easier because you can just chain a function that maps the error to your error type with possible arguments!

You can just use map_err, but chaining is slimmer and more flexible.

Rust is the perfect language for chaining! Especially with .await and the ? operator :ferrisdance:

janriemer, to rust

Inko - A language for building concurrent software with confidence

https://inko-lang.org/

Looks quite nice! Almost like a mix of and (with 75% Rust and 25% Go).

AstraKernel, to rust

🦀 Whichlang: A fast language detection library for Rust

https://quickwit.io/blog/whichlang-language-detection-library

janriemer, to rust

Oh wow, did you know that in you can use Option as an iterator such that your types align, when you want to return a chain of iterators from a function, but also have an else case where the iterator is empty!?

I know, this was a mouthful.😳

Let's look at a playground that shows this:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=129eb419d767b71447b408e456773555

This trick is right from the docs on option:

https://doc.rust-lang.org/stable/std/option/#iterating-over-option

What a cunning trick!🤓

Rust, I ❤️ you!

janriemer, to rust

I've just seen the following comment 😅

"I Zigged so much to the point that I left my compiler in the rain and got Rust"

Elendol, to rust
@Elendol@hachyderm.io avatar

The more I use Skyline for / the more I want to build a simpler alternative. Mostly just as a finder/viewer, without the parts doing statistics. Something like that.

I also really want to build something to extract and store thousands of spectra from tons of DDA and peptide search results. 🤔

jbzfn, (edited ) to rust
@jbzfn@mastodon.social avatar

「 UI in Rust is difficult because it's hard to share data across this component tree without inheritance. Additionally, in a normal UI framework there are all sorts of spots where you need to mutate the element tree, but because of Rust’s mutability rules, this "alter the tree however you want" approach doesn't work 」
via warp.dev


https://www.warp.dev/blog/why-is-building-a-ui-in-rust-so-hard

zkat, to rust

Dear Lazyweb: what’s a good hashing crate that’s very fast and lightweight and very unlikely to have conflicts, that’s not the sha family?

I’m not sure cryptographic security is important in this case, because the source of the data is already sha512-checked, but I still want something that can catch little things like cache corruption, and that can act as a unique key for usually-small data

I saw xxhash, but I guess I don’t understand enough to know if this is going to make the odds of conflicts practically nonexistent (I don’t want to have to check for conflicts at all)

imperio, to rust French

Je viens tout juste de mettre à jour mon tutoriel pour apprendre le langage Rust en français. Notamment les parties sur les durées de vie et la généricité. Vous pouvez voir tout ça ici : https://blog.guillaume-gomez.fr/Rust

Bonne lecture !

pragprog, to rust
@pragprog@techhub.social avatar

Hands-on Rust by Herbert Wolverson @herberticus

What better way to learn than by making games? Rust offers a shiny new playground where your game ideas can flourish.

https://pragprog.com/titles/hwrust/hands-on-rust?view_title

chrisbiscardi, to rust
@chrisbiscardi@hachyderm.io avatar

WebGPU support landed in , so Iade a short video explaining what that means.

's Wgpu is an amazing crate for GPU programming on the web and native platforms.

https://youtu.be/O1S7WWJ0B9U

janriemer, to rust

Oh wow, this looks freakin' awesome! 🤩

welds - An async written in using the framework.

https://github.com/weldsorm/welds

You can even drop down to low-level sqlx queries, in case you need it:

https://github.com/weldsorm/welds/blob/c9a9a664cf07b99314ac773dd9ce20f5efc7301c/tests/postgres/tests/all_tests.rs#L169

zkat, to rust

Just tagged v5.9.0 with a couple of nice changes. Most notably, diagnostics in the .diagnostic_cause() chain will be rendered with their snippets, so you don't lose diagnostic info along the way when you wrap them! Thanks to @Hemera for the change!

Changelog: https://github.com/zkat/miette/releases/tag/v5.9.0

infoq, to rust
@infoq@techhub.social avatar

In this article, Vitaly Bragilevsky shares findings and insights about the Rust community and ecosystem, and discusses the peculiarities and pitfalls of starting new projects in or migrating from other languages.

Read now: https://bit.ly/3MFb9oH

flashmasterdash, to rust

Now that's a strange syntax for calling a method on a generic type, I guess 🤔 Or is it?

AstraKernel, to rust

🦀

What is the output?

A. it will not compile

B. It will panic

C. it will print
Mike
Drop the Mike
Mike
Drop the Mike

D. it will print
Mike
Mike
Drop the Mike

You can also vote your answers below 👇

rust_gamedev, to rust
@rust_gamedev@mastodon.gamedev.place avatar

🎉 3 starts on May 21! 🎉

The theme is going to be announced at the submission opening - you can use it, but it's optional since the jam only wants to get people to write games in Rust.

Details on itch: https://itch.io/jam/rusty-jam-3

slomo, to rust

I was (and still am) looking into various Rust build integration issues over the last weeks, specifically when integrating Rust code into existing C code bases.

Today I ran into one that is very easy to fix, and that e.g. shaves off half of the shared library size from librsvg.

https://gitlab.gnome.org/GNOME/librsvg/-/issues/965

Distros might want to do this explicitly in their builds for now.

Make sure to always pass --gc-sections (or equivalent) to the linker when linking a Rust staticlib into an executable or shared library. And in case of the latter, also make sure to only exports the symbols you want to export (librsvg did that part correctly).

Apparently this was also not mentioned anywhere in the Rust docs, and from looking around there seem to be more projects that are not aware of this. So I also added a section about this to the Rust docs (well, reference).

https://github.com/rust-lang/reference/pull/1361

Unfortunately not all issues I ran into so far are that easy to fix 😅​

rustnl, to rust
@rustnl@fosstodon.org avatar

With the “Using to write modules” slides from @kushal added to the set, the RustNL 2023 presentations archive is now complete. https://github.com/rustnl/rustnl2023/tree/main/presentations

rafaelcaricio, to rust
@rafaelcaricio@fosstodon.org avatar

I've spent a good part of my weekend working on upgrading the GStreamer Rust bindings on Servo. The presentation by Martin Robinson from @igalia at @rustnl was a real inspiration.

https://github.com/servo/media/pull/393

I'm delighted with the revival of Servo and I believe it has a bright future.

alexband, to rust
@alexband@hachyderm.io avatar

There have been quite a few requests for the slides of the RustNL 2023 presentations, so I've put them together in a folder in PDF format. https://github.com/rustnl/rustnl2023/tree/main/presentations

alightgoesout, to rust
@alightgoesout@holygrena.de avatar

I just published my first Rust :rust: crate: https://crates.io/crates/presage. I don't think anyone beside me will ever use it but I still felt very nervous 😬.

itsfoss, to rust
@itsfoss@mastodon.social avatar

The final one in our Rust Basics Series is here!

https://itsfoss.com/milestone-rust-program/

cxiao, to rust

In the new Rust Windows kernel GDI code, there is a new global allocator registered named gdi_alloc::Win32Allocator . It calls Win32AllocPool with a fun new pool tag name, "Rust"!

cxiao,

The Rust Windows kernel GDI code also has symbols for fallible_vec::FallibleVec<T,A> , which looks like a non-panicking Vec implementation. try_extend, try_extend_from_slice, try_splice_in, and try_insert are all implemented.

In fact it looks suspiciously similar to the rust_fallible_vec crate, which Microsoft recently open-sourced: https://github.com/microsoft/rust_fallible_vec :thonking:
( @TehPenguin 👋 )

The methods are generic over the allocator type A; some of these FallibleVec method implementations use the registered global allocator gdi_alloc::Win32Allocator , and others use the gdi_alloc::TaggedAllocator with the GDI-specific pool tags.

An annotated implementation, in Binary Ninja, of a function named fallible_vec::FallibleVec::try_extend, where A is likely the allocator type gdi_alloc::Win32Allocator.

kirsten, to rust

kennt keine "NULL"-Werte. Werde ich sie vermissen? Ich denke nicht 😁
Java-Code wäre einfach nicht dasselbe, wenn man nicht immer wieder auf null prüfen müsste oder einem eine NullPointerException um die Ohren fliegt, weil man den Check vergessen hat. Ja, Java kann auch seit einiger Zeit mit Optionals umgehen, aber leider wird das noch nicht so konsequent genutzt.
Rust ohne null ist eine schöne Design-Entscheidung.

kirsten,

@janriemer Der Vergleich ist schon beeindruckend. Ich möchte aber auch Optional in Java nicht schlecht reden und die Entwicklung in Java erst recht nicht. Wenn ich ein Team von guten Java-Entwickler:innen und eingespielte Prozesse habe, werde ich davon nicht so schnell loskommen. Man sollte sich aber stets umschauen, was es sonst noch gibt und sich auch fragen, warum es bestimmte Konzepte als Standard in eine Sprache geschafft haben.
Ein Vorteil neuerer Programmiersprachen ist, dass sie die Fehler der "Alten" nicht machen müssen.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • everett
  • magazineikmin
  • Youngstown
  • thenastyranch
  • rosin
  • slotface
  • ngwrru68w68
  • Durango
  • PowerRangers
  • kavyap
  • cisconetworking
  • tsrsr
  • DreamBathrooms
  • modclub
  • mdbf
  • tacticalgear
  • khanakhh
  • ethstaker
  • vwfavf
  • InstantRegret
  • tester
  • osvaldo12
  • cubers
  • GTA5RPClips
  • Leos
  • normalnudes
  • provamag3
  • All magazines