Tech corner - 17. October 2023

Undone Programming Newsletter #6

header_image

It seems to be the norm now that we bring you at least one Rust-based article. This issue is no different, as we look at schedulers and async task execution and efficient parsers in the Rust environment.

Following that is a summary of when you should and shouldn’t use an actor model, and we’ll close with a bit of math and type level programming stuff. Happy reading!

The State of Async Rust: Runtimes

This is an interesting article which may sound counterintuitive to many programmers, whether they are Rust developers or coming from different ecosystems.

We have come a long way to now be perceiving green threads and language runtimes with their schedulers as more efficient constructs than using OS-level threads. Go goroutines, Kotlin coroutines, Java 21’s Project Loom, Scala’s Cats Effect or ZIO libraries are all good examples of this. Similarly, there are library level runtimes in Rust, like Tokio, which take care of scheduling and executing async tasks.

This article questions whether this is the best model, and if for some scenarios, using OS threads and letting OS handle the scheduling might be easier to ...might be easier to understand, without it also being a performance issue.

Rust: The joy of safe zero-copy parsers

Rust again. This article explains some of the basic memory-management concepts of Rust using the example of zero-copy parsers. It shows that the C implementation is lacking the guarantees and can lead to undefined and unsafe behavior, however, Rust can enforce the safe memory access at compile time. 

Turning actors inside-out

Do you know the actor pattern? Do you have experience in writing systems using an actor implementation like Akka? I quite agree with the sentiment expressed in this article about actors not always being the best tool for the job. In particular, that they can bring a lot of accidental complexity and that the code is very hard to read and process as a mental model. In most use-cases when we deal with only local state, they can be replaced by other techniques that are much easier to work with. Still, there’s a space where actors shine and where there are very few alternatives: scalable, durable and high-throughput distributed stateful systems. Have a read of this article to find out more.

The relationship between module systems, existential types and abstract data types

Here’s something for the nerds. If you like math formalism and type theory, this short article sketches an interesting idea of the relationship between modules and existential types. It assumes knowledge of what an existential type is, and while you’re at it, add path dependent and phantom types to that too. You’ve been warned!


blog author
Author
Michal Kaščák

I am a knowledge-obsessed, life-positive software developer who approaches every day with a passion for learning and a drive to inspire others. As a natural problem solver, I excel at applying creative thinking to solve complex problems and am constantly pushing the boundaries of what is possible in software development.

Read more

Contact us

Let's talk

I hereby consent to the processing of my personal data.