<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: DanielCristofan</title><link>https://news.ycombinator.com/user?id=DanielCristofan</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 27 Sep 2026 02:54:32 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=DanielCristofan" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by DanielCristofan in "I wrote a ray tracer in Brainfuck"]]></title><description><![CDATA[
<p>This is interesting. But the generated code has some weaknesses typical of projects that generate brainfuck algorithmically (whether done by humans or LLM agents).<p>-You're generating brainfuck through layers of abstractions. This doesn't work well, or at least nobody has done it well yet to my knowledge.<p>-You're also trying to define most of these abstractions in a position-agnostic way. To that end you maintain a relation where no command in your program is executed at more than one data pointer location.<p>-(You mention Turing-completeness, but this restriction reduces brainfuck to the power of a finite automaton)<p>-(It also makes massive code duplication at the brainfuck level almost inevitable)<p>-One consequence is that you need to move or copy values whenever you use them for anything. You've also gone a step further (also typical of these projects), and tend to give values a primary location, so they end up where they started after each operation, which means when you want to use values you're mostly making a copy, restoring the original, then using the copy and discarding it during or after. So the program spends most of its time and code moving values, copying values, zeroing copies, zeroing zeroes...<p>-(The pattern of zeroing cells before use is also a red flag. What was in that space before? Presumably nothing valuable, since you're comfortable zeroing it; then was it junk data left from some earlier calculation? That implies your compiler is leaving junk data scattered through the array in its wake, and doesn't remember what it left where? A bad sign. The efficient thing to do is usually, when you're using a value, save a copy if you're going to need that value again, or let it get wiped naturally during use the last time it's needed. Zero-after-use means much less explicit zeroing needed.)<p>I should acknowledge that many of your details look well conceived; it's just that the whole approach is (as far as I can tell) not capable of producing concise or efficient brainfuck code.<p>Good luck;
-Daniel Cristofani</p>
]]></description><pubDate>Sat, 26 Sep 2026 10:24:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=49855114</link><dc:creator>DanielCristofan</dc:creator><comments>https://news.ycombinator.com/item?id=49855114</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49855114</guid></item></channel></rss>