<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: oraziorillo</title><link>https://news.ycombinator.com/user?id=oraziorillo</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 20 Jun 2026 22:36:23 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=oraziorillo" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>I see, I agree that especially checking for null really comes to styles and opinions, I still don't have one I can call mine. Thanks for the explanation!</p>
]]></description><pubDate>Sat, 20 Jun 2026 22:27:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=48613581</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48613581</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48613581</guid></item><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>[deprecated post-edit] I guess I used function names beginning with underscore as it didn’t occur to me that it might be un-idiomatic. The intention was to make clear to myself that those functions are private and meant to be only used only in that file. [\deprecated post-edit]<p>About the second paragraph, first of all, thank you for the suggestions. Can I ask you to elaborate a little on the reasons for your proposals? For instance, even if redundant in some cases, I thought to myself it couldn’t be a bad thing to check for null pointers (though I could improve the error handling itself).</p>
]]></description><pubDate>Sat, 20 Jun 2026 20:43:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612822</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48612822</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612822</guid></item><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>ngl, it distracts from backprop itself a little, but teaches a lot about memory management. I did it this way because in parallel I wanted to get better at C, but if your aim is to purely work on ML fundamentals, it’s probably better to do it in python</p>
]]></description><pubDate>Sat, 20 Jun 2026 20:33:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612748</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48612748</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612748</guid></item><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>In general yes, but not if you are disciplined.<p>I’d put it this way: though the idea of ref counting felt very natural at the beginning for my use case, at some point I realized there were probably better techniques to achieve the same goal. I found myself multiple times writing nonsense like:<p>sum = value_add(v1, v2)
mul = value_mul(sum, v3)
[...]
value_release(sum)
value_release(mul)<p>so that later I could release the sum. When you only have one intermediate value it’s still acceptable, but at 3-4 it starts getting cumbersome.<p>After asking for feedback, someone rightfully pointed out that the better and faster approach for an autograd engine is using an arena allocator. My reason for saying “rightfully” is that arenas are ideal when you have many “objects” that have the same lifespan, such as the values involved in the forward/backward pass. RC is better when you have a lot of “objects” with independent lifespans.</p>
]]></description><pubDate>Sat, 20 Jun 2026 19:27:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=48612175</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48612175</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48612175</guid></item><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>Mainly did it for learning, as dgellow correctly presumed, but also there’s something intrinsically beautiful in writing code with zero dependencies</p>
]]></description><pubDate>Sat, 20 Jun 2026 19:03:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=48611960</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48611960</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48611960</guid></item><item><title><![CDATA[New comment by oraziorillo in "Show HN: Microcrad – Micrograd Reimplemented in C"]]></title><description><![CDATA[
<p>Hey HN, I'm Orazio. I built microcrad (with a 'c'), a tiny scalar-valued automatic differentiation engine, with a small multi-layer perceptron implementation on top. It's reimplementation of Andrej Karpathy's micrograd in C. For me, this was a learning project to revisit backpropagation from first principles, with the additional difficulties that come with programming in C.<p>The basic idea is the same as micrograd: each number is a `Value` node in a computation graph, ops connect nodes, and the `backward` function topologically sorts the graph before applying the chain rule in reverse. The C-specific parts are memory management and two simple data structures I needed to implement backprop: sets and vectors.<p>The source code is about 1,350 lines, MIT licensed, and well documented. Dependencies are just the standard library and libm. In addition, the repo contains two examples to showcase how the engine works: a toy regression and an MNIST task.<p>What this is not: a framework to build and train neural networks in production. Being scalar-valued makes it slow, and it wasn't built for numerical robustness or large datasets. There's no commercial aim here; it's a learning project.<p>If you read through it, I'd like to hear thoughts, both on the ML engineering aspect and on anything that reads as un-idiomatic C.</p>
]]></description><pubDate>Wed, 17 Jun 2026 13:35:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=48570370</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48570370</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48570370</guid></item><item><title><![CDATA[Show HN: Microcrad – Micrograd Reimplemented in C]]></title><description><![CDATA[
<p>Article URL: <a href="https://github.com/oraziorillo/microcrad">https://github.com/oraziorillo/microcrad</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=48570364">https://news.ycombinator.com/item?id=48570364</a></p>
<p>Points: 57</p>
<p># Comments: 19</p>
]]></description><pubDate>Wed, 17 Jun 2026 13:34:42 +0000</pubDate><link>https://github.com/oraziorillo/microcrad</link><dc:creator>oraziorillo</dc:creator><comments>https://news.ycombinator.com/item?id=48570364</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48570364</guid></item></channel></rss>