Posts

Showing posts from 2024

Diving Deep: My Journey into Functional Programming – A Technical Exploration

 For a long time, I’d heard the buzz around functional programming – the elegant code, the focus on immutability , the promise of easier testing. But frankly, it felt abstract. My background was largely in imperative languages , and the shift felt… significant. This post isn't about converting you to a functional evangelist, but rather about my personal journey into this paradigm, particularly focusing on the deep technical challenges and rewards of embracing it.  Before starting, let me share some of great talks I've bookmarked: https://www.youtube.com/watch?v=ZhuHCtR3xq8 https://www.youtube.com/watch?v=z0N1aZ6SnBk   The Initial Resistance (and Why It’s Valid) Let's be honest – the initial learning curve was steep. Moving from thinking about how to change data to thinking about what to compute was a mental shift. The lack of side effects felt restrictive at first. I wrestled with recursion , struggled to visualize immutable data , and questioned the efficie...

Automotive Software: AUTOSAR and Beyond

Steering the Future: Automotive Software Standards and the Rise of the Software-Defined Vehicle 🚗💻 The automotive industry is in the midst of a revolutionary shift, transforming from mechanical marvels into sophisticated, software-defined vehicles (SDVs) . For aspiring and current automotive software engineers, navigating the complex landscape of standards and emerging trends is no longer optional—it's essential. The Foundation: Understanding Classical AUTOSAR The backbone of modern Electronic Control Unit (ECU) software is AUTOSAR (AUTomotive Open System ARchitecture) . This standard has been instrumental in enabling software portability, reusability, and modularity across different vehicle platforms and suppliers. Key AUTOSAR Concepts: Layered Architecture : Think of AUTOSAR like a structured building. Application Layer : The "user" level, where high-level functions like cruise control logic reside. Runtime Environment (RTE) : The crucial middleman, enabling communica...

Implementing a CRDT Application with JavaScript and C++ Clients

Implementing a CRDT Application with JavaScript and C++ Clients In today’s interconnected world, distributed systems are everywhere—from collaborative editing tools and messaging apps to cloud databases and IoT networks. One of the biggest challenges in these systems is ensuring that data remains consistent across multiple devices and platforms, even when updates happen independently and network partitions occur. Traditional approaches often rely on complex conflict resolution or central coordination, which can introduce latency, bottlenecks, or even single points of failure. Enter Conflict-free Replicated Data Types (CRDTs) , a family of data structures designed to make distributed consistency simple, robust, and scalable. A Brief History and Theoretical Foundations of CRDTs The concept of CRDTs emerged in the late 2000s as researchers and engineers sought better ways to handle data replication in distributed systems. The foundational work by Marc Shapiro and others formalize...

Digging deep with heaptrack/massif

Debugging Memory Growth on a Ti-Sitara AArch64 ECU with Heaptrack A while back I had to track down a recurring heap growth issue on a customer’s automotive ECU based on a TI Sitara Cortex-A53. The system ran multiple ML models for ADAS feature extraction at different frequencies. Each model ran in its own POSIX preemptive real-time thread, pinned to cores with priorities like 120, 110, 80, 60 . When switching scheduling policies (for example SCHED_OTHER → SCHED_RR or SCHED_FIFO under PREEMPT_RT), the visible priority ranges changed — which is expected behavior on a real-time patched kernel. The Problem Over time, memory usage crept up until the system became unstable. The workload made it tricky — multiple ML models meant irregular allocation patterns with frequent buffer churn. I needed something lightweight that could run directly on the target to pinpoint the source. Why Heaptrack Heaptrack turned out to be the best fit. It hooks into memory allocations using a preload li...