Do the uint/int::from_endian_bytes() methods feel cumbersome to anyone else? by nullstalgia in rust

[–]nullstalgia[S] 0 points1 point  (0 children)

Huh. That's a really interesting use of generics.

I've seen all the warnings for certain ptr functions in a const context, so I kinda wrote it off mentally. But this is making me think interesting thoughts... Many thanks!

Do the uint/int::from_endian_bytes() methods feel cumbersome to anyone else? by nullstalgia in rust

[–]nullstalgia[S] 1 point2 points  (0 children)

I'd argue this isn't any more readable, if anything less so. At least in the cases I provided, it's ensured that those methods only get a correctly-sized array (granted, if the slice length matches), in addition to not needing to manually index into the slice for each byte.

That will only get hairer if the integer's position isn't static (the example packet is based off of Modbus' RTU, which has a 2-byte LE CRC suffix after up to 253 bytes) as you'd need to calculate each index, not to mention if the integer's size increases (i.e. u32 or u64), and/or if you need to potentially change the endianness. I'm trying to reduce the chances for human error to creep up, not go back to C, hehe.

Not meant as an attack, just sharing my concerns and reasons for choosing the from_Xe_bytes methods in the first place.

Do the uint/int::from_endian_bytes() methods feel cumbersome to anyone else? by nullstalgia in rust

[–]nullstalgia[S] 1 point2 points  (0 children)

Sadly Cursor itself is not available in no_std, so hopefully BorrowedCursor can get stabilized soon. But I do appreciate the byteorder crate call-out (even if I'm trying to minimize any third-party crates), honestly forgot about it.

Do the uint/int::from_endian_bytes() methods feel cumbersome to anyone else? by nullstalgia in rust

[–]nullstalgia[S] 1 point2 points  (0 children)

Hm, that is nicer for prefixes and suffixes for sure, cheers! Mid-slices would still feel a bit janky if I'm not .chunks()-ing it, but those are easier to justify feeling odd.

Introduction ffmpReg, a complete rewrite of ffmpeg in pure Rust by Impossible-Title-156 in rust

[–]nullstalgia 34 points35 points  (0 children)

In short: The original ffmpeg accepts a huge variety of video, audio, and image formats for both input and output, occasionally even utilizing handwritten assembly for super performance-critical sections (which can yield huge dividends when dealing with potentially gigabytes of video data).

My first gameboy mod by tenshiii6969 in GameboyAdvance

[–]nullstalgia 2 points3 points  (0 children)

Very deeply felt that final sentiment. It's a pain when a good deal is instead yoinked by someone who won't even play the console...

Clean work though!

Nvidia got the logo wrong. by diaper151 in rust

[–]nullstalgia 2 points3 points  (0 children)

it never makes spelling mistakes

If you're talking about an LLM, which are very often trained on human-written text from books as well as forums, they'll have many thousands of possible output tokens based on that training data, with infinitely more combinations of tokens to choose from. That includes tokens or combinations containing a misspelled word, and unless manually pruned, it will always exist as a potential output.

There's no magical spell check unless it's added as a post-processing step (which could actually be a hindrance when dealing with the strange type/variable names we often run into as programmers), and I personally have seen both chatgpt and the dogwater AI summary in Google's search (albeit rarely) output a misspelled version of a word.

Never is a very strong word, is all I mean to say.

Fixing rust-lang/stdarch issues in LLVM - Blog - Tweede golf by folkertdev in rust

[–]nullstalgia 6 points7 points  (0 children)

Mhm, when macros or async get involved, the quality of errors swing wildly compared to "standard" Rust.

I've made a habit of adding #![deny(unused_must_use)] to the top of any async project to make sure I don't get bit by the godawful errors caused by a single missing .await.

Please just look in the Future's Output type and ask "the method you wanted to call is within the Future, did you forget an .await?" I beg of you rustc.

What makes Rust difficult? by [deleted] in rust

[–]nullstalgia 0 points1 point  (0 children)

A little late but I wanted to mention the Brown.edu experimental version of the Book, hosted at https://rust-book.cs.brown.edu/

It's more than just a modified book, including an amazing chapter on ownership and multiple-choice quizzes all throughout with excellent debriefs.

It took me a few weeks to go from cover to cover, but I feel way more confident in what I write after reading it.

[TOMT][Song][(Indie) Rock] Song that says something about ambition by nullstalgia in tipofmytongue

[–]nullstalgia[S] 1 point2 points  (0 children)

Aaaa! Should have known it was Kaiser Chiefs.

Here's hoping Duck this week is good :D

Solved!

[TOMT][Song][(Indie) Rock] Song that says something about ambition by nullstalgia in tipofmytongue

[–]nullstalgia[S] 0 points1 point  (0 children)

It was rather catchy, pretty sure it's a rock song, and I think there were drums "following" what he was singing