<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: amavect</title><link>https://news.ycombinator.com/user?id=amavect</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 26 Apr 2026 08:36:04 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=amavect" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by amavect in "4-bit floating point FP4"]]></title><description><![CDATA[
<p>I'm just having fun. I wrote out the full truth tables and Karnaugh maps on paper, but I trust that you get the idea and can recreate it yourself. (Or, I can write a more detailed blog post, if you'd find that interesting.)<p>If I had to guess, we could use this for a very compact output of the sign function. [-Inf,0) maps to -1.0, 0 maps to 0.0, (0,Inf] maps to +1.0, and NaN maps to NaN. I don't know what application would need the sign function, though. I haven't needed it yet in my programming experience.</p>
]]></description><pubDate>Thu, 23 Apr 2026 04:09:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=47872177</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47872177</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47872177</guid></item><item><title><![CDATA[New comment by amavect in "4-bit floating point FP4"]]></title><description><![CDATA[
<p>I'll use custom notation =? ≤≥? <? ≤? for comparison to distinguish from = < ≤.<p><pre><code>  x =? x = True
  Otherwise, a =? b = False
  
  NaN ≤≥? NaN = False
  Otherwise, a ≤≥? b = a =? b
  
  -1.0 <? 0.0 = True
  -1.0 <? +1.0 = True
  0.0 <? +1.0 = True
  Otherwise, a <? b = False
  
  a >? b = b <? a
  a ≤? b = (a <? b | a ≤≥? b)
  a ≥? b = (a >? b | a ≤≥? b)
</code></pre>
In logic gates: For =?, bitwise equality. For ≤≥?, bitwise equality and a NaN detector. For <?, use:<p><pre><code>  ab <? cd = a&b&~c | ~a&~b&~c&d
</code></pre>
I separate =? from ≤≥?. =? compares value, while ≤≥? compares order. NaN has no ordering, so it compares false. IEEE float only uses ≤≥? and names it ==.</p>
]]></description><pubDate>Wed, 22 Apr 2026 20:41:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=47869030</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47869030</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47869030</guid></item><item><title><![CDATA[New comment by amavect in "Stephen's Sausage Roll remains one of the most influential puzzle games"]]></title><description><![CDATA[
<p>I love pure puzzles and completed SSR. The story consists of sign plaques that narrate the history of the fictional world, and how your player character fulfills their place in the world through the main goal of cooking sausages. A bit unique and interesting, though not particularly complex, and you can guess the twist before it reveals. In other words, a puzzle game with a short story interspersed, perhaps 99% puzzles and 1% reading. The music consists of relaxing algorithmic ambience. The artistic ambition aims for surrealism and minimalism. I like it a lot, but I recommend against it for you.</p>
]]></description><pubDate>Tue, 21 Apr 2026 21:41:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=47854888</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47854888</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47854888</guid></item><item><title><![CDATA[New comment by amavect in "4-bit floating point FP4"]]></title><description><![CDATA[
<p><p><pre><code>  00 ->  0.0
  01 -> +1.0
  10 ->  NaN
  11 -> -1.0
</code></pre>
Arithmetic:<p><pre><code>  0.0 + x = x
  NaN + x = NaN
  +1.0 + -1.0 = 0.0
  +1.0 + +1.0 = NaN
  -1.0 + -1.0 = NaN
  
  -0.0 = 0.0
  -(+1.0) = -1.0
  -(-1.0) = +1.0
  -NaN = NaN
  
  x - y = x + (-y)
  
  NaN * x = NaN
  +1.0 * x = x
  -1.0 * x = -x
  0.0 * 0.0 = 0.0
  
  /0.0 = NaN
  /+1.0 = +1.0
  /-1.0 = -1.0
  /NaN = NaN
  
  x / y = x * (/y)
</code></pre>
More interestingly, how to implement in logic gates. Addition with a 2's complement full adder and NaN detector. Negation with a 2's complement negation circuit. Reciprocal with a 0.0 detector.<p>Multiplication with a unique logic circuit (use a Karnaugh map):<p><pre><code>  (ab * cd) = (a&~b | c&~d | ~a&b&c | a&~c&d)(b & d)</code></pre></p>
]]></description><pubDate>Mon, 20 Apr 2026 17:04:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=47837242</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47837242</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47837242</guid></item><item><title><![CDATA[New comment by amavect in "Iran demands Bitcoin fees for ships passing Hormuz during ceasefire"]]></title><description><![CDATA[
<p>Yet another reminder that we need approval voting, or even STAR voting, for single-winner elections. <a href="https://www.youtube.com/watch?v=yhO6jfHPFQU" rel="nofollow">https://www.youtube.com/watch?v=yhO6jfHPFQU</a> <a href="https://www.equal.vote/approval" rel="nofollow">https://www.equal.vote/approval</a> <a href="https://www.equal.vote/beyond_rcv_zine" rel="nofollow">https://www.equal.vote/beyond_rcv_zine</a></p>
]]></description><pubDate>Wed, 08 Apr 2026 20:29:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=47695847</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47695847</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47695847</guid></item><item><title><![CDATA[New comment by amavect in "Ninja is a small build system with a focus on speed"]]></title><description><![CDATA[
<p>By not tracking file metadata through an index file, mtime-only incremental build systems trade a lot of reliability for only slightly more simplicity. <a href="https://apenwarr.ca/log/20181113" rel="nofollow">https://apenwarr.ca/log/20181113</a></p>
]]></description><pubDate>Mon, 30 Mar 2026 16:55:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=47576771</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47576771</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47576771</guid></item><item><title><![CDATA[New comment by amavect in "90% of crypto's Illinois primary spending failed to achieve its objective"]]></title><description><![CDATA[
<p>I'll also add this argument against RCV. <a href="https://www.youtube.com/watch?v=A1UzTeelguY" rel="nofollow">https://www.youtube.com/watch?v=A1UzTeelguY</a></p>
]]></description><pubDate>Wed, 25 Mar 2026 20:15:16 +0000</pubDate><link>https://news.ycombinator.com/item?id=47522559</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47522559</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47522559</guid></item><item><title><![CDATA[New comment by amavect in "90% of crypto's Illinois primary spending failed to achieve its objective"]]></title><description><![CDATA[
<p>Can you share some actual evidence for your case? I really don't believe it. The anti-RCV story about Alaska 2022 holds that Palin spoiled round 1 of the instant runoff by splitting the vote with Begich, causing Begich to drop out. RCV only beats vote-for-one, unless you can make a convincing case otherwise.<p><a href="https://arxiv.org/abs/2209.04764v3" rel="nofollow">https://arxiv.org/abs/2209.04764v3</a> (Yes, I agree with the conclusion of this paper, but I argue that we can do better with Approval or STAR.)<p>Basic modelling on a 2D political compass gives a Yee diagram, demonstrating RCV's counterintuitive results. Yeah, that's theory, but Alaska 2022 demonstrates a real case of it. And the list of center-squeeze cases on the Wikipedia page, too.<p><a href="http://zesty.ca/voting/sim" rel="nofollow">http://zesty.ca/voting/sim</a><p><a href="https://electowiki.org/wiki/Yee_diagram" rel="nofollow">https://electowiki.org/wiki/Yee_diagram</a><p>> That's a core and long-proven theorem in social choice theory.<p>Do you mean Arrow's theorem? Doesn't apply to STAR or Approval.<p>> The idea that approval voting, STAR voting, or Condorcet voting is superior to RCV for this reason is a misconception based on decades-old research that is no longer current.<p>Share the research, please!<p>Here's some recent research, obviously biased for STAR and against RCV. <a href="https://www.equal.vote/peer_review" rel="nofollow">https://www.equal.vote/peer_review</a></p>
]]></description><pubDate>Tue, 24 Mar 2026 20:11:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=47508430</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47508430</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47508430</guid></item><item><title><![CDATA[New comment by amavect in "Side-Effectful Expressions in C (2023)"]]></title><description><![CDATA[
<p>The author agrees with you. In the final paragraph, the author says that they allow ++ and -- when not using the value, as such use poses no harm.<p>Also, you can use a comma with += and -=,<p><pre><code>  for (int i=0, j=n; i<j; i+=1, j-=1)
</code></pre>
but keep in mind the decrement must usually happen before the loop body (post-increment reverses to pre-decrement).<p><pre><code>  for (int i=0, j=n; i<j; i+=1) { j-=1; ... }
  for (int i=0, j=n; i<j; i++) { j--; ... }</code></pre></p>
]]></description><pubDate>Tue, 24 Mar 2026 16:08:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=47504818</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47504818</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47504818</guid></item><item><title><![CDATA[New comment by amavect in "Side-Effectful Expressions in C (2023)"]]></title><description><![CDATA[
<p>For fun, my attempt to rewrite the functions. Eliminate ++ and pointer arithmetic by introducing a counter. Obviously less terse.<p><pre><code>  void *my_memcpy(void *dst, const void *src, size_t n)
  {
   const uint8_t *s = src;
   uint8_t *d = dst;
   for (size_t i = 0; i < n; i += 1) d[i] = s[i];
   return dst;
  }

  int powi(int x, int y)
  {
   int result = 1;
   for (int i = 0; i < y; i += 1) result *= x;
   return result;
  }
</code></pre>
For itoa, I experiment with the comma operator to show the post-increment on the same line, but visibly after. I also move the negation sign block to the absolute value block.<p><pre><code>  void itoa(int n, char s[])
  {
   int i = 0;
   if (n < 0){
    n = -n;
    s[0] = '-', s += 1; // exclude from reverse
   }
   do{
    s[i] = n % 10 + '0', i += 1;
    n /= 10;
   }while(n > 0);
   s[i] = '\0';
   // reverse
   for(int j = 0, hi = i / 2; j < hi; j += 1) {
    i -= 1;
    char swap = s[j];
    s[j] = s[i];
    s[i] = swap;
   }
  }
</code></pre>
Test code:<p><pre><code>  #include <stdio.h>
  #include <stdint.h>
  // insert functions
  int main(void){
   char src[] = "hello";
   char dst[10];
   my_memcpy(dst, src, sizeof(src));
   printf("%s == hello\n", dst);
   printf("%d == 27\n", powi(3,3));
   itoa(-12345, dst);
   printf("%s == -12345\n", dst);
   itoa(0, dst);
   printf("%s == 0\n", dst);
  }</code></pre></p>
]]></description><pubDate>Mon, 23 Mar 2026 21:48:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=47495575</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47495575</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47495575</guid></item><item><title><![CDATA[New comment by amavect in "90% of crypto's Illinois primary spending failed to achieve its objective"]]></title><description><![CDATA[
<p>Academic research concludes that ranked-choice and vote-for-one both result in a center-squeeze spoiler effect.<p><a href="https://en.wikipedia.org/wiki/Center_squeeze" rel="nofollow">https://en.wikipedia.org/wiki/Center_squeeze</a></p>
]]></description><pubDate>Mon, 23 Mar 2026 21:21:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=47495280</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47495280</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47495280</guid></item><item><title><![CDATA[New comment by amavect in "90% of crypto's Illinois primary spending failed to achieve its objective"]]></title><description><![CDATA[
<p>I think the threat of unapproved candidates winning would lower a voter's approval threshold to include other candidates. Increasing the approval threshold happens when the voter likes all of the candidates, in which case there isn't too much of a problem.<p>I really want to believe that ordinary people can handle STAR voting. Not too far from product reviews: most will initially vote 5, 4, or 0. As long as the system encourages more honest voting (instead of lesser-evil voting), it can help fix our corrupt political system.<p>Full agreement with multi district/proportional, but I don't know how to sell it to normal people (they want THEIR representative).</p>
]]></description><pubDate>Fri, 20 Mar 2026 22:30:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=47461592</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47461592</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47461592</guid></item><item><title><![CDATA[New comment by amavect in "90% of crypto's Illinois primary spending failed to achieve its objective"]]></title><description><![CDATA[
<p>>imo proof that ranked choice is absolutely needed<p>Ranked choice still succumbs to a spoiler effect. <a href="https://realrcv.equal.vote/alaska22" rel="nofollow">https://realrcv.equal.vote/alaska22</a> <a href="https://www.youtube.com/watch?v=yhO6jfHPFQU" rel="nofollow">https://www.youtube.com/watch?v=yhO6jfHPFQU</a><p>Approval voting works better and simpler, and STAR voting works even better though with more complexity. <a href="https://www.equal.vote/beyond_rcv_zine" rel="nofollow">https://www.equal.vote/beyond_rcv_zine</a></p>
]]></description><pubDate>Fri, 20 Mar 2026 20:25:00 +0000</pubDate><link>https://news.ycombinator.com/item?id=47460148</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47460148</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47460148</guid></item><item><title><![CDATA[New comment by amavect in "Czech Man's Stone in Barn's Foundations Is Rare Bronze Age Spearhead Mold"]]></title><description><![CDATA[
<p>I feel the pain of old geezers. I grew up figuring out which pixels actually do something, like an adversarial game where UI un-designers make the useful buttons look less like buttons.<p>uBlock Origin is the best ad blocker. The full uBlock Origin works on Firefox, but not on Google Chrome. The cut-down uBlock Origin Lite works on Google Chrome. uBlock Origin Lite still blocks many ads. Don't fall into all-or-nothing thinking. Imagine if you could block just half of the ads on cable television :) an improvement, though not perfect.<p>If you use Firefox, follow this link. On the right hand side, click the blue button with the label "Add to Firefox". A confirmation dialog box will pop up. Read it. Click the blue button with the text "Continue to Installation". That should install it.<p><a href="https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/" rel="nofollow">https://addons.mozilla.org/en-US/firefox/addon/ublock-origin...</a><p>If you use Google Chrome, follow this link. On the right hand side, click the blue button with the label "Add to Chrome". A confirmation dialog box will pop up. Read it. Click the button with the text "Add extension". That should install it.<p><a href="https://chromewebstore.google.com/detail/ublock-origin-lite/ddkjiahejlhfcafbddmgiahcphecmpfh?hl=en" rel="nofollow">https://chromewebstore.google.com/detail/ublock-origin-lite/...</a></p>
]]></description><pubDate>Fri, 20 Mar 2026 20:04:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=47459892</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=47459892</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47459892</guid></item><item><title><![CDATA[New comment by amavect in "European Commission issues call for evidence on open source"]]></title><description><![CDATA[
<p>Newcomers keep tripping on Free Software vs Freeware, therefore "Free Software" doesn't describe well. We could call it Freedom Software. (There now exist 15 competing jargon files.)</p>
]]></description><pubDate>Fri, 09 Jan 2026 18:02:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=46556839</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46556839</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46556839</guid></item><item><title><![CDATA[New comment by amavect in "European Commission issues call for evidence on open source"]]></title><description><![CDATA[
<p>Free Software should rename to Liberty Software. Instead, advocates loaned Spanish "libre" in the ugly FLOSS acronym (Free/Libre Open Source Software). If only we used "liberty" then we could stop quibbling over the multiple meanings of "free" and just talk about software liberty.<p>"Free as in bonus" vs "free as in liberty".</p>
]]></description><pubDate>Fri, 09 Jan 2026 16:58:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=46555942</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46555942</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46555942</guid></item><item><title><![CDATA[New comment by amavect in "“Captain Gains” on Capitol Hill"]]></title><description><![CDATA[
<p>You're welcome. Here's also a video on simulating plurality, RCV, and approval voting. <a href="https://www.youtube.com/watch?v=yhO6jfHPFQU" rel="nofollow">https://www.youtube.com/watch?v=yhO6jfHPFQU</a></p>
]]></description><pubDate>Wed, 03 Dec 2025 19:06:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=46138550</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46138550</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46138550</guid></item><item><title><![CDATA[New comment by amavect in "“Captain Gains” on Capitol Hill"]]></title><description><![CDATA[
<p>>In my failing democracy<p>Which nation, may I ask?</p>
]]></description><pubDate>Wed, 03 Dec 2025 18:33:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=46138135</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46138135</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46138135</guid></item><item><title><![CDATA[New comment by amavect in "“Captain Gains” on Capitol Hill"]]></title><description><![CDATA[
<p>Lee Drutman advocates for ranked choice voting, but implementations in the USA still degenerated to 2 parties. RCV still has a spoiler effect. <a href="https://realrcv.equal.vote/alaska22" rel="nofollow">https://realrcv.equal.vote/alaska22</a> <a href="https://www.youtube.com/watch?v=yhO6jfHPFQU" rel="nofollow">https://www.youtube.com/watch?v=yhO6jfHPFQU</a><p>Instead, we need approval voting, or even STAR voting. <a href="https://www.equal.vote/" rel="nofollow">https://www.equal.vote/</a><p>(Drutman appears to have somewhat changed his views on RCV, but I don't think his "fusion voting" idea will catch on until we have multiple parties in the first place. <a href="https://www.newamerica.org/political-reform/blog/how-i-updated-my-views-on-ranked-choice-voting/" rel="nofollow">https://www.newamerica.org/political-reform/blog/how-i-updat...</a> )</p>
]]></description><pubDate>Wed, 03 Dec 2025 18:11:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=46137871</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46137871</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46137871</guid></item><item><title><![CDATA[New comment by amavect in "“Captain Gains” on Capitol Hill"]]></title><description><![CDATA[
<p>We need to change the voting system in order to dissolve the two party system, per Duverger's law. Ranked choice voting will not work. Approval voting or STAR voting would work.<p><a href="https://www.equal.vote/" rel="nofollow">https://www.equal.vote/</a></p>
]]></description><pubDate>Wed, 03 Dec 2025 16:55:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=46136830</link><dc:creator>amavect</dc:creator><comments>https://news.ycombinator.com/item?id=46136830</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46136830</guid></item></channel></rss>