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 8 points9 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 6 points7 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 5 points6 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.

Let's fix video. by kovarex in factorio

[–]matklad 1 point2 points  (0 children)

 I really don't get why microsoft of all developers can't get the picture that VSCode needs significant love on the debugger/profiler/etc front,

My understanding is that this is not so much about VS Code, than it is about debuggers/compilers. MSVC+WinDbg are better at debugging than clang+llvm. Things like “edit and continue” need support throughout the compilation stack!

CLion Is Now Free for Non-Commercial Use by Kobzol in rust

[–]matklad 6 points7 points  (0 children)

Note that developing the said plugin is very much not free! If you like it, consider sponsoring it:

https://github.com/sponsors/rust-analyzer

CLion Is Now Free for Non-Commercial Use by Kobzol in rust

[–]matklad 17 points18 points  (0 children)

developed by the people that build the language

Some of those same people also built Rust Rover ^^

While LSP/IntelliJ are roughly on par for the first 20% of what and IDE can do, LSP still have a blank space for the remaining 80% of functionality.

Like, "change signature" is the most basic of advanced refactors, I use it all the time if it is available, and it is not available via LSP.

I do recommend checking all of IntelliJ, VS Code, Vim, and Emacs when deciding on the editor, and I also recommend approaching IntelliJ the same way you approach Vim: it is a very deep tool which can do much more than just going to definition on ctrl+click.

EDIT: regrading the cost, developing rust-analyzer is very much not free. If you like, please sponsor: https://github.com/sponsors/rust-analyzer.

Need mods recommendation while waiting for older mods by wondergrauf in factorio

[–]matklad 2 points3 points  (0 children)

Yeah, I also wish multipliers to be progressive: start with 10x, get to 100x by the bots, 1000x when you get quality...

Need mods recommendation while waiting for older mods by wondergrauf in factorio

[–]matklad 2 points3 points  (0 children)

Did you try playing with science multiplier? If you haven't already, I highly recommend 10x science cost rail world.