My name is Marius, this is me thinking about life and software, discovering old lessons and learning new stuff.
(Non) Functional Rust, Option and Patterns
Patterns of writing code, functional or not, seem to appl...
Higher Level Languages
One way of looking at programming languages or languages, in general, is as translation vehicles from higher level concepts into lower level representations. For example, English converts a higher level concept, i.e. an idea, a thought, into a lower level representation, i.e. soundwaves. Product managers write (high level) specs, that is what they expect the product to be. Engineers, process that input, and compile it along with the rest of their understanding of the subsystems and produce an even lower representation, i....
Piping in Rust
A macro way of piping functions together in Rust to simulate the functional pipe operator....
The productivity of a language - the case of Rust macros
I have given up on choosing a language to be my favourite, mainly due to how many trade-offs there are when choosing one language. It was C++ at first, my first true love, due to the power I felt when managing those pointers. Then came Python for the speed of iteration, and eventually I grew more attracted by OCaml and Rust. Both of them shifted some mental furniture that made me see program design with different lenses....
Experience
I am finally able to appreciate experience. My ego is finally giving it to the people who earned it....
Timing Your Function Execution (in Rust)
If you ever had to migrate some slow code (Python) to Rust and were mindblown by the speed gains, you are probably now always paranoid for adding extra new code, just so you don’t ruin the amazing speed you gained. Those annoying new features adding extra cycles! I know I am. I have an AWS lambda function that used to run for 15 seconds end-to-end in Python. I managed to get it to 1....
Unit Testing in Rust (or why I love Rust)
If you’ve been through the process of adding unit tests in C++ with gmock or OCaml or python you know that you at least need to create a new file, add some linking flags, import a library and trigger the test suite from code and then execute the test program separately. No wonder it takes a not so subtle code review comment to get people to start writing tests. Let’s take another use case....
A less dreadful linked list (or why I like OCaml)
Let’s assume the entire universe hates linked lists. But in OCaml...
Hello World, yet another programming blog.
I recently listened to a podcast with Elizabeth Gilbert where she mentioned that sometimes when stumbling upon a well written sentence, it makes her want to stand up an clap at the beauty of it. I believe the same concept applies to code. Or at least it has happened to me a few times while reading code and being like Ok, that's beautiful. I stand by the idea that code is meant to be read, that, heuristically, code is probably read 10 times more than it is written and therefore we should also optimize for that....