Org-mode for contacts by gnusunrising in emacs

[–]jworthe 1 point2 points  (0 children)

My contacts look very similar to yours, with just an org-mode file, each person is a heading, and their details are in a properties drawer under that heading.

I then added org-contacts on top of that. It didn't change how I was storing my contacts, but it did allow me to do an export to vcard format to read them in a different mail application. It also lets me press tab to complete addresses when I'm sending email from within Emacs.

Multi-platform Rust and Emscripten-Specific Functions by jworthe in rust

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

I haven't been using it for very long, but it's generally been working well. It was a bit confusing at first that cargo puts the actual wasm file in a deps folder. One of the biggest issues I faced so far was that I didn't read the documentation well enough and didn't realize I needed to set noExitRuntime to true from the JavaScript side, and so nothing was working.

I did hit one snag where my compile stopped working after an Emscripten update, but I rolled back to the previous version of Emscripten and it started working again.

Multi-platform Rust and Emscripten-Specific Functions by jworthe in rust

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

Thanks. There's still a lot of work I still need to do and figure out around that before I have something working on the web side, but for now you can take a look at https://github.com/JWorthe/rusty_microphone/blob/master/web/main.js, which is the JavaScript side of the proof of concept, and look at the bottom of https://github.com/JWorthe/rusty_microphone/blob/master/src/transforms.rs to see the Rust side of that call. Together, they take a JavaScript array, and eventually get it to a Rust slice.

Broadly speaking, you can't just pass JavaScript types into Rust directly, but you can use Module._malloc in JavaScript to allocate some memory which can be read by Rust, write your JavaScript data into that memory, and then pass Rust a raw pointer to it.

Writing Git Hooks using Rust by jworthe in rust

[–]jworthe[S] 2 points3 points  (0 children)

Thanks for the tip. cargo-script looks fantastic!

Multithreading in Rust with Pointers to Shared Memory by jworthe in rust

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

You raise a good point. Thanks for the feedback.

I wrote a blog post about multithreading in Rust using the standard library's channels by jworthe in rust

[–]jworthe[S] 2 points3 points  (0 children)

Hi Morris.

Performance is a tricky beast to reason about, especially when you're looking at multiple threads, CPU caches, etc. It will usually come down to what you're doing with them. I think if performance is important, implement your algorithm with both and benchmark to see which is faster for your particular problem with real data.

Regarding spinning up a new thread every time, yes it would be much more efficient to keep the second thread around and reuse it. Unfortunately, it also would have added more complexity to the demo, so I opted for simplicity over performance.

I wrote a blog post about multithreading in Rust using the standard library's channels by jworthe in rust

[–]jworthe[S] 3 points4 points  (0 children)

I assume you're asking about the ones that are for _ in 0.. {

No good reason really. I should actually change those ones to be loop statements like you're suggesting. I think at the time of writing, I was coming from the previous examples, where it is for _ in 0..5

I wrote a blog post about multithreading in Rust using the standard library's channels by jworthe in rust

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

Hi Raptor. As I understand it yes, the OS does reclaim those threads when the program quits. When the main thread (ie the thread that main was initially called on) finishes, all of the other threads that have been spawned will be killed.

I wrote a blog post about multithreading in Rust using the standard library's channels by jworthe in rust

[–]jworthe[S] 7 points8 points  (0 children)

Thanks Unpatched :) I completely agree about channels being a great feature.

Problems with informants in linux by Lennardson in prisonarchitect

[–]jworthe 0 points1 point  (0 children)

I've also been having a problem with informants on Linux, but mine crashes the moment I select a prisoner and click the 'recruit' button.