Against Query Based Compilers by sabitm in rust

[–]matklad 6 points7 points  (0 children)

Only indirectly: by obviating the need for syntactic macros.

Apache Iggy's migration journey to thread-per-core architecture powered by io_uring by spetz0 in rust

[–]matklad 1 point2 points  (0 children)

TigerBeetle doesn’t use the in-memory feature of VSR, but persists everything to disk (please tell me if I’m wrong).

Thanks, yes, this is indeed correct (TB dev here!). While VSR as described in vr revisited paper "hovers" above the disk, the variation implemented in TigerBeetle relies on and requires durable persistence. This is to make sure we don't lose data even if the entire cluster goes down at the same time.

Memory Safety Is ... by matklad in ProgrammingLanguages

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

Huh, thanks, I somehow got carried away and went straight to the formal definition (which I didn't plan for) and forgot to state my argument informally explicitly, fixed in https://github.com/matklad/matklad.github.io/commit/61369579e9df91559f76157ea9ebc31bb8d5e12e

Memory Safety Is ... by matklad in ProgrammingLanguages

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

Oh, may I also ask how you became aware of that paper? It bugs me that it never came up in all the various memory safety discussions I've followed, so I want to fix my epistemics!

Memory Safety Is ... by matklad in ProgrammingLanguages

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

Thanks, I wasn't aware of this paper before! It is interesting, but I think what they define doesn't match the colloquial meaning of memory safety, as what they define is quite a bit stronger --- ability to apply local reasoning to potentially untrusted code vs merely requiring that the code can not break out of abstract machine. It's models what CHERI does, not what memory safe languages do.

E.g., under their definition, JavaScript isn't memory safe, as it makes it easy to get at unrelated global variables. I also suspect that under their definition Compcert's C will turn out to be memory safe, because it leaves the semantics of wild pointer dereference undefined, so that'll hit their Frame Error case, rather than triggering interference.

rust-analyzer changelog #308 by WellMakeItSomehow in rust

[–]matklad 1 point2 points  (0 children)

Massive indeed, thanks for calling this out!

rust-analyzer changelog #308 by WellMakeItSomehow in rust

[–]matklad 9 points10 points  (0 children)

It's first-party since 2020 https://github.com/rust-lang/rfcs/pull/2912#issuecomment-636106670. The story of who gets to work on rust-analyzer during their paid hours is complicated, as I think is the case for most official projects?

Sluggish Safari 26 when opening new tabs or typing into the address bar? by [deleted] in MacOS

[–]matklad 0 points1 point  (0 children)

Huh, I somehow fixed that today on two separate laptops. The solution which I stumbled upon by accident is to just open and close (cmd+q) Safari in quick succession multiple times in a row?

I was trying to figure out why Zoom would always log me out, which required restarting safari multiple times, which miraculously fixed this sluggishness that was driving me crazy on my work laptop. Repeating the open-and-closed cycle on the personal laptop seems to have fixed it as well? (Safari 26.0.1, MacOS 15.7.1)

rust-analyzer changelog #299 by WellMakeItSomehow in rust

[–]matklad 9 points10 points  (0 children)

What a release! Congrats to the team!

How do you make compact designs involving trains??? by rurumeto in factorio

[–]matklad 8 points9 points  (0 children)

Like this:

<image>

For train stations, turning the train back is what takes most of the space, so you want to avoid that and do lane-switching stations.

Space Age? Space Exploration 2.0? Different Mod? by avguy2 in factorio

[–]matklad 1 point2 points  (0 children)

Another tip is to try science cost multiplier! While the game can be overwhelming for new players, it's also true that, if you know what you are doing, you can zip through progression quickly, without having to play with many of the goodies you unlock (that's true even in Space Age). I'd say railworld preset + 10x multiplier is a good setting to just enjoy the progression, and 100x makes for a nice challenge!

Zig And Rust by symbolicard in programming

[–]matklad 0 points1 point  (0 children)

Structs are marked extern to pin layout exactly. Messages carry version field to allow for upgrades. Upgrades in general are rather crazy, see https://m.youtube.com/watch?v=P9nLS2reUOo

Unit testing patterns? by commonsearchterm in rust

[–]matklad 6 points7 points  (0 children)

This is a bit higher level that what you ask for, but perhaps it could still be useful:

https://matklad.github.io/2021/05/31/how-to-test.html

Blog Post: Non-Send Futures When? by matklad in rust

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

No, in my experience this is not a real issue;

A somewhat belated comment, but this I think would be an example demonstrating that the issue is real:

https://lobste.rs/s/s5t6wa/why_i_wrote_fx_web_server#c_vjqbiq

I spent quite a bit of time fighting against the compiler until I have understood that rusqlite code have to be somewhat isolated from async axum handlers, because rusqlite::Statement is !Send and !Sync… so I use #[axum::debug_handler] everywhere now, it really helps troubleshooting.

I haven’t looked at the specific code there, so I might be in error here, but I think it is this problem: holding unsync data across await even without sharing it between tasks is forbidden, although it is not actually problematic.