janriemer, to rust

Practical suggestions for building around borrow errors - by quinedot

https://quinedot.github.io/rust-learning/lifetime-intuition.html

If you're struggling with the borrow checker and lifetimes, this is an excellent resource!

In some past toot I've said that Rust lends itself very well to intuition-based learning...

https://floss.social/@janriemer/109415274612140073

...so this learning resource takes the same line (according to its title)! Nice!

folkertdev, to rust

My first concrete result of : zlib-rs now runs with the cranelift backend

This required implementing some intrinsics that the cranelift backend didn't yet support

https://github.com/rust-lang/rustc_codegen_cranelift/pull/1491
https://github.com/rust-lang/rustc_codegen_cranelift/pull/1488

With some help from bjorn3 this was reasonably straightforward. I think the PRs are good templates for of someone wanted to work on a real compiler and implement further SIMD functionality. This issue lists some missing intrinsics

https://github.com/rust-lang/rustc_codegen_cranelift/issues/1419

agx, to rust

I needed bindings for an app to interact with to submit feedback. Here's the generated bindings for libfeedback in case someone else needs it too:

https://gitlab.gnome.org/guidog/libfeedback-rs

DO1HMN, to rust
@DO1HMN@mastodon.radio avatar

Breakthrough: I wrote a program that prints a line of text!
So what's the point?
Program written in , cross compiled on , linked with to a TOS executable {on Windows), put into a disk image on debian and executed on a real ST via a floppy emulator with firmware.

Atari ST Desktop. File "Atari.PRG" is started and prints out "Hello Atari world!"

frankel, to rust
@frankel@mastodon.top avatar
jhpratt, to rust
@jhpratt@mastodon.social avatar

Preview of what I have been working on recently. The core of this crate is a mere two traits. The crate will ship with a number of parsers and combinators, none of which rely on anything not exposed to downstream users.

I've attached a real-world situation, taken verbatim from the test suite. Parsing integers isn't as efficient as it could be yet, as it's using a naïve method.

Parsing in general compiles to be extremely efficient, and using it is ergonomic.

pub trait Combinator<'input, P> where P: ByteParser<'input>, { type NewParser: ByteParser<'input>; fn apply_to(self, parser: P) -> Self::NewParser; }
#[test] fn parse_date() -> parcom::Result<()> { let parser = ascii::int:: .limit_length(4) .and(verbatim(b"-").discard()) .and(ascii::int::.limit_length(2)) .and(verbatim(b"-").discard()) .and(ascii::int::.limit_length(2)); let (seq!(year, _, month, _, day), remaining) = parser.parse("2021-07-04")?.into_parts(); assert!(remaining.is_empty()); assert_eq!(year, 2021); assert_eq!(month, 7); assert_eq!(day, 4); Ok(()) }

saveriobran, to graphics
@saveriobran@mastodon.uno avatar
cuchaz, to random
@cuchaz@gladtech.social avatar

Once again I get foiled by switching languages. :blobcatfacepalm2:

In Javascript, you have to compare strings with ===, not ==, or else you'll run into type coercion problems, because Javascript thinks 1 == "1" is a totally fine thing to be true. (it's not)

But in Kotlin, === compares identity not equality for strings. But in the JVM, string values are aggressively cached, so === actually does what you want most of the time. Unless your strings come from weird places, like JNI code. Then you get awful non-deterministic behavior that's incredibly hard to debug, but it totally goes away when you use the correct comparison operator == for strings.

sigh I'm not really as good at this whole programming thing as I should be by now.

happyborg,
@happyborg@fosstodon.org avatar

@cuchaz
Programming is hard.

A skill is choosing systems and tools that make it easier and making meta choices to enable you to maximise your agency in those choices.

I remember the pain I endured learning a decade ago, then looking at [shudder] and hmm.

Then the pleasure that followed learning to use and . You'd have a hard time getting me to use anything else now. Not happening.

My debut Rust project is now part of debian / Ubuntu.

"===" 🤣

ekuber, to rust
@ekuber@hachyderm.io avatar

Request for feedback: how would you change this compiler error? Can you tell what's going on? What the problem is? Do you get a sense of how you might be able to solve it?

frankel, to rust
@frankel@mastodon.top avatar
leanpub, to rust
@leanpub@mastodon.social avatar

Rust In Practice, Second Edition: A Programmers Guide to Build Rust Programs, Test Applications and Create Cargo Packages https://leanpub.com/rustinpractice2 is the featured book on the Leanpub homepage! https://leanpub.com

ramikrispin, to rust
@ramikrispin@mstdn.social avatar

I recently started to learn Rust programming, and I made a list of resources that I found useful to get started with the language 👇🏼

https://medium.com/p/928bf7b8418f

vascorsd, to rust
@vascorsd@mastodon.social avatar

Oh shit. 9 years??

Time passes fast as fuck. In my mind it is 1 or 2 years old only 😅. But I started following it a little after they removed the @ symbols I guess.

Well, for me Rihanna and Miley Cyros is extremely new and recent in my head too so... 😅😞. I have no idea what kids listen to these days... But I ramble 🤣


through the ages
https://www.ncameron.org/blog/rust-through-the-ages/

vascorsd, to rust
@vascorsd@mastodon.social avatar

Sending a PR for Coreutils; fixing a bug related to "no pid" when killing a process
https://www.youtube.com/watch?v=wzWNkNPHJx0

joeposaurus, to rust
@joeposaurus@chaos.social avatar

My main takeaway from the @rustnl conf as a test engineer who has just started their journey: these people really like their fuzz testing.

outfly, to fallout
@outfly@mastodon.social avatar

Fresh out the oven, version 0.8.5 of the open source space game #OutFly!

✅ New flashlight
✅ Redesigned HUD, with #Fallout-4-like bars for health/power/O2, and #car-dashboard-like warning lights
✅ New, well-balanced cruising vehicle
✅ Implemented power drain
✅ Much improved texture for #Jupiter

Btw, see how the hat of the #pizza chef doesn't cast a shadow? Because it ain't real! Just an #AR illusion, which you can toggle with <TAB> :)

https://yunicode.itch.io/outfly

#space #game #rust #bevy #gamedev

kubikpixel, to rust
@kubikpixel@chaos.social avatar

Do any of you developers know what the Server @stalwartlabs uses for an solution – Is it or even Sequoia--PGP? 🤔

I would like to use @sequoiapgp on the basis of personal arguments and this E-Mail 🔐📧

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

I’ve been using new shiny languages for a while now. , and in particular.
I love Rust’s tooling, Swift’s syntax, and Zig’s philosophy, but I feel like good old is still the goat.

Yeah, the syntax can get out of hand really quickly.
Yeah, the STL is bloated.
Yeah, the tooling ecosystem is a mess.

But at the end of the day, with a good style guide and some discipline, it can check most of my boxes.

But learning new languages is always fun so I’m still doing it 😬

nlnetlabs, to rust
@nlnetlabs@fosstodon.org avatar

We love contributing to the community! For day 2 of @rustnl 2024, @alexband passed the hosting baton to the newest member of our dev team, @terts. 💚🦀

thompsondt, to rust
@thompsondt@mastodon.social avatar

@diyelectromusic, since you're into embedded tech and microcontrollers, you may appreciate this one.

It's a Real-time Operating System kernel I wrote in C and Assembly for AVR chips. My intent was to learn about how operating systems interface with hardware.

I'd like to rewrite it with and finish the task scheduler.

https://gitlab.com/thompsondt/simplicity

jhpratt, to rust
@jhpratt@mastodon.social avatar

So now that -Zcheck-cfg is stabilized and enabled by default, there's no way to tell the compiler about custom cfgs other than a build script?

I routinely use a custom cfg for rustdoc so that I can use nightly features when publishing (both with docs.rs and CI). #[cfg(coverage)] is also used in some places.

Apparently spurious warnings are extremely wide-spread, so I'm not clear on why this was stabilized with such a glaring hole in it.

hds, to rust
@hds@hachyderm.io avatar

I came across this article the other day, titled “Why Rust cannot replace C++”.

I feel that the author completely fails to understand the opposing argument. The article claims that with “new” C++ features like smart pointers, you can write safe code in C++, therefore Rust is unnecessary.

But I don’t want a language where I can write safe code, I want a language where I must write safe code.

https://medium.com/@pepitoscrespo/why-rust-cannot-replace-c-but-quite-the-contrary-5577e1f5af0a

o76923, to rust
@o76923@kitty.social avatar

Can someone tell me the URL to find the emoji manifest in #IceShrimp? Some equivalents are

Sharkey: /api/emojis
Pleroma: /api/v1/pleroma/emoji
Glitch-soc: /api/v1/custom_emojis

I know that such a file has to exist because emojos.in works correctly for void.rehab but I don't know enough #Rust to figure out where they're getting the path out of the server instance.

kellogh, to rust
@kellogh@hachyderm.io avatar

ooo promising new #rust #htmx framework. Check out the ad! 😂 https://youtu.be/YpHFthVa7nU?si=QCJHyg7_dEmBeGTu #rustlang

mort, to Kotlin
@mort@fosstodon.org avatar

I can't deal with languages with optional semicolons! I like languages without semicolons, but when they're optional, especially if they feel "C-like", I always end up adding semicolons to some lines even when I try to write in a semicolon-less style. I'm writing some now and I decided to just use semicolons consistently because the alternative is seemingly to use them inconsistently.

Strangely, this isn't an issue I have in . I do have it in however.

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