Hacker Newsnew | past | comments | ask | show | jobs | submit | zahlman's commentslogin

This, too, is covered in TFA.

This is covered in TFA.

> A meta question is why this persists. It has the right qualities for a "party trick"

This is discussed in a section near the end. But I feel like the discussion of why people care about using XOR to swap two values is missing an underlying discussion of why people would care about swapping values. As shown earlier in the division example, at the point where you would do the swap, typically you can just write the rest of the code with the roles of the values swapped.


> typically you can just write the rest of the code with the roles of the values swapped

Today, yes; most modern instruction sets are pretty orthogonal, and you can use a value in any register symmetrically -- although even today, division instructions (if they exist!) are among the most likely to violate that expectation, along with instructions that work with the stack pointer. But in the XOR heyday, this was less true -- instruction sets were less orthogonal, and registers were more scarced. It's not unreasonable for an OS scheduler tick to do some work to figure out the newly-scheduled task's stack pointer in one register, and need to swap it into an SPR or similar so that the return from interrupt returns to the new location, for example; and this is the exact type of place where the XOR trick occasionally has value.


Usually it's used like:

   if max < min:
       min, max = max, min

   [... algorithm that requires min < max]
So your suggestion would be to have two versions of the algorithm in the two branches of the 'if'. This is significantly more complicated and may even be slower depending on lots of factors.

> Hackers are very good programmers

This does not match my experience.


The missing part of their intended meaning is "skilled hackers". Unskilled hackers are everywhere, and they're bad at programming, but so are unskilled programmers.

> Speaking as a Canadian, I wonder if at least part of it is the attitude that investments in these areas are "welfare" and not simply a part of the portfolio of essential services that are delivered by the state to citizens?

Also speaking as a Canadian, I don't understand the distinction you're drawing.


The distinction is in whether there's a value judgment. Is healthcare and welfare something we assume is part of the package living in a developed nation, or is it an indulgent extra, subject to suspicion and scrutiny above and beyond what essentials like military spending get?

I would say that the mainstream Canadian view is the opposite of this. We expect healthcare funding and many are supportive of the strikes when it gets cut, but we are much more likely to treat military budget as the purchase of a lot of unnecessary toys.


> It is not realistic to believe that we can become a nice wholesome European country if we just raise taxes a bit. The extra money will just be squandered and stolen.

Why, in your view, doesn't the same thing happen to them?


Simply put the people in those countries who spend the money care about the people who gave them the money.

They view themselves as stewards of these resources and genuinely want to spend them optimally to ensure the best return for everyone in society including future generations.

That isn't the case in America and will never be the case.

America is a failed state.


I would not put this on America being a failed state. Rather the more 'successful' European countries are far more homogenous in demographics than America ever will be. In Denmark, nearly everyone has the same cultural background and similar values, and are striving for a relatively unified vision/goal for the country. In America, there is such an overwhelming diversity in values and cultures, and added animosity between different groups of people that there is more infighting over government&private resources and less efficient use of them.

> Rather the more 'successful' European countries are far more homogenous in demographics than America ever will be. In Denmark, nearly everyone has the same cultural background and similar values, and are striving for a relatively unified vision/goal for the country.

Can you explain this reasoning without implying American political leaders (or perhaps broader society) are racist?

As a counterpoint France, Germany, Canada and Australia are far from homogeneous, but offer far stronger social safety nets than the US. IIRC, 1 in 4 Australians were born elsewhere.


> Can you explain this reasoning without implying American political leaders (or perhaps broader society) are racist?

Why would we need to do that?


Is it really on just the political leaders and not the society at large that supports them?

One need not go that far back in history to learn that codified in the legal system was the concept of separate but equal, red lining,, etc. Lynchings were often ignored and thus a public spectacle.

Today you still see the public discourse about women’s rights (e.g potentially jail for abortion in certain states…regardless of the reason), debates on mass migrations/immigration (e.g. little sympathy for legal citizens being deported or killed by ICE, etc).

Public agreement on these issues is a prerequisite to social safety nets.

American history is plagued with examples such as these that have contributed to the culture of rugged individualism.

Perhaps the closest period where some semblance of social safety net wins were achieved were in the FDR years (eg social security), and that was mainly through labor unions / working class pressure.

Do those counterpoint countries have similar histories? and were their social safety nets not from the side of labor vs capital?


Downvote all you want, but y'all still haven't explicitly named the linkage between demographic diversity and American tax policy vis-a-vis threadbare social safety. Instead of asking the reader to fill in the gaps, I challenge anyone who believes it to explain the mechanism linking the diversity prior/stimulus to the tax policy result, and why it only happens in America.

America is broadly racist, that's exactly my point!

So the root problem isn't the amount of "diversity", but racism.

In a place as diverse as America, democracy starts to resemble a racial headcount. Elections start to hinge on explicit appeals to particular ethnicities or sub groups. Political parties are very loud about this and they don’t try to hide it at all. I thought it was clear why this only happens in America (the aforementioned diversity).

what does this have to do with tax policy?

If some groups are disproportionately benefited by certain social spending while a different group is disproportionately impacted by the associated taxes to fund said spending, you get a divergence in the ability to burden share across groups (this is the case in the United States). As a result of this, spending is funded by debt.

You think that Europe is more homogeneous than the USA? First time I my life I hear that argument.

Individual European nations are, not Europe as a whole entity.

Yes, in order to have successful fiscal policies you need to be an ethnostate. Excuse me while I roll my eyes straight out the back of my head!

That's not the only way at all; all I'm saying is it becomes harder to convince the whole of society to adopt social safety nets if they positively affect people that look/act different from someone. I'm just trying to be honest that many many many Americans are racists.

I understand, that's a much more reasonable take than I implied, mea culpa!

> The best source for breaking this myth is Jack Crenshaw's series, Let's Build a Compiler!

Right, I've heard of that...

> , which started in 1988.

... Oh. Huh.

(Staring at the red dragon book on my bookshelf, which was my course textbook in the early 00s.)


> The National Taxpayers Union Foundation released a report with estimates on how much time and money Americans are expected to spend.

They have their own website (https://www.ntu.org/foundation/), so why not cite it directly?

> The report estimated the average American will spend 12 hours and $290 to complete their tax return.

> The report estimates that tax compliance costs include $319.7 billion in lost time and at least $157.1 billion in out-of-pocket expenses, including tax software and professional services.

Even taking the claims for granted (that seems like an awful lot to spend on tax software, and if you're hiring a professional then there shouldn't be a huge burden on your time), that works out to 541.7 million Americans whose time is valued at an average of $49.18 an hour.

I... don't think these are reliable numbers.


That seems to me like a somewhat odd way to put it. From where I stand, the large majority of objection to "state monopoly on violence" comes from those who otherwise express a strongly collectivist worldview.

Like I said, very confused.

> I just don't understand why we have all these adages to convince people that "violence is always wrong", while I'm sure some at least some of the people who say that are actively engaged in building machines designed to kill people.

First: because trusted people having such weaponry is, in expected value, believed to lead to less total violence. Second: because not all such violence is part of what you presumably have in mind when you speak of "ongoing conflict". (Of which there are many; when you speak of "an ongoing conflict" you come across as having a particular agenda, although of course I don't know which.)

> But our country (and a lot of them) were literally founded on political violence. How do people square those 2 ideas?

There is no contradiction and thus nothing to square. People are not responsible for the actions of their ancestors, nor of members of their identity groups, and especially not of the ancestors of members of their identity groups. And there is no contradiction between "the ends don't justify the means" and the ends being just.


> First: because trusted people having such weaponry is, in expected value, believed to lead to less total violence.

Unfortunately "trusted people" don't grow on trees... but those who do grow to the highest positions of power, with the most destructive weaponry under their control, ask for trust with stuff like: "No foreign wars", "I'll end that conflict on day one"... "after bringing prices back down".

With that said, changing the conversation from violence to trust in the ideas and people who control it, is a worthwhile endeavor.

>> The rational conclusion of doomerism is violence

That's quite backwards, violence is an irrational response to today's problems. Demonizing the discussion of those problems as "violence" can't be trusted - if the discussion stops, a rational solution will never be found.


>> trust in the ideas and people who control it,

This right here is the crux of the issue. I don't even trust my own computer without fairly deep introspective tools, and what we're given for 'leadership' is 'this totally outdated and opaque system of voting for corporate shill A or corporate shill B is totally trustworthy! You obviously cannot think that you could get by without some asshat running your whole society so be thankful'.

Direct democracy, liquid democracy - whatever you pick that removes the middle man will be a marked improvement from day 1. We do not need these people deciding what's best for us. I'm not sure we ever did.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: