Speeding Up Applications With Async

Context About a week ago, I decided to publish my newest album onto my music page which is built using the faircamp static site generator. faircamp has to generate a bunch of files at build-time for deliverables and streamable files. In total, this means that every track has to be built three times in my configuration: Opus 96kbps (streaming) MP3 (streaming for better support on older platforms) Opus 128kbps (deliverable) In total – for me – that was 92 tracks. All of these 92 tracks are produced sequentially using ffmpeg1 which for me takes ages – 10 minutes or 670 seconds to be exact. ...

September 5, 2024 · 5 min · Moritz Sokoll

Rust Type Magic

What are types? Types in programming languages are different across the board. Essentially the only common denominator is primitive types. These are types that are not implemented with the language and exist as a consequence of the languages features but rather they are a part of the language. Some common types include: integers characters strings booleans floats This list is going to be different for every language but it works in general. ...

June 13, 2024 · 5 min · Moritz Sokoll

Rust Error Handling

Error handling is hard rusts error handling is substantially different from other languages. For a quick comparison let’s look at a python example: try: # code that fails except: # what happens when code fails This approach, although intuitive, leaves some important flaws. Namely: Unhandled errors may occur Errors are propagated implicitly, not explicitly, which can lead to some unwanted behavior If your try-block ends up containing multiple parts of code that could fail you have to handle each of them separately How rust handles errors If you have used rust before you’ll already know what comes up. The two main types for error handling in rust are Result and Option. The latter technically doesn’t count as an error type as it just represents the case where an operation may return nothing (i.e. NULL in C, None in python, etc.). The real error type is Result. ...

May 5, 2024 · 7 min · Moritz Sokoll