NullDeref
Mario Ortiz Manero's personal blog with his life learnings.
Latest posts
Lessons on Mobile App Promotion I've Learned the Hard Way
Screen Time App Opal Jokes about Being Bought by Meta
How to Reduce Screen Time: The Ultimate Guide
The German language broke my website
My app sucked (but it's okay)
I blasted over a speed bump to create my landing page
New year, new silly app
So far, the year is off to a great start. New Year’s resolutions aren’t my thing, but this time I’ve made an exception. Not so much with specific objectives but rather broad goals. The biggest one is to be more mindful. I want to observe more, reflect, and act: Sport does me so much good, but in 2024, planning it was a mess. Maybe a swimming club will make it easy to go regularly, for fun. Having…
I've quit my job to get you off your phone
I never expected quitting a job to be so hard! My time at Lyft has been an enriching journey. Tons of smart people at three very different teams, where I’ve learned how the industry works. The technical challenges were endless: from user-facing features in the app to improving the safety of our routing . But after two years, I’ve realized that it just wasn’t making me happy. My disconnect with the…
Blindsided by Rust's Subtyping and Variance
Table of Contents The problem Debugging Some progress… or not? Discovering the root cause Trying to fix it Attempt #1: GATs Attempt #2: transmute Attempt #3: getting rid of BorrowOwned<'a> Conclusion Subtyping and variance is a concept that works in the background, making your life easier without you knowing about it. That is, until it starts making your life harder instead. It’s a good idea to…
Beyond Dumbphones: Building a Minimalist Yet Functional Phone
Table of Contents Looking at the state of things Technology Negative effects Companies Software Accessories Phones Wrapping up What if there was a company selling phones that, against all odds, optimized how little they were used? There’s a lot of potential here, given that every company is trying to get you hooked on their app. “Dumbphones” have emerged for this very reason. These are phones…
The bane of my existence: Supporting both async and sync code in Rust
Table of Contents Introduction The first approaches Good ol’ copy-pasting Calling block_on Duplicating the crate What ended up “working”: the maybe_async crate The problem The feature resolver v2 Other fails Fixing maybe_async Official Support Conclusion Introduction # Imagine you want to create a new library in Rust. All it does is wrap up a public API that you need for something else, like the…
[Talk] Rust, the best and worst thing to happen to Tremor
Hello! I’ve recently had the pleasure of giving a talk at this year’s TremorCon . I really enjoy public speaking, so this has been an excellent opportunity to get better at it (let me know your thoughts!). In case you missed it, you can check out the recording here: You can also find the slides here in pdf or in pptx . If you want to learn about new events I’m involved in, like this one, you can…
Plugins in Rust: Wrapping Up
Table of Contents Benchmarking Tooling Methodology Experiments Type conversions Double Box Hash table optimization abi_stable Unimplemented ideas More detailed benchmarking Investigate wrapper overhead Investigate async runtime conflicts Benchmark async_ffi Improve error reporting Reduce error handling boilerplate Reduce async boilerplate Improve cross-platform support Performance impact of panic…
Plugins in Rust: Getting our Hands Dirty
Table of Contents Some prototyping advice The “just make it work” approach Specific to Rust Defining the plugin interface Recursively making everything #[repr©] Overcoming problems with #[repr©] Reaching #[repr©] blockers Approach 1: Avoid the type in the first place Approach 2: Implement a wrapper Approach 3: Re-implement with #[repr©] from scratch Approach 4: Simplifying the type at the FFI…
Plugins in Rust: Reducing the Pain with Dependencies
Table of Contents Handy tools for our Plugin System Async with the C ABI LCCC Safer FFI CGlue Miri cbindgen Working with abi_stable Versioning Loading plugins Handling state Regular Rust Interface types Trait objects Error handling Version mismatch Missing fields and wrong types Panicking Panicking and FFI Aborting C-unwind AbortBomb Recovering with catch_unwind Type conversions Thread safety…
Designing an API Client in Rust: New RSpotify Version a Year Later
Table of Contents The story Making the API HTTP-client agnostic Finding a more robust architecture Configuration Runtime over compile-time Sane defaults Flexibility Taking borrowed/generic parameters Optional parameters Splitting up into multiple crates Documentation Introducing how to use the crate Helping users upgrade Macros Other goodies Cached and self-refreshing tokens Type-safe wrappers for…
Plugins in Rust: Diving into Dynamic Loading
Table of Contents Learning more about connectors About Tremor My next steps On software engineering How Tremor works Taking a look at eBPF first Getting deeper into dynamic linking Versioning Loading plugins Handling state Generics in plugins? dyn in plugins? The C way Error Handling Missing fields Version mismatch Wrong type Wrong address Panicking Full implementation Conclusion In the last…
Plugins in Rust: Getting Started
Table of Contents About Tremor Getting to know the team Getting to know other mentees Learning about the internals of Tremor The first steps Experimenting with dynamic loading ABI unstability, it’s much worse than it seems Getting a simple example running Generating bindings crate-type values rlib files Can we use WebAssembly for this? WebAssembly targets wasmer vs wasmer_runtime More complex…
Why you shouldn't obsess about Rust "features"
Table of Contents The Problem An Alternative Proving that you end up with the same code You can probably afford the overhead anyway Conclusion Rust makes it very easy to express conditional compilation, especially thanks to Cargo “features” . They’re well integrated into the language and are very easy to use. But one thing I’ve learned by maintaining RSpotify (a library for the Spotify API) is…
Plugins in Rust: The Technologies
Table of Contents The Problem Safety Concerns Unsafe Code Error Resilience Remote Code Execution via Plugins Backward Compatibility Possible Solutions Avoiding Breakage Possible Approaches Scripting Languages Inter-Process Communication Dynamic Loading WebAssembly Prior Art Conclusion Welcome to the “Plugins in Rust” series ! During the next months I’ll be involved in a project with Tremor , for…
Optional parameters in Rust
Table of Contents Introducing an example A) Using Option Upsides Downsides B) With Into<Option > Upsides Downsides C) With a custom struct Upsides Downsides D) With the builder pattern Upsides Downsides E) Endpoint-oriented interface Upsides Downsides F) Hybrid derive pattern Upsides Downsides G,H) Grouping up endpoints Upsides Downsides I) Macros Conclusion Optional or default parameters are a…