Rustlang

doomyflo, French
@doomyflo@framapiaf.org avatar

Mes dernières créations au crochet
Sur commande et autres distributions possibles 👍
Bon vendredi à tous 👋
https://www.doomyflocrochet.com

kubikpixel, German
@kubikpixel@chaos.social avatar

Nun ja, auch wenn Passkey was gutes ist und von grossen Firmen bereits angeboten im Einsatz ist, fast keine kleinere Firma investiert in die Tools daführ. Dies auch mMn weil sie es als "zu teuer & unnötig" ansehen.

»Chance verpasst – Webauthn-rs-Entwickler hält Passkeys für geplatzten Traum:
's sollen Anmeldevorgänge sicherer und benutzerfreundlicher machen. Der Entwickler einer -Bibliothek für sieht das Vorhaben inzwischen als gescheitert an.«

🔑 https://www.golem.de/news/chance-verpasst-webauthn-rs-entwickler-haelt-passkeys-fuer-geplatzten-traum-2404-184648.html

fd_vgn,
@fd_vgn@mastodon.social avatar

@kubikpixel Ich hab nie wirklich verstanden wieso Passkeys sicherer als Passwörter sein sollen. Hat jemand Zugriff auf mein Gerät dann auch auf den Passkey. Bei Passwörtern nicht. Verliere ich mein Gerät hab ich ein Problem. Irgendetwas hab ich nicht verstanden.

kubikpixel,
@kubikpixel@chaos.social avatar

@fd_vgn gute frage, vlt. wird die physik in der IT sicherheit als unreal angesehen ausser zB fingerprints ect. 🤷‍♂️

bswolf,
@bswolf@hachyderm.io avatar

: You cannot create a struct whose default value is larger than the size of your stack. Box::new only moves the object in; Box::default calls new with the result of default (which is stack).

And based on comments in https://github.com/rust-lang/rust/issues/53827, even if I did manage to create such an object, cloning it would also blow away the stack due to stack allocation.

Yuck. This is going to make creating a giant EnumMap very difficult.

ekuber,
@ekuber@hachyderm.io avatar

@willglynn @bswolf I know that there are a few crates that provide a macro for this exact thing. Asahi Linux wrote one for their GPU driver.

willglynn,
@willglynn@hachyderm.io avatar

@ekuber @bswolf 💯 If unsafe is on the table then core::mem::transmute()/MaybeUninit gives you lots of options, and for any specific context then there's probably a preferred way to get a pointer to treat as a &mut T.

Note that T still has to have certain properties for this sort of stuff to be permissible even in unsafe code. If you can do it with bytemuck, it's OK; if you can't, it's probably UB.

https://doc.rust-lang.org/nomicon/transmutes.html
https://doc.rust-lang.org/nomicon/unchecked-uninit.html

became_fish,
@became_fish@jorts.horse avatar

people say "C++ isn't any closer to the metal than is" but what is the memory footprint of returning a Result? in C++ i can pass an out parameter by reference to avoid allocating anything on the stack - how do i do that in rust? is it with a &mut ptr? is it done automatically by the compiler when returning?

kornel,
@kornel@mastodon.social avatar

@became_fish Yes, because String is heap allocated by definition. It's {ptr, capacity, len}.

&str is ambivalent about the data source, and guarantees to never run any destructor or free() on the pointer.

Cow<str> holds a bool that tracks whether to free or not.

ekuber,
@ekuber@hachyderm.io avatar
herberticus,
@herberticus@fosstodon.org avatar

My new book – Advanced Hands-on Rust – is now in beta! Intermediate to advanced Rust, writing games in the Bevy engine. Generics, traits, macros, library creation and more. https://pragprog.com/titles/hwmrust/advanced-hands-on-rust/

@pragprog beta books get you most of the e-book now (sadly, we can’t ship out a new print for every beta!), and each subsequent release as the book advances towards final release. You can also file bug reports and help make the book better.

carlton,
@carlton@fosstodon.org avatar

@herberticus @pragprog Wowser! Super exciting!

carlton,
@carlton@fosstodon.org avatar

The first version of this was great! (I was using a tunnel digging algorithm from it for some UI work just the other day) Looking forward to this “Advanced” follow-up.

From: @herberticus
https://fosstodon.org/@herberticus/112491178288052657

herberticus,
@herberticus@fosstodon.org avatar

@carlton Thank you! The new version is a bit more systems-oriented (trying to cover advanced language topics), but includes quadtrees and there's procgen in the 3rd part - which will be in the 2nd beta.

carlton,
@carlton@fosstodon.org avatar

@herberticus happy to follow where the adventure takes you! Your books have been amongst the best resources I’ve found for opening up Rust. So Thank You! 🎩

orhun,
@orhun@fosstodon.org avatar

Today I found a tool for presenting on the terminal! 🔥

🌊 presenterm: A markdown terminal slideshow tool.

🚀 Supports images, GIFs, code highlighting and more!

🦀 Written in Rust!

⭐ GitHub: https://github.com/mfontanini/presenterm

video/mp4

martijn,
@martijn@ieji.de avatar

@orhun damn I just used reveal.js, contestant for my next presentation then! 😍

heaths,
@heaths@fosstodon.org avatar

“Dev by a thousand cuts”

That’s often what feels like. I started learning C in the late 80s and BASIC before that. Since then I’ve become an expert in several languages and proficient in several others. I’m an experienced and though the rust compiler is by far the most helpful - and pushing other compilers to improve - there’s a lot of sharp edges in the grammar itself. Some other polyglots I’m getting into the language agree.

ekuber,
@ekuber@hachyderm.io avatar

@heaths Nick is part of the project. Of course there's no need not to need to know that. The project takes a stance of allowing the community to take over as much as possible and rely on "social proof" for what the best resource is. This hurts discoverability, but allows for faster iteration on the resources. If Rust was a product from a company, that perf book would definitely be part of the standard site.

https://nnethercote.github.io/2024/03/06/how-to-speed-up-the-rust-compiler-in-march-2024.html
https://github.com/nnethercote

vriesk,
@vriesk@hachyderm.io avatar

@ekuber @heaths Currently my main reason to avoid Box&lt;dyn Trait&gt; stuff is that it does not work with async traits (unless wrapped with ::async_trait::async_trait or equivalent), and most cases I'd need it is dependency injection.

faassen,
@faassen@fosstodon.org avatar

I wonder how to best describe how influences design, for better or worse. Here is some rambling...

It makes you avoid cyclical data structures, and you are far more aware of ownership. This makes surprising action at a distance harder. It also makes it more difficult to misuse globals or struct fields as globals just to pass data along to where it is needed no matter how.

Enums turn out to replace dynamic dispatch very often. Inheritance is just gone.

1/n

faassen,
@faassen@fosstodon.org avatar

Since dynamic dispatch is uncommon, you might think traits are less common, but they are not, especially default ones. Because they are used to define how generics fit together statically. Generics are interesting as they are highly abstract yet what happens in runtime is very concrete - no action at a distance.

2/n

ekuber,
@ekuber@hachyderm.io avatar

@faassen One thing about traits is that it makes thinking about Rust code closer to how I think about relational databases.

I am reminded of

"Show me your flowchart and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need your flowchart; it'll be obvious." -- Fred Brooks, The Mythical Man Month (1975)

which significantly shaped how I think about problems. Traits + ADTs put you in the same frame of mind.

lw64, German

My expectation: will replace most other low level languages for relatively low level use cases. For example platform libraries, kernels, OS components, like services etc.
But I also think that a lot of these projects (especially platform libraries) care about that they won't just be able to be used by other Rust code.
Also my expectation: For a lot of these projects, will replace , because it just supports more features, and makes integration into an existing system easier.

kornel,
@kornel@mastodon.social avatar

@lw64 Rust users don't feel the pain of integrating with Cargo — Cargo integrates with Cargo perfectly :)

Cargo vs Meson is like C vs C++. Cargo is used because it's minimal and takes zero effort for most projects. Meson's need for build scripts and support for snowflake projects looks like adding unnecessary complexity, not a feature.

hywan,
@hywan@fosstodon.org avatar

libfuzzer has found a bug in my algorithm. Youhou. Fuzzing For The Win \o/.

bobulous,
@bobulous@fosstodon.org avatar

@hywan How many minutes/hours did it run for before it found it?

hywan,
@hywan@fosstodon.org avatar

@bobulous 8-10mn approximately

weiznich,
@weiznich@social.weiznich.de avatar

I'm looking for help to test out prebuild diesel-cli binaries for the upcoming diesel release. Can you try to download the binaries from here: https://github.com/diesel-rs/diesel/actions/runs/9186949014?pr=4034 and check:

  • That the binaries work on your platform
  • That the binaries have no runtime dependencies on any database driver library

I'm mostly interested in feedback for windows (x86_64) and macos (both x86_64 and aarch64).

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

When @maartenballiauw finds out I like and , but I'm still doing and work. 😅

maartenballiauw,
@maartenballiauw@mastodon.online avatar

@khalidabuhakmeh I thought we were friends!

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar
hrefna,
@hrefna@hachyderm.io avatar

The #RustLang "Rust by Example" is absolutely brilliant. Mad props.

capraobscura,
@capraobscura@hachyderm.io avatar

@hrefna The fact that the developers thought "Hey, maybe we should put useful information into error messages" is the best thing about the language. They've done a stellar job with every step of documentation.

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

This is pretty big news for developers. You can use RustRover for FREE for non-commercial scenarios, including hobby projects and open-source.

https://blog.jetbrains.com/rust/2024/05/21/rustrover-is-released-and-includes-a-free-non-commercial-option/

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@blake JetBrains is a professional tools vendor, so our market primarily comprises professionals. This is an excellent option for folks still learning, contributing to OSS, hobbyists, or looking to make a stack shift.

Our goal has been to include as many features in the box, so while we don’t have as many extensions, the features that extensions add are often already in the core products.

We respect people’s choices, so we only ask folks to try it and decide for themselves.

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@blake I also think the OSS extensions’ current trajectory is unsustainable, which is why Microsoft has quietly taken over many of the top extensions in the VS Code ecosystem.

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