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

> Swift takes Rust’s ideas and hides them in C-like syntax.

This example doesn't show me any meaningful difference, and Rust also let's you attach functionality to enums.


Swift tends to overuse enums, for example people would use them instead of namespaces or when they want a function but don’t want to create a class or a struct which in my opinion has always felt like a work-around for language deficiencies.

It also assumes that "C-like syntax" is a desirable thing. Many of the worst parts of Rust syntax (and Swift syntax, and Java syntax, and Javascript syntax, and...) are things it took from C.

Knowledge that the ACA is Obamacare is my litmus test for basic healthy civic engagement.

Just as America would like to reduce its dependence on external production, so to do other countries want to reduce their own. We used to live in a world converging toward maximal international trade, when in fact it was exploiting underdeveloped nations. As we progress globally, and as the development gap shrinks, we have noticed power dynamics which weren't well guarded against in the old way.

So now what? How do we preserve a lot of the efficiencies of the past, while strengthening the resilience and redundancy. How can multiple nations create policy which drives business on partially compatible protocols?

If I allow myself to be optimistic, I'd be hoping for more international lawyers and trade agreements. Protectionism is natural, but taken too far, isolationism is a death sentence.


> we have noticed power dynamics which weren't well guarded against in the old way

The clearest example is a dependency on a single wealthy nation for military and world policing. It's a good thing for individual countries to be able to project their own foreign policy goals like containing Russia without having to rely on the whims of another country's politics. Even here in Canada we should be able to defend their own arctic border reliably and be able to project power to China/India beyond strongly worded letters.

> I'd be hoping for more international lawyers and trade agreements.

Ignoring the US's recent moves there does seem to be more trade deals than ever between 'middle powers'.

> isolationism is a death sentence

The best way to maintain global relationships is to offer tons of value. Similar to how China can get good trade deals and influence simply because they have so much to offer economically. This isn't just issues of diplomacy.


Well said.

One of the USA's greatest exports is intelligence and higher education, and what has been happening with that and the general anti-intellectual atmosphere is to me the most concerning as an american. Ironically, public education in america has been pretty bad for a while. But I'm going to start rambling here... way too many problems, and no damn leadership.


[flagged]


A country were a lot of its citizens don't have access to basic human or social needs, and equate a demand for that, already available in the rest of developed world, to "far left political activism" - that is really ironic. There is nothing left on the left (pun intended) in today's America.

What is the American spirit to you? It seems to not include political activism. Or at the very least political activism you disagree with.

Could you elaborate on what constitutes far-left political activism?

I don’t know if this counts as activism, but I was at my university’s Faculty Club and a faculty member walked over and immediately started bitching about Donald Trump without introducing themselves. Like, you’re supposed to be in the business of developing people. What a gigantic waste of time and money.

This just sounds like basic social bonding for red blooded Americans these days. Would you have condemned them for similar commiserating in the aftermath of September 11 or Oklahoma City?

> I don’t know if this counts as activism,

I do. It doesn't.


> I don’t know if this counts as activism …

then you proceed to describe something that in no world would be considered activism.


What about that counts as far left activism?

Nearly every Republican who was in Congress in 2014 would have described at least 3/4 of what Trump has done this term as illegal and totally unacceptable, and would have described at least half of the rest as incompetent.

Unless you can make a case that since 2014 the country has moved so far to the right that even 2014 Republicans are now "far left", about the only thing you can infer from someone bitching about Trump is that they are probably not far right. (Even that one is pretty iffy because he's pissed off a lot of the far right now too).


If they were instead lauding Trump would you also see that as a waste of time and money? If they aren’t doing this in the classroom I don’t see the issue.

Sports teams and "after school activitie" are a much much higher priority than teaching. It isn't even close. It seems the only thing we prioritize in education is... entertainment? I'm sure that will be GREAT in a few generations?

Couching nonsense in faux-politeness just makes you look even more googly-eyed.

>"like containing Russia"

I think at the moment Canada faces way bigger problems from the south.


> I think at the moment Canada faces way bigger problems from the south.

Exactly. Not only there's the absurd campaign from the Trump administration on how Canada should be a state but there are also the recent treasonous talks between representatives from the Trump administration and the Alberta separatists.

https://www.cbc.ca/news/politics/eby-alberta-separatism-9.70...

Putin's regime might be a cancer of humanity, but Canadians have far more reasons to feel threatened by the Trump admin than from Putin, even if Trump is a proxy for Putin.


>"Putin's regime might be a cancer of humanity"

It will go away at some point unless global west will start behaving in the same manner.


> like containing Russia without having to rely on the whims of another country's politics

That's true, but at the same time it was probably already the case before invasion of Ukraine, and it is definitely the case now.

The main issue is political fragmentation: would Paris and Berlin risk lives of French and German people (soldiers and civilians due to retaliation) to save Vilnius?

But if the answer is true (as obligated by the Treaty of Maastricht, independently of NATO) then Russia stands no chance with conventional weapons against the whole Western Europe, the balance of military, demographic and industrial power is ridiculously lopsided (involving nuclear weapons would also raise the same political question about the French willingness to nuke Russia in retaliation to Russia nuking Poland but if the answer is yes, Russia cannot win a nuclear war either (which everyone would lose)).


> The main issue is political fragmentation: would Paris and Berlin risk lives of French and German people (soldiers and civilians due to retaliation) to save Vilnius?

This is a wrong question. If one day Russia feels brave enough to attack any NATO country, the right question to ask is, "Do we want to fight this war on someone else's soil or on ours?". This is the reason why Europe is so focused on helping Ukraine BTW.


> Do we want to fight this war on someone else's soil or on ours?

Russia thought so too.


What do you mean? There was never any question of attacking Russia and fighting any war on their soil. Nobody in their right mind would attack a country with the 2nd largest army and nuclear weapons. The war in Ukraine definitely made this army still very weak, but, except Ukraine defending itself, I don't see anyone rushing to attack Russia anytime soon. It makes no sense now and made no sense before they invaded Ukraine. There is nothing to win by attacking Russia and a lot to lose.

The best way to 'attack' Russia is to undermine its economic and political systems then let unrest amongst its citizenry do the dirty work. 1917 showed Russia's proletariat was very effective at achieving regime change.

How do you undermine the economic and political system of a country? The economic one can be undermined by sanctions, and they happened only because the war - before that the West was happy to send billions to Russia. The political one seems quite stable, Putin had a few decades to cement it and make sure nobody takes it to the streets, and if someone is brave enough to do it, they will be quickly pacified. He is switching the internet on and off and there is no sign of Russians reacting like Iranians.

I thought Iran situation is more about sharia than youtube cat videos.

It's not, the current protests are mainly about economic harshness.

> with the 2nd largest army

By what metric?


Global Firepower maintains a database and is a popular reference: https://www.globalfirepower.com/country-military-strength-de...

But I saw several people criticizing their relatively high position on this chart given high incompetence and losses.

EDIT: Apparently this website doesn't follow any rigorous methodology. So basically the only thing their army is 2nd in the world is the nominal number of nukes (hopefully most of them don't work).


> This is the reason why Europe is so focused on helping Ukraine BTW.

We aren't that focused actually. France produced close to zero 155mm shells in 2023 because the producer (les forges de Tarbes) couldn't pay its suppliers due to liquidity issues. That could have been solved by a phone call to the national investment bank (BPI) but lasted 9 months because we don't take things too seriously.

Another example is how negligible was the war in Ukraine in the debate about the government budget for the past two years. If we were serious about helping Ukraine we should be spending so much money it would become a priority topic in budget debates, but it's not the case at all.

I'm deeply disappointed about how complacent we have been for the past 4 years.


The answer is always going to be "maybe", but hopefully enough of a maybe to deter hostile actions. That puts everything in an uncomfortable state of uncertainty.

Better uncomfortable state of uncertainty than comfortable state of war. Nuclear or conventional.

"…comfortable state of war."

No war is "comfortable", it's a distaster for all involved participants—even the victors.


>would Paris and Berlin risk lives of French and German people (soldiers and civilians due to retaliation) to save Vilnius?

Yes very much.



I wouldn't be so categorical about France. Pro-russian/ “anti-war” political parties earned the majority of votes (but not seats) in the last elections, and the personality of Macron is so divisive (he has had record low approval for most of his tenure) it really impairs support for war.

Right. Aggression can only be tolerated up to a point before it triggers a response. Remember, on 1 September 1939 the Nazis invaded Poland and two days later both the UK and France declared war on Germany.

“and two days later both the UK and France decided not to intervene and just set up defensive position in Belgium and eastern France” is what actually happened. With the terrible results we known for France (the defensive position being hammered on its weakest point, leading to the complete collapse of the French army in less than a month.

> Just as America would like to reduce its dependence on external production, so to do other countries want to reduce their own.

If anything, I'd say for other countries it's more urgent.

If China embargoes deliveries of light bulbs to Europe, all the light bulbs already in place keep working. The pain would grow over time - giving a grace period, to ramp up local production.

If America embargoes AWS, Google, Apple and Microsoft? The pain would be instant and severe.


That would be as close to a declaration of war as you can get without firing a bullet.

The immediate and obvious response would be for the foreign branches of those companies to be declared "of national interest", nationalized and forced to keep operating.


>"nationalized and forced to keep operating."

Assuming there is no some kill switch which would render a whole infra including hardware inoperable.


I'd imagine the government would be in talks with the highest ranking local Amazon employees long before, but I can't imagine a country trusting the hardware or wanting to manage the jank.

It's called us-east-1?

AWS China is a completely separate partition under separate Chinese management, with no dependencies on us-east-1. It also greatly lags in feature deployments as a result.

We saw the damage crowdstrike caused in a few hours

In case of war AWS, Google, Apple and Microsoft and others would be immediately directed by government to adopt its war strategy—like it or not—just as US manufacturing was forced to retool for war production during WWII.

I'm absolutely not an expert, but critical things for power and food production not to mention medical supplies and emergency equipment are also tied up pretty deeply in international trade.

The world would break pretty quickly if we all just stopped trading with each other.


Sure, but many products can be sourced from a load of countries.

If you can't get natural gas from Russia you can get it shipped from America or Australia or Qatar - it's expensive as hell, and you might need to quickly build new regasification plants, but your economy keeps running. And there's no remote kill switch that disables the gas you already have in-country.

That's not the case for the services provided by AWS, Google, Apple and Microsoft though - the 'competition' is one US provider vs another.


Self hosted ms installations have no instant kill switch, only a slow one.

It is risky to believe that the development gap alone makes for higher economic efficiency when manufacturing things in China. There are very real structural differences in how various industries are organized. Not least in terms of geography.

This is an aspect the west seems to have missed entirely as there are no attempts to learn from it or emulate it.

Everyone knows about Shenzhen. Not everyone knows that this is how every major manufacturing industry is clustered in China in various cities and regions.


The US did this with automobile and steel industries concentrated around the Great Lakes. It's not some kind of profound insight on the part of the Chinese.

The downside is that it decimates entire regions if/when the demand for what they produce drops.


Yes, it has its risk, but that isn’t why the US or Europe don’t cluster industry to create higher efficiency. The risk can be mitigated. The political willingness and ability to do it deliberately just isn’t there.

My point was that the development gap is what lead to the current situation, not that it's just cheap labor that makes Chinese stuff cheap.

My point about maintaining higher economic efficiency is actually the same point you're making. How can the globe (not just the west vs the east) learn from the past and build for the future. We live in a magical world with translation services available to billions of people, how can we empower them to organize around the right ideas. How can we preserve culture and art while flooding ourselves with technologies developed globally? Who pays for security and research? Intellectual property law in general?

So many big issues and questions still need a lot of work.


I think Congress is actually the biggest obstacle to efficient manufacturing in the US. It is a body where the primary motivation of representatives centers around what they can get for their constituents, not what makes sense nationally. So any government spending (eg procurement) will actually tend to drive fragmentation as representatives fight for their states.

Take for instance the space sector. It is fragmented by design. By Congress. Not only is it spread all over the country, making collaboration expensive, time-consuming and clumsy: there are essentially six different federal space agencies of which NASA is just one. This is terribly inefficient.

I remember when reading about the Apollo missions it was astonishing just how much time they lost by different parts being built all over the US and then shipped across the country to be integrated. Utter engineering madness that was only made to work because one could pour immense amount of cash on it.

This is why companies like SpaceX was able to run more efficiently: they do a lot more in vastly fewer locations. Ditto for Lockheed during their golden years: Skunk Works was famous for having "everyone under one roof and within walking distance of each other". (That Skunk Works neither exists anymore, nor can it exist, but that's a longer story which is also about extreme inefficiency).

It is reasonable to assume that Europe wouldn't do any better. Or any setup where politicians are inclined to optimize for regional gain. You'd probably end up with the same political fights over who gets what if the EU were to push towards more of the kinds of manufacturing that you find in China.

We know we're inefficient and we have some idea of why. We like to blame factors that are easy to politicise or evoke emotion (environment, exploitation of the poor etc), but I don't think they are as important as people tend to think.

We just don't want to change. And there are legitimate reasons for that. Chief among them that we're uncomfortable with strong central control. (Well, we used to be. It only took a majority of republicans about a decade to turn 180 degrees on that question and prefer an all-controlling federal government dominated by the executive branch)


I think Susan Collins is a great example of this. Her support of Kristi Noem is based on deals she finds acceptable for Maine residents. The fact that other states suffer at the hands of ICE doesn't effect her decision's. Collins feels she only is responsible for Maine and not humans that live outside of Maine.

I find this sort of compartmentalization offensive to the common good.


That's representative democracy for you. Heck, even China faces the same issue, but they get to make it a competition between provinces, on who can win the favor of the emperor. Helps for them that the emperor has supreme authority though.

No, that's the incentive this specific system creates. There are democratic systems which do not suffer from such hyper localism. Such as the German mixed member proportional system.

Can you describe how the German system works around this issue?

Sounds like a narrow interpretation for representative democracy:) Maybe I'm stretching/mangling the golden rule but "do unto others as one would like others to do onto Mainers."

"It is fragmented by design. By Congress.…"

That's only in peacetime. During WWII the Government directed US industry to gear up for war production and the transformation was not only remarkably swift but also the largest retooling effort in history.

In these fraught times it's worth revisiting that history to remind ourselves of what's actually possible. By today's standards, the US's industrial response to war was truly remarkable.


> How do we preserve a lot of the efficiencies of the past, while strengthening the resilience and redundancy.

Open source with clear international governance and maintainer/contributor base, in such a way that a geopolitical rift leaves both sides with working software.

That works for tech and the infrastructure, of course, but not for the corporations built upon them.

> more international lawyers

I don't see that as a significant source of safety in our current world.

> isolationism is a death sentence.

The current US admin isn't isolationist, it's merely reverting back to 19th century imperialism.


> If I allow myself to be optimistic, I'd be hoping for more international lawyers and trade agreements.

One of the issues with the current system is that the WTO appellate body, which is effectively the court of world trade, requires USA approval for any appointments, which both Trump and Biden have refused to give. This effectively makes the WTO completely impotent.

https://en.wikipedia.org/wiki/Appellate_Body


Didn't the rest of the world form their own WTO without the USA in it?

Which seems completely pointless if they don't also revoke the USA's "Most favoured nation" status.

Trade agreements, the WTO, its rules and appellant system, only work if nations are at peace and that peace is sustainable. We've just lived through a remarkably stable period of 80 years (since WWII) without which WHO, free trade and trade agreements could not have existed as we've known them. That era is seemingly now over, and the WTO is falling into irrelevancy.

Unfortunately, in the decades since the 1970s laissez faire economics/capitalism with its immediate need for quick profits, short-termism, a penchant for deregulation and ignoring traditional business ethics has meant that governments have ignored their long-term strategic interests. Despite the dangers of these policies being blatantly obvious dangers from the outset many Western governments encouraged such practices. Now it's payback time, and it'll be expensive—likely more than if the old order had been retained.

Anyone with a sense of history could see the headlong rush to deregulatate markets, indiscriminate reductions in tariffs and free (and indiscriminate) trade, would ultimately result in leaving many countries strategically vulnerable and open to exploitation by others.

We're now witnessing the true cost of these policies and what it means to have lost critical industrial infrastructure, loss of production know-how along with the loss of skilled workers, and an ongoing deskilling of the workforce all of which took decades if not centuries to build up.

With more nuanced policies much of the pain could have been avoided.

Rebuilding a strategic manufacturing infrastructure to insure resilience and independence in an increasingly uncertain and divided world will be costly and difficult.


Even without national protectionism we are still experiencing isolationism, expect instead of it being done by nations in the interest of their citizens it is being done by corporations in the interest of their shareholders and it's leading to a dangerous amount of centralization as well.

Compatibility protocols are probably the best answer, allow individual countries to develop software they trust to interact with internationally accepted protocols and formats. As you said, good luck getting anyone to agree to anything. If email didn't already exist I don't think it would even be possible to implement today.


>"but taken too far, isolationism is a death sentence"

I would argue that few large countries have everything to be self sufficient. For the rest - they would have to band together to avoid being at the mercy of their bigger overlords.

As for efficiencies of the past: I think they lead to a complete monopoly / near monopoly in few critical areas. The result - the monopoly power becoming a political weapon and or critical vulnerability.


First of all I just want to say, I completely agree with the main point of this post, and argue for more full-lifecycle discussions on a regular basis at every job I've had.

With that said, I partially disagree this block:

> When I’m heads-down-coding, I’m not seeing, I’m not asking, and I’m not learning about the problem. To do that, I have to get up from my desk, go to where the problem is and/or the people I need to ask are, and have a conversation.

There are two types of problems when developing software. The problem of figuring out what you want to do, and the problem of figuring out how to do it.

These often impact each other, either because a limitation on what you can do changes what you end up trying to do, or because you learn something new about the use case, like this post describes. But keeping these two problems separated in your mind, at least for a time, is what lets us focus and find solutions.


I just want to say, I always really appreciate your writing.


Thank you! I’m gonna end up doing a lot more of it in 2026 than I did in 2025… stay tuned!


I looked into this a bit for a rust project I'm working on, it's slightly difficult to be confident, when you get all the way down to the CPU.

https://github.com/rust-lang/rust/issues/17046

https://github.com/conradkleinespel/rpassword/issues/100#iss...


Author tries to avoid a database for storing tokens while the client is disconnected and ends up storing them in a pub/sub provider.

There's no solution other than to store the tokens somewhere, or drop them. You have to make a choice how long you want to allow reconnects for. And this is all pretty independent of the transport layer, as the author even mentioned themselves, you can resume even a new session as long as you have a prompt ID or something to tie it back to the original request.

I don't know enough about how the LLM providers stream results, but the original claim that inference is more expensive than transport is a good point, and caching tokens seems like a smart move. Unfortunately, we pay by the token, so I don't see the incentive for providers to spend time and money doing this for us.


> Unfortunately, we pay by the token, so I don't see the incentive for providers to spend time and money doing this for us.

Providing a better service, for one. Plenty of providers do offer caching, both input and output tokens, and usually give you a cheaper price for it too. Example from two of them: https://platform.claude.com/docs/en/build-with-claude/prompt... & https://api-docs.deepseek.com/guides/kv_cache


I feel like it's slightly different to cache duplicate parts of the input, vs storing outputs when a connection drops.


It seems like a good use case for a caching layer. It seems like you would probably be able to make a set up for agentic systems more simply / cheaply in Hetzner than trying to cobble together a bunch of fragmented apis.


How is this time efficient at all? It takes upwards of 40 seconds to compute on large 32bit values.

It's a joke post with some interesting bits and details.


It's a constant number of lookups, and all good Computer Scientists know that it is therefore an O(1) algorithm.

It is hard to imagine better efficiency than O(1)!

Indeed we could improve it further by performing all evaluations even when we find the answer earlier, ensuring it is a true Constant Time algorithm, safe for use in cryptography.


> This is time efficient* but rather wasteful of space.

You're saying that the blog's solution is time efficient. Which it is not. Your solution may be O(1) but it is also not efficient. As I'm sure you are aware.

I can tell you a practical solution which is also O(1) and takes up maybe 2 or 3 instructions of program code and no extra memory at all.

`x & 1` or `x % 2 != 0`

This blog post was taking a joke and running with it. And your comment is in that spirit as well, I just wanted to point out that it's by no means time efficient when we have 2s or 1s complement numbers which make this algorithm trivial.


You need to read their entire comment as a joke.


I guess I should have been more clear that I was just pointing out the obvious in case some confused reader missed the joke.

lol


Which was also obvious, but maybe also needed pointing out, which says something about online discussion. Something obvious, probably.


explaining the joke spoils the joke, such is social convention.


Forgive me for not being funny.


It's alright. I don't make the rules.


> I just wanted to point out that

We already know. Everybody knows. That's the joke. There's no need to point out anything.


How are you able to recognize a joke post but not a joke comment?


I may have missed the * meaning. I got that the bloom filter was an extension of the joke as I mentioned below. I was just clarifying in case someone else missed the joke.


You're absolutely right. The obvious solution would have been to create a boolean table containing all the pre-computed answers, and then simply use the integer you are testing as the index of the correct answer in memory. Now your isEven code is just a simple array lookup! Such an obvious improvement, I can't believe the OP didn't see it.

And with a little extra work you can shrink the whole table's size in memory by a factor of eight, but I'll leave that as an exercise for the interested reader.


If the "exercise" is to strictly rely on if-else statements, then the obvious speedup is to perform a binary search instead of a linear one. The result would still be horrifically space inefficient, but the speed would be roughly the time it takes to load 32x 4KB pages randomly from disk (the article memory-mapped the file). On a modern SSD a random read is 20 microseconds, so that's less than a millisecond for an even/odd check!

"That's good enough, ship it to production. We'll optimise it later."


Maybe we can even find some correlation in the bit pattern of the input and the Boolean table!


Perhaps, but I fear you’re veering way too much into “clever” territory. Remember, this code has to be understandable to the junior members of the team! If you’re not careful you’ll end up with arcane operators, strange magic numbers, and a general unreadable mess.


The comment you're replying to is also a joke, with some interesting bits and details.


I think I'll just avoid commenting on jokes from now on.


r/whoosh


I remember when this first became an issue, then they tweaked something and I noticed it a lot less. Something changed again recently (last couple years) where this is happening a lot again.

I appreciate how Apple pioneered the touchscreen mobile device, largely due to the implementation of the keyboard, but it needs to be more stable than this.


We've built stacks so high we're afraid to jump off.

Nobody is really competing because nobody can build a complete product. So there's less pressure to fix the little irritations. Users are mostly satisfied, and problems get worse slowly enough that for the average user they don't notice right away how bad it's getting. So they stay because it's too hard or completely impossible to leave.


I think the bigger issue is the update model. In the past, if a new version sucked, people wouldn't upgrade. Now with subscriptions / continuous delivery, there's less ability to vote with one's wallet/feet


That's related.

If you're dependent on updating your OS for security fixes and basic compatibility, you are also forced to update the things you may not want to. It's all bundled together.


But it's not just the OS, but apps too, to say nothing of web SaaS products.

How many times have you launched something only to find the UI had been redone, some feature was now gone or changed, something that worked was now broken, etc.

But it's fine, you see, because we have telemetry and observability and robust CI/CD.

Users and their work are nothing more than ephemeral numbers on a metrics dashboard


100%

Ownership is a critical and fading concept for software. And it makes me really sad and frustrated.


Except if you use OS that respects you, e.g., Debian. In the latter, security updates can be installed independently. On phones, there is Mobian.


This does not always work for specific programs which do not do that, and even then, there are updates that you might want other than security updates without updating other parts of the same program. Separate programs can usually be updated individually, but if they are all in one program then it can make it more difficult (sometimes configuration can be done but not always; sometimes they change things that make this not work either).


100% this. And cars are following down this road as well. For example, my Tesla 3 radio will go bonkers every so often and will refuse to change the channel, no matter what I do. Tapping a new channel icon changes the "currently playing" view, but the audio from the original channel continues to play. This happens until you restart the entire UI (by turning off the car or rebooting the display).

But, hey, they managed to add a Tron cross-over tie-in feature, and maybe some new fart noises!

Undoubtedly when they fix that radio bug, something else will fail. Like the SRS (supplemental restraint system, aka airbag) error message that was introduced at some point in the past six months, then silently got fixed with a more recent firmware update.


> But, hey, they managed to add a Tron cross-over tie-in feature, and maybe some new fart noises!

And, you know, FSD 14.2. :)


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

Search: