Acute Accent
29 minutes ago

✍️ New watchexec-focused cohost page and a big recap + story of the recent Watchexec releases:
#rust #rustlang

Brian Dorsey
4 hours ago

#rustlang folks up for a question?

I tried to convert a .fold() into a .reduce(), but it didn't work and I don't understand why. Math on shared references to ints seems to work in .fold, but not in .reduce?

fn main() {
let v = vec![1, 2, 3, 4];

// works
println!("{:?}", v.iter().fold(0, |acc, e| e + acc));
// fails: expected `&{integer}`, found integer
println!("{:?}", v.iter().reduce(|acc, e| e + acc).unwrap());
// changing to .into_iter() works


All I wanna do is write #rustlang

Ingvar Stepanyan
6 hours ago

Found couple more opportunities to optimise serde-wasm-bindgen's deserialization. Up to 24% in struct-heavy benchmarks!

Released as serde-wasm-bindgen 0.6.2.

#rustlang #WebAssembly

=== Brotli sizes ===
serde-wasm-bindgen: JS = 3.2 kB, Wasm = 75.6 kB

=== Parsing benchmarks ===
    serde-wasm-bindgen x 82.42 ops/sec ±1.66% (71 runs sampled)
    serde-wasm-bindgen x 208 ops/sec ±1.12% (87 runs sampled)
    serde-wasm-bindgen x 267 ops/sec ±0.85% (88 runs sampled)
=== Brotli sizes ===
serde-wasm-bindgen: JS = 3.21 kB, Wasm = 74.1 kB

=== Parsing benchmarks ===
    serde-wasm-bindgen x 84.44 ops/sec ±0.94% (72 runs sampled)
    serde-wasm-bindgen x 258 ops/sec ±0.62% (86 runs sampled)
    serde-wasm-bindgen x 306 ops/sec ±1.19% (90 runs sampled)

I just closed a 3-year old issue. Have I really been trying to write a #RustLang GUI off-and-on for 3 years now? It feels amazing that I started with a rewrite at the beginning of October and I already feel further along than any of my previous iterations.

Gooey's Image widget example
Júlio Gardona
10 hours ago

Wrote a reverse polish expression evaluator in #rustlang 🙂 .

Shenzi Thinker Abouter
12 hours ago

i'm crying i can't develop in the rust playground because the playground's filesystem is out of space

I was working on the advent of code ;-;

#rust #rustlang

I've brought back support for animated sprites in Kludgine and #Gooey, and wired everything up to the work-in-progress TileMap widget. #Rust #RustLang

Caleb Maclennan
13 hours ago

A few days ago somebody poked me about monster repos causing pathologically long run times for `git-warp-time`. A lot of fiddling and a couple releases later v0.7.0 is now about 300× faster. Not 300 percent, 300 times faster!

There is probably one more order of magnitude left on the table with some careful memory caching and threading, but over two orders of magnitude faster is a good start.

#rustlang #rust #git

Dmitry Kudryavtsev
16 hours ago

@kDot I don’t know if this was intended, but I assume age is a big part of the mess that Java is.

But I also think #java took OOP too seriously with all the factories and other patterns.

A better designed language is obviously #rustlang which took all the best from all the languages. The code style is consistent, and reading different code based on rust, is familiar to a rust developer

Created another Rust package for Arch Linux! 🐧

🦀 **cargo-docs-rs**: Imitate the documentation build that would do.

⭐ GitHub:

🐧 AUR:

#rustlang #cargo #docs #github #actions #archlinux

Lord Olle W
18 hours ago

Lucka 9 - Game state

Årets julkalender från Agical är en spelmakarstuga där vi skriver ett shoot'em'up-spel i programmeringsspråket Rust och spelramverket Macroquad. Idag fortsätter vi med lucka 9. I denna lucka blir det lite faktorisering genom att vi lägger till ett så kallat "game state" som gör att vi kan pausa spelet och få en startmeny.

#rust #RustLang #gamedev #game #programmerinf #Adventskalender #macroquad #spel #spelutveckling

Ett datorfönster med lila bakgrund, olika stora gröna fyrkanter, en gul cirkel och tre små vita cirklar på rad. Nere i vänstra hörnet står texten ”Poäng: 4711”. I mitten står det ”Pausat”. Nere till höger är en bild av Ferris the Rustacean med tomteluva och spelkontroller. Överst är texten ”Spelmakarstuga från Agical”.
18 hours ago

I just completed "Mirage Maintenance" - Day 9 - Advent of Code 2023 #AdventOfCode

That was easy enough that I started writing an "optimised" version in #julialang from the get go. The difficulty is all over the place this year! ( Probably #rustlang and #uiua versions later...)

Given a Datastructure like this:

pub struct Thread {
// contains all messages of a thread
pub messages: Vec<Message>,
// contains the messages as a tree structure
pub root: &Message

pub struct Message {
pub children: Vec<Message>

I know I need to add lifetime annotations. But is it possible to model a similiar data structure w/o using Rec<RefCell<Message>>? It feels like cheating.

#rust #rustlang

20 hours ago

I made some progress 👐
🐱 a rough character design, using #b3d
🐁 other visual changes
🐾 made sure multiplayer is still working
🦈 the genre may be a #roguelike, let's see!

#bevyengine #rustlang #gamedev #screenshotsaturday #indiegame

Chris Emerson
20 hours ago

I've finally found motivation to add some experimental minimal CSS colour support to the #html2text #RustLang crate.
Next step is to see if I can update aoc-cli to make use of this. 🙂

22 hours ago

I already loved the rust compiler and the tooling around it, but after a few days of doing #adventofcode in #rust , I'm even more impressed by how good they have become.

Giving #HelixEditor a try as well.
Fumbling with the keybinds, but I wish #vim was this snappy (and required so little config).

#rustlang #aoc2023

Shenzi Thinker Abouter
1 day ago

released pict-rs 0.4.6 today.

big change is a new internal endpoint for preparing for the 0.5.0 upgrade

#rustlang #rust

Andrew Lilley Brinker
1 day ago

A project of mine, cargo-spdx, got a mention from @ferrous in their response to the RFI on open source software security!

They make the point that leaving security-relevant tooling to be done by solo maintainers is bad, and there should be investment in community and commercial tools. Strong agreement from me!

Ferrous' comments:

#rust #rustlang

Jan :rust: :ferris:
1 day ago

This thing will (probably) blow up 🚀

mfio - Framework for #Async I/O Systems:

"mfio is a one-stop shop for custom async I/O systems. It allows you to go wild, beyond typical OS APIs.[...]"

- Async
- Automatic batching (vectoring)
- Fragmentation
- Partial success
- Lack of color (full sync support)
- I/O directly to the stack
- Using without standard library

#Rust #RustLang #RustAsync #AsyncRust #Memflow #IO

Andrew Lilley Brinker
1 day ago

It is so deeply weird to me that this group would write and submit a public document defending C++ to an RFC that includes as a core priority supporting the move away from memory unsafe languages, and then wouldn't sign their names.

All but one other response to the RFC, 105 total, is a named organization, a named individual or individuals, or has no name field filled out and minimal content.

Theirs is the only semi-professional submission which is explicitly "anonymous"

#rust #rustlang

Jan :rust: :ferris:
1 day ago

@bobulous You might be able to squeeze some additional performance:

- use #[inline] on small methods that are executed often (in parsers on methods like "next_token")

- use `lto = fat` in your Cargo.toml (⚠️ increases build times)

There is more - have a look at this excellent book by @nnethercote

#Rust #RustLang #Performance

1 day ago

#AdventOfCode Day 8 - part 2 was A LOT of luck, as in "mayyyyybe the input works that way" and it was definitely a shot in the dark, with a side of "a harder version would be day 15, not day 8" -

#AoC2023 #rust #rustlang #cheeeeese

Andrew Lilley Brinker
1 day ago

Aha! They refer to themselves as the “ISO C++ Directions Group” which appears to be the group that authored P2000r4 and P2759r0, namely:

- Howard Hinnant
- Roger Orr
- Bjarne Stroustrup
- David Vandevoorde
- Michael Wong

#rust #rustlang

Martijn Faassen
1 day ago

Back in the late 90s I discovered #python and a few weeks later I had a job writing Python ("Can I use Python?" "Is the code readable?" "Yes"). I saw people post how they wished they could use it for their job.

Now I see people post that they wish they could write Rust professionally. I am over a year in. It did take me a few years of on and off learning as obtaining Rust proficiency can take a little while.

The Rust jobs are out there, but you may have to make them


Phew, had me worried for a minute. I'm writing a simple XML 1.0 parser in #Rust just for practice, and on feeding it a 4.4MB XML file it took 56.5s to read it. I've done nothing to optimise it yet, but even so that sounded dire.

Then I remembered to use "release" mode, and the time dropped to 3.9s. Whatever the compiler is doing behind the scenes, I'll take that 14x speed boost, thank you.

#RustLang #Compilers #XML

1 day ago

Day 10 and 11 of #100DaysOfRust

I'm getting deeper and deeper into the #Rust programming language and learning different ways to implement functions and for what reason. Oh, if I didn't get far in the course yesterday.
I also thought about developing with a #Vim clone on #RustLang, this is #Helix. I also found out about libraries that I might use in the future 🦀

#100daysofcode #learn

Rust Weekly 🦀
1 day ago
Andrew Lilley Brinker
1 day ago

They don’t name themselves. It’s unclear if this is an official ISO C++ response.

Their response tries to muddy what safety means, argues a strawman about Rust having vulnerabilities too, suggests “profiles” for C++ should fix everything anyway, hints thah C++ critics are actually just talking about old C++ (in the same breath they argue that C++ is great because it’s always stable so old code sticks around forever), and that really you should give C++ more money.

#rust #rustlang

Andrew Lilley Brinker
1 day ago

lol, a group of unnamed “C++ senior members with decades [of] experience in ISO C++” filed a response to the federal RFI on open source software security and it is ridiculous.

#rust #rustlang

I'm live!

I'm a bit late, spent way too much time on my makeup...
Anyways, we'll be continuing work on the ECS and hopefully finishing this wretched world off >:3

Well... uhhh finishing the world structure hehe :3

#rust #rustlang #twitch #stream #goinglive

Predrag Gruevski
1 day ago

✨ cargo-semver-checks v0.26 is out ✨

Four new lints + some library API improvements. Enjoy!

#rustlang #semver

Release page for cargo-semver-checks v0.26. Release reads:

Four new lints related to items being removed from the public API by making them #[doc(hidden)]. All contributed by @u9g:
- struct_now_doc_hidden
- enum_now_doc_hidden
- function_now_doc_hidden
- trait_now_doc_hidden

All these are semver-major changes, as described in this post:

Plus, an update to our library API to allow suppressing cargo-semver-checks logging output, to make it more pleasant for other tools to plug in cargo-semver-checks functionality as a library. Contributed by @markhaehnel.

Semver-checking with this release requires Rust 1.71+.
Cindʎ Xiao 🍉
2 days ago

You can take this a step further and write a script that automatically extracts all of this panic location metadata, in your reverse engineering tool of choice. I wrote a quick Binary Ninja script that goes and extracts all panic location metadata, finds the locations in the code where they are referenced, and then annotates each location with a tag that displays the extracted source file information. Here are the tags generated by my script, run on a piece of Rust malware targeting macOS systems, RustBucket.

(I like having the scream emoji everywhere 😱)

#rust #rustlang #ReverseEngineering #MalwareAnalysis

A screenshot of Binary Ninja's Tags view showing tags for panic locations in a Rust binary, including file paths, line numbers, and column numbers, with the line "library/std/src/sys/unix/thread_parking/ line 51, col 9" highlighted. A scream emoji is used to annotate all tags.
Cindʎ Xiao 🍉
2 days ago

Note that this location information is only embedded into Rust binaries if the developer uses the default panic behaviour, which unwinds the stack, cleans up memory, and collects information to show in the panic message and in backtraces. You can read more about the details of the default panic implementation in the Rust standard library in the Rust Compiler Dev book.

Developers can trivially strip the location information by just putting panic = 'abort' when specifying the build profile in their Cargo.toml build configuration file; this will cause the program to immediately abort on panic instead, without taking any further actions. Developers can also provide their own custom panic handlers - you can learn more about this in my previous post about the panic handlers used by the Rust code in the Windows kernel, here:

Of course, a lot of Rust malware out there doesn't even bother taking the more basic step of stripping symbols, much less this panic information... 😉

#rust #rustlang #ReverseEngineering #MalwareAnalysis

Cindʎ Xiao 🍉
2 days ago

Compare the above snippet of source code with the decompiler's output, at one of the locations where this particular core::panic::Location struct is referenced. We can see the following arguments all being passed into the function sub_18001ee90, which is the entry point to the panic handling logic (notice how the branch where that function is called is also noreturn).

1) The fixed error message for the unreachable!() macro (internal error: entered unreachable code)

2) The length of that error message string (0x28 characters)

3) The address of that core::panic::Location struct.

} else {
sub_18001ee90("internal error: entered unreachable code", 0x28, &panic_location_"library\std\src\sys\windows\")
uint64_t n_6 = n * 2
if (n_6 u>= 0xffffffff) {
n_6 = 0xffffffff
n_2 = n_6

The information passed in the arguments is used to construct the message that the program emits when it panics, which in this case will look something like the following:

thread 'main' panicked at 'internal error: entered unreachable code', library\std\src\sys\windows\

We can also see several other features which appear in the original source code at this location:

1) The check of the GetLastError() result against the ERROR_INSUFFICIENT_BUFFER error code.

2) The saturating multiplication of the variable n.

#rust #rustlang #ReverseEngineering #MalwareAnalysis

Cindʎ Xiao 🍉
2 days ago

Because the Rust standard library is open-source, we can actually go read the source code at the place that this core::panic::Location data points to. The Rust compiler and standard library live in the same Git repository (rust-lang/rust) and are released together; the last piece of information we need to find the source code here is the Git commit ID of the Rust compiler / standard library version that was used to create this binary.

This is something we can find by examining some of the other strings in this binary, which contain paths like this, which have the rustc commit ID embedded inside them:


We can now look up the exact location in the source code: rust-lang/rust commit 8ede3aae, File library\std\src\sys\windows\, Line 252 (0xfc), Column 17 (0x11):

fn fill_utf16_buf<F1, F2, T>(mut f1: F1, f2: F2) -> crate::io::Result<T> {
if k == n && c::GetLastError() == c::ERROR_INSUFFICIENT_BUFFER {
n = n.saturating_mul(2).min(c::DWORD::MAX as usize);
} else if k > n {
n = k;
} else if k == n {
// It is impossible to reach this point.
// On success, k is the returned string length excluding the null.
// On failure, k is the required buffer length including the null.
// Therefore k never equals n.
unreachable!(); // ⬅️ This is the location from our binary!
} else {

This is indeed a place where the code can panic! The unreachable!() macro is used to mark locations in the code that should never be reached, in cases where reachability cannot be automatically determined by the compiler. The documentation for unreachable!() says:

This will always panic! because unreachable! is just a shorthand for panic! with a fixed, specific message.

#rust #rustlang #ReverseEngineering #MalwareAnalysis

Cindʎ Xiao 🍉
2 days ago

Now that we know the layout of core::panic::Location in our binary, let's define a new type in Binary Ninja which we can apply to the binary. My type definition for this binary is as follows:

struct core::panic::Location
struct RustStringSlice file
char* address;
int64_t length;
uint32_t line;
uint32_t col;

The screenshot shows this new type definition applied to the sequence of data, in a nice readable form which shows the line number and column number at a glance.

#rust #rustlang #ReverseEngineering #MalwareAnalysis

A screenshot of Binary Ninja, showing a struct containing the following data:

struct core::panic::Location panic_location_"library\std\src\sys\windows\" = 
    struct RustStringSlice file = 
        char* address = data_18003adb0 {"library\std\src\sys\windows\"}
        int64_t length = 0x22
    uint32_t line = 0xfc
    uint32_t col = 0x11
Cindʎ Xiao 🍉
2 days ago

The type that contains this location information is core::panic::Location (documentation here) which has the following definition. It consists of a string slice reference (&str), and two unsigned 32-bit integers (u32). The string slice reference &str represents a view of a string, and is made up of two components: a pointer, and a length.

pub struct core::panic::Location<'a> {
file: &'a str,
line: u32,
col: u32,

Using Binary Ninja, let's look inside a Rust binary at a place where one of the source file path strings is referenced. This is actually a core::panic::Location struct, embedded inside the binary.

We can see the following pieces of data, and we can match them against the fields in core::panic::Location:

1) A pointer with the value 0x18003adb0, which is the address where the source file path string resides. This is the pointer component of the string slice file.

2) A sequence of bytes with the value 22 00 00 00 00 00 00 00, which is the little-endian 64-bit integer value 0x22. This is the length component of the string slice file. Note how the length of the path string library\std\src\sys\windows\ is 34 (0x22) bytes (when encoded with UTF-8, which is always the encoding used by &str).

3) A sequence of bytes with the value fc 00 00 00, which is the little-endian 32-bit integer value 0xfc. This is the unsigned 32-bit integer line.

4) A sequence of bytes with the value 11 00 00 00, which is the little-endian 32-bit integer value 0x11. This is the unsigned 32-bit integer col.

⚠️ Caution: In this case, the order of the fields in the compiled binary matched against the definition of core::panic::Location. However, you cannot rely on this always being the case; the Rust compiler is free to reorder these fields however it wants. Therefore, you must do the work of examining the data in your particular binary, and deducing from that what the layout of core::panic::Location in your binary is!

For more details on what guarantees the compiler makes (or more importantly, doesn't make) about type layouts, see this section in the Type Layout chapter in The Rust Reference.

#rust #rustlang #ReverseEngineering #MalwareAnalysis

A screenshot of Binary Ninja showing a pointer to the string "library\std\src\sys\windows\", followed by a sequence of bytes with the value `22 00 00 00 00 00 00 00`, a sequence of bytes with the value `fc 00 00 00`, and a sequence of bytes with the value `11 00 00 00`.
Cindʎ Xiao 🍉
2 days ago

🦀 🧵 Rust reversing thread: Let's use panic metadata embedded inside Rust binaries to help us reverse engineer!

If you've ever looked inside the strings of a Rust binary, you may have noticed that many of these strings are paths to Rust source files (.rs extension). These are used when printing diagnostic messages when the program panics, such as the following message:

thread 'main' panicked at 'oh no!', src\

The above message includes both a source file path src\, as well as the exact line and column in the source code where the panic occurred. All of this information is embedded in Rust binaries by default, and is recoverable statically!

Examining these can be useful in separating user from library code, as well as in understanding functionality. This is especially nice because Rust's standard library and the majority of third-party Rust libraries are open-source, so you can use the panic strings to find the relevant location in the source code, and use that to aid in reversing.

#rust #rustlang #ReverseEngineering #MalwareAnalysis

Davy :ferris:
2 days ago

When unsafe Rust is very unsafe... and angry :ferris: (spotted near Howth Harbour, Ireland - a month ago)

#rust #rustlang

Restaurant sign with "CRABBY JO'S" written on it.
2 days ago

@sienna I always find it interesting when people call out #RustLang for being too verbose. After using Rust almost daily for two years, I would personally call Rust “just verbose enough.” Sure there are some warts and corner cases which could be improved, but that’s every language.

Joshua Byrd 🎄
2 days ago

I thought I might try blogging some kind of Rust tutorial alongside learning it myself. So anyway here's the first of a series if you wanna follow along. Just a simple Hello World!

#Rust #RustLang #Tutorial #Blog #Programming

Lord Olle W
2 days ago

Lucka 8 - Poängsystem

Nu är det dags att öppna lucka 8 av Agicals julkalender med spelmakarstuga. Igår la vi till så att spelaren kan skjuta ner de elaka fyrkanterna. Idag lägger vi till poängräkning. Hörde vi ”Score!“?

#rust #RustLang #gamedev #game #programmering #Adventskalender #macroquad #spel #spelutveckling

Ett datorfönster med lila bakgrund fylld med olika stora gröna fyrkanter, en gul cirkel och flera små vita cirklar. Nere i vänstra hörnet står det ”Poäng: 4711”. I nedre högra hörnet är Ferris the Rustacean med tomteluva och spelkontroller. Överst står texten: Spelmakarstuga från Agical
Luca Palmieri
2 days ago

Quickstart tutorial for Pavex ✅

Next on the checklist: adding links to the relevant items in the API reference as well as linting to make sure that examples don't go stale.

#rustlang #pavex

2 days ago

Thinking of diving back into Ocaml – last time, I was chasing something more "pure" than Rust. Now, I'm on the lookout for a language with a speedy prototyping cycle and a Rust-like vibe. Does that click for you? #ocaml #rustlang

Guillaume Gomez
2 days ago

The display of features in rustdoc has been fixed once again.


#rust #rustlang

Thorsten Leemhuis (acct. 1/4)
2 days ago

The @LWN articles on this years #Linux #kernel maintainers summit are now freely available:


* Trust in and maintenance of #filesystems.

* Committing to #Rust / #Rustlang for kernel code

* Reducing kernel-maintainer burnout

* A discussion on kernel-maintainer pain points

Side note: if you wonder who the #LinuxKernel developers in below picture are, checkout this page:

picture from
Ed Page
2 days ago

winnow, my parser combinator library, now includes a nom migration guide:


3 days ago

I love this! This is such a good description of how we (often subconsciously) handle many of the trade-offs for design decisions in #rustlang. I'm really excited to see this written down!

What beliefs do you think are fundamental to Rust?

Read Niko's blog post here:

Screenshot of part of Niko's blog post:

    We believe that…

Rust is meant to empower everyone to build reliable and efficient software, so above all else, Rust needs to be accessible to a broad audience. We avoid designs that will be too complex to be used in practice. We build supportive tooling that not only points out potential mistakes but helps users understand and fix them.
Rust users want to surface problems as early as possible, and so Rust is designed to be reliable. We make choices that help surface bugs earlier. We don’t make guesses about what our users meant to do, we let them tell us, and we endeavor to make the meaning of code transparent to its reader. And we always, always guarantee memory safety and data-race freedom in safe Rust code.
Rust users are just as obsessed with quality as we are, and so Rust is extensible. We empower our users to build their own abstractions. We prefer to let people build what they need than to try (and fail) to give them everything ourselves.
Systems programmers need to know what is happening and where, and so system details and especially performance costs in Rust are transparent and tunable. When building systems, it’s often important to know what’s going on underneath the abstractions. Abstractions should still leave the programmer feeling like they’re in control of the underlying system, such as by making it easy to notice (or avoid) certain types of operations.

    …where earlier things take precedence.
3 days ago

💥 New Changelog interview!

This week we’re joined by @drewdevault, talking about the Hare programming language 🐇

We discuss Hare (of course), why he’s so passionate about all things open source, the state of the language, fostering a culture that values stability, and oddly enough — what it takes to make a peanut butter and jelly sandwich 🥪

#foss #oss #opensource #hare #harelang #rust #rustlang #zig #ziglang #sourcehut #github

We hope you enjoy it! 🎧

3 days ago

@Exilsarahl hello, i am from the church of #kicad Please be knowenth that this kind of shit never happens around here in our sacred halls.

(but the codebase is really ugly and should be rewritten in #rustlang

Chris Biscardi
3 days ago

I also started publishing #bevyengine Game Jam 4 devlogs!

I don't know how much I'll actually finish during the jam, but my overall goal is to use this week as a spike towards getting something I feel comfortable publishing on steam.

#rustlang #gamedev

Chris Biscardi
3 days ago

There's a whole bunch of #adventofcode goodness in this playlist.

From should you even participate? to solutions to each day and even refactoring and discussion of various tools to benchmark with.


Ivan Enderlin 🦀
4 days ago

@reginagrogan #RustLang is probably a more accurate hashtag 🙂.

Ivan Enderlin 🦀
4 days ago

Add support for `gen fn`,

Experimental new `gen fn` has landed in Rust (nightly).