<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Welcome on David Álvarez Rosa | Personal Website</title><link>https://david.alvarezrosa.com/</link><description>Recent content in Welcome on David Álvarez Rosa | Personal Website</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 22 Apr 2026 20:14:00 +0100</lastBuildDate><atom:link href="https://david.alvarezrosa.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Fundamental Theorem of Calculus</title><link>https://david.alvarezrosa.com/posts/fundamental-theorem-of-calculus/</link><pubDate>Wed, 22 Apr 2026 20:14:00 +0100</pubDate><guid>https://david.alvarezrosa.com/posts/fundamental-theorem-of-calculus/</guid><description>&lt;p&gt;Although the notion of area is intuitive, its mathematical treatment
requires a rigorous definition. This post introduces the Riemann
integral, and proves the fundamental theorem of calculus&amp;mdash;a beautiful
result that connects integrals and derivatives.&lt;/p&gt;
&lt;h2 id="riemann-integral"&gt;
 Riemann integral
 &lt;a class="anchor" href="#riemann-integral"&gt;&amp;sect;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Given a bounded&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; function \(f\colon[a,b]\to\mathbb{R}\), we can approximate the
area under its graph by rectangles. Choose a partition of its domain&lt;/p&gt;
&lt;p&gt;\[
\mathcal{P}=\{x_0,x_1,\ldots,x_n\mid a=x_0&amp;lt;x_1&amp;lt;\cdots&amp;lt;x_n=b\}.
\]&lt;/p&gt;
&lt;p&gt;For each subinterval \([x_{k-1},x_k]\), define the width \(\Delta
x_k=x_k-x_{k-1}\), and let \(m_k\) and \(M_k\) denote the infimum and
supremum of \(f\) on that subinterval. The lower and upper sums are&lt;/p&gt;</description></item><item><title>Optimizing a Lock-Free Ring Buffer</title><link>https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/</link><pubDate>Tue, 24 Mar 2026 11:51:00 +0000</pubDate><guid>https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/</guid><description>&lt;p&gt;A single-producer single-consumer (SPSC) queue is a great example of how
far constraints can take a design. In this post, you will learn how to
implement a ring buffer from scratch: start with the simplest design,
make it thread-safe, and then gradually remove overhead while preserving
FIFO behavior and predictable latency. This pattern is widely used to
share data between threads in the lowest-latency environments.&lt;/p&gt;
&lt;h2 id="what-is-a-ring-buffer"&gt;
 What is a ring buffer?
 &lt;a class="anchor" href="#what-is-a-ring-buffer"&gt;&amp;sect;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt; &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;You might have run into the term circular buffer, or perhaps
cyclic queue. These are simply other names for a &lt;em&gt;ring buffer:&lt;/em&gt; a queue
where a producer generates data and inserts it into the buffer, and a
consumer later pulls it back out, in first-in-first-out order.&lt;/p&gt;</description></item><item><title>Deriving Type Erasure</title><link>https://david.alvarezrosa.com/posts/deriving-type-erasure/</link><pubDate>Tue, 10 Mar 2026 09:46:00 +0000</pubDate><guid>https://david.alvarezrosa.com/posts/deriving-type-erasure/</guid><description>&lt;p&gt;Ever looked at &lt;code&gt;std::any&lt;/code&gt; and wondered what&amp;rsquo;s going on behind the
scenes? Beneath the intimidating interface is a classic technique
called type erasure: concrete types hidden behind a small, uniform
wrapper.&lt;/p&gt;
&lt;p&gt;Starting from familiar tools like virtual functions and templates, we&amp;rsquo;ll
build a minimal &lt;code&gt;std::any&lt;/code&gt;. By the end, you&amp;rsquo;ll have a clear
understanding of how type erasure works under the hood.&lt;/p&gt;
&lt;h2 id="polymorphism-with-interfaces"&gt;
 Polymorphism with interfaces
 &lt;a class="anchor" href="#polymorphism-with-interfaces"&gt;&amp;sect;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The typical way to achieve polymorphism is to define an interface
consisting of pure-virtual methods you want to be able to call. Then,
for each implementation that you want to use polymorphically, you create
a subclass that inherits from the base class and implement those
methods.&lt;/p&gt;</description></item><item><title>Devirtualization and Static Polymorphism</title><link>https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/</link><pubDate>Wed, 25 Feb 2026 09:45:00 +0000</pubDate><guid>https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/</guid><description>&lt;p&gt;Ever wondered why your &amp;ldquo;clean&amp;rdquo; polymorphic design underperforms in
benchmarks? Virtual dispatch enables polymorphism, but it comes with
hidden overhead: pointer indirection, larger object layouts, and fewer
inlining opportunities.&lt;/p&gt;
&lt;p&gt;Compilers do their best to &lt;em&gt;devirtualize&lt;/em&gt; these calls, but it isn&amp;rsquo;t
always possible. On latency-sensitive paths, it&amp;rsquo;s beneficial to
manually replace dynamic dispatch with &lt;em&gt;static polymorphism&lt;/em&gt;, so calls
are resolved at compile time and the abstraction has effectively zero
runtime cost.&lt;/p&gt;</description></item><item><title>David Álvarez Rosa</title><link>https://david.alvarezrosa.com/about/</link><pubDate>Sat, 24 Jan 2026 12:31:00 +0000</pubDate><guid>https://david.alvarezrosa.com/about/</guid><description>&lt;style&gt;
 .signature { display: none; }
 sup { display: none; }
 .side img { max-width: 225px; box-shadow: none; margin-top: -26px;}
 @media (max-width: 860px) { .side img { margin-top: 0!important; } }
 main p:first-of-type::first-letter { float: revert; font-size: revert; font-family: revert; padding: revert; }
&lt;/style&gt;
&lt;p&gt; &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;Mathematician and engineer based in sunny Dublin, passionate
about low-latency, high-performance systems.&lt;/p&gt;
&lt;p&gt;Currently working in algorithmic trading at Susquehanna. Previously
designed and built systems at Amazon serving 10M+ monthly active
customers, developed semantic caching for LLMs at Sopra Steria, and
conducted quantitative cybersecurity risk analysis at Deloitte.&lt;/p&gt;</description></item><item><title>Page Not Found</title><link>https://david.alvarezrosa.com/404/</link><pubDate>Sat, 13 Dec 2025 22:23:00 +0000</pubDate><guid>https://david.alvarezrosa.com/404/</guid><description>&lt;style&gt; .signature { display: none; } main p:first-of-type::first-letter { float: revert; font-size: revert; font-family: revert; padding: revert; } &lt;/style&gt;
&lt;p&gt;That page couldn&amp;rsquo;t be found (404 error). Try the &lt;a href="https://david.alvarezrosa.com/"&gt;Home page&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Subscription</title><link>https://david.alvarezrosa.com/subscription/</link><pubDate>Sat, 13 Dec 2025 22:06:00 +0000</pubDate><guid>https://david.alvarezrosa.com/subscription/</guid><description>&lt;style&gt; .signature { display: none; } main p:first-of-type::first-letter { float: revert; font-size: revert; font-family: revert; padding: revert; } &lt;/style&gt;
&lt;p&gt;Welcome! Your subscription is confirmed. Thanks for signing up.&lt;/p&gt;
&lt;p&gt;You can unsubscribe anytime by emailing &lt;a href="mailto:david@alvarezrosa.com"&gt;david@alvarezrosa.com&lt;/a&gt; from the
same email address you subscribed with.&lt;/p&gt;</description></item><item><title>About this Site</title><link>https://david.alvarezrosa.com/posts/about-this-website/</link><pubDate>Fri, 11 May 2018 21:18:00 +0100</pubDate><guid>https://david.alvarezrosa.com/posts/about-this-website/</guid><description>&lt;p&gt;After nearly a decade, I&amp;rsquo;ve rebuilt my personal site from scratch&amp;mdash;a
blog on software, self-hosting, and lessons learned along the way. This
first post is backdated to when I originally launched a site on this
domain, back in 2018.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What?&lt;/strong&gt;&amp;mdash;A personal blog. Posts aim to be concise, practical, and
rigorous.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&amp;mdash;To give back to the &lt;em&gt;libre&lt;/em&gt; software community. To keep a
record of my learning journey. To deepen my own understanding by
writing things down.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item></channel></rss>