<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: forthy</title><link>https://news.ycombinator.com/user?id=forthy</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 18 Apr 2026 08:57:24 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=forthy" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by forthy in "Ask HN: What's the largest amount of bad code you have ever seen work?"]]></title><description><![CDATA[
<p>I doubt the competition (e.g. IBM or Microsoft) has any better code quality. Even PostgreSQL is 1.3M lines of code, so let's get something deliberately written for simplicity. SQLite is just 130k SLoC, so another order of magnitude simpler.<p>And yet, even SQLite has an awful amount of test cases.<p><a href="https://www.sqlite.org/testing.html" rel="nofollow">https://www.sqlite.org/testing.html</a></p>
]]></description><pubDate>Thu, 15 Nov 2018 10:39:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=18458275</link><dc:creator>forthy</dc:creator><comments>https://news.ycombinator.com/item?id=18458275</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=18458275</guid></item><item><title><![CDATA[New comment by forthy in "What every compiler writer should know about programmers [pdf]"]]></title><description><![CDATA[
<p>Anton is a compiler writer himself (part of the Gforth team, which I lead).  We do submit bug reports.  They get rejected as "invalid", on UB.  It is pretty clear that the way we use GCC to implement Gforth is C* and not "C", we use extensions to GCC as source level optimizations.  Without them, Gforth would be a factor 3-5 slower than it is now.  We experience slowdowns in that order when we have to switch back to "C" instead of finding a workaround for that particular "optimization".<p>So sane behavior of the compiler is absolutely necessary to create fast programs.  The tone reflects more than 10 years of frustration about "C" maintainers, and their inability do deal with the needs of their customers, and our long-term goal is to completely throw out C, writing our own code generator instead.  It's going to give us another factor 2-5 (depending on the problem; some microbenchmarks might gain a factor 10) over the C*-based solution we have now.  And, at the same time, we can forget about releasing a bug workaround patch for Gforth for every new GCC release, as it was the case for GCC 3.x and 4.x (GCC 5.x is better, some of the critics has been heard).  This is feasible, as the number of popular architectures has decreased so far that a small team can support the remaining ones (which is essentially x64, ARM, and ARM64, with some variations within the family).<p>As a GNU project, we understand ourselves as customers of the other, very important GNU project, GCC, of which we, and almost everybody else in the GNU project, depend. If it's broken, it is too bad. And if the bug report process is broken due to the "UB=we can blow up your program" attitude, it's worse.  If the competing comiler maintainers, clang, have the same attitude, we can't even switch.<p>We are also part of a language standard effort (Forth, of course), so we know how such a committee think; this is not different just because the language is different.  What we don't understand is why the C standard has a lot of UB, and only little IB (implementation defined behavior).  For example integer overflow:  This is a very obvious candidate for IB, as the behavior of the underlying hardware defines integer overflow; usually as wrapv in two's complement, sometimes as trapv, but the other options like one's complement and such are non-existent.  The result of such an operation is never "undefined", and as wrapv two's complement is the dominating implementation, it is pretty portable, as well.<p>Or how pointers look like (pointer comparison): You know how your pointers will look like when you implement a C compiler, so you can fully specify the behavior of pointer comparisons.  It's IB, because segmented architectures like 8086 with their overlapping segments simply don't give reliable and fast results.  But if you don't program for MS-DOS, you don't need to care: usually pointers are just register-sized integers pointing to a flat, non-segmented memory, and pointer comparison is just compiled to integer comparison.<p>Bottom line: If you don't understand what your underlying machine does, and how your code generator translates statements to instructions, and therefore you think that x-1>x never can become true, you shouldn't be writing compilers.</p>
]]></description><pubDate>Fri, 04 Mar 2016 19:46:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=11226391</link><dc:creator>forthy</dc:creator><comments>https://news.ycombinator.com/item?id=11226391</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=11226391</guid></item></channel></rss>