I don't know, socket.io already feels like an unnecessary abstraction to me, and this is another abstraction on top of it. I generally dislike APIs that hide what's happening under "magic" abstractions, plus this seems leaky, as it abstracts on socket.io but requires you to know how it works.
socket.io is probably one of the most unnecessary libraries on this planet. Websockets are already as simple as possible.
In fact, websockets work so well I use them as a generic TCP replacement, because the message oriented transport model gives me 99% of what I need with the exception of custom message types. Leaving that out was a massive letdown to me, because you now need to carry a way to identify the message type inside the body, rather than just throwing the message itself into the appropriate protocol parser (e.g. a schema based binary format).
Although WebSockets are simple to use, there are a bunch of issues that the spec doesn't cater for when using them:
1. Connectivity. The WebSocket connection is only as persistent as the underlying network connection between the client and the server. A person playing a web-based game on a mobile device on a train that then goes under a tunnel is a good example.
WebSockets do not reconnect if they close unexpectedly. In such cases, you have to throw the WebSocket instance away and create a new one, and so you end up having to implement your own reconnectivity logic.
2. Message Sending. Messages will only be sent if the connection is open. If it is closed, not only do the messages not get sent, but they don't get queued up either, so they end up disappearing into the ether.
If you want to guarantee message sending, then you end up having to implement a queuing mechanism that is linked to knowing the status of the WebSocket connection, and is able to send when the conditions are right.
3. If you don't use WSS (WebSocket Secure Server) for the WebSocket host and connection url, then the WebSocket connections can get interfered with if they are connecting over a mobile network - ISPs sometimes inject packets which ends up distorting WebSocket connections over http. But I think since the days of Ed Snowden's leaks everyone has their production WebSocket systems setup using WSS.
This comes from the experience many years ago of working on a WebSocket-powered web framework called SocketStream which ran into these issues, and then some years ago I managed to build a library that focussed on dealing with those WebSocket-related issues, called Sarus: https://github.com/anephenix/sarus
WebSockets is great though, and there is still much that can be done with it as this library in the HN post demonstrates.
socket.io has a lot of optimizations that can help scale message broadcast to many connected users, and also handles things like client disconnections, delivery confirmation, etc.
It is not unnecessary, and you probably could build something that does the same things in a day or two, but I'd be surprised if it was something that scales as well to >100,000 simultaneously connected people
> socket.io is probably one of the most unnecessary libraries on this planet. Websockets are already as simple as possible.
Eh... While I agree that socket.io is one of those libraries you could probably "write" in an afternoon, and Websockets are simple, there are a couple of things that are kinda painful to rewrite time after time:
- keepalives to detect dead sockets
- reconnection logic with backoff
- ability to switch to long-polling for weird environments
- basic multiplexing/namespacing
Websockets already have keepalives. Everything but long polling is doable in a few hours and can probably be one-shotted by an LLM. For long-polling, you can just drop down to Fetch calls.
This is true. Just a few days ago I had Claude one-shot some WebSocket utilities for reconnect and message queueing. It took 2 minutes.
I've written countless WebSocket wrappers in the past (similar aversion to socket.io as others in this thread). The one-shot output was perfect. Certainly better than my patience would've allowed.
Maybe socket.io is doing something fancy on the server side, but for clients, it's absolutely overkill.
I've been using Odin for the last ~6 months, wrote a 15k loc project and it's been an absolute pleasure. This is my first low level language after 10 years of web dev, and it feels much higher level than it is, while giving you the control and performance of a language like C.
I like pretty much every choice that has been taken when designing the language, except maybe the lack of namespaces, which can be solved anyway with prefixes.
The lack of OOP features is the best part for me, it's rewiring my brain in a good way and I can now also reason much better about RDBMS schemas. Data oriented design is the most helpful approach I've stumbled upon in my career.
The same leadership that at the start of the sanctions regime claimed Russia's economy was about to collapse is still in power, mostly uncontested. I remember Mario Draghi's condescending and moralizing rhetoric: "Do you want peace or air conditioning?" Turns out we got no peace and the bills still increased by two times.
Notice how those who urge citizens to sacrifice for a higher cause never have to sacrifice anything themselves.
I know the EU council appoints a commissioner. Sorry if I don't go on and explain every aspect of how the EU works everytime I write about it.
The point is that we have 2 levels of indirection before we get to the commissioners: national elections in EU usually determine the composition of the parlament, then parlament makes a government (first level). The head of government then appoints a commissioner (second level).
The decision citizens take at national elections is determined by a variety of factors, first of all at the national level.
Given this context, to claim that citizens have any influence on who's part of the EU commission is delusional. If they did, we certainly wouldn't have Von Der Leyen in power, since she enjoys a measly ~34% approval among EU citizens.
I wonder what do you think is the solution to this?
For example I think EU citizens are not able (as in not willing to put the time and effort) to understand and discuss what EU is and what kind of MPs we want there and what they can really do.
I even consider somehow that is a mistake to even vote for those if the discussion is not about the EU and the direction we want the EU to go but about how can we protect their own country where country = ANY of the members.
> I wonder what do you think is the solution to this?
Hard to tell, to be honest. Maybe the solution is a presidential republic with a federal government like the USA. Maybe it's to give more control to the EU parlament.
IMO the EU has expanded too much for its weak government model, and has now too many conflicting interests within it. It can't work without a strong central government, and since we can't find an agreement between all members on what that government should look like, we might as well split into multiple smaller unions where members interests converge.
> I even consider somehow that is a mistake to even vote for those if the discussion is not about the EU and the direction we want the EU to go but about how can we protect their own country where country = ANY of the members.
I agree, that's why it doesn't make sense to go through national elections to pick a commissioner, that will also skew the vote in nationalist terms. We have the EU elections to take decisions about the EU, but it turns out the EU parlament is pretty much powerless.
People claimed that Russians were stripping stolen washing machines for chips, that sanctions would have collapsed their economy, etc. Lots of people claim lots of things, sometime they are right.
Based on previous actions by Russia, like the 2014 Invasion in Ukraine. But mostly I took this scenario from what one expert wrote (Carlo Masala), but it is just that, one scenario.
But this is similar to what other expert say, that the more concerning weak point in NATO is political. And if Russia could successfully drive a wedge between the NATO states it becomes vulnerable even if the total conventional military of its members is superior to Russian forces.
There's plenty of other experts saying that peaceful cooperation with Russia is possible. Wouldn't that be preferable to war to the last man, or a new decades long cold war?
I don't understand why don't we talk more about achieving that, instead of blindly preparing for WWIII. NATO shouldn't even exist since the URSS collapsed.
Sure. Might be. But you are here asking for Europe to preemptively roll over and give in to Russian wars of aggression.
From a game theory point of view how is that supposed to bring peace? That just shows Russia that they can do whatever they want and reach their goals. We already had the Minsk agreement Russia violated. Why should Russia stop when we give in to their demands? What‘s the logic there?
At some point you have to show strength. And earlier is probably better if you want to prevent WWIII
> At some point you have to show strength. And earlier is probably better if you want to prevent WWIII
Sure, EU combined already spends three times as much as Russia in "showing strength". I'm sure there must be a way to use what we have without tripling the expense. If nothing, because showing that we need 10 times their military expense to keep up with them would only show that we are in fact weaker.
Unless the goal of rearmament is only to make a few weapon manufacturers richer, then I'd say we've found the most efficient way to do it.
I don’t think re-armament is the only or the best solution. It’s just that with the US having left the picture Europe does have to show strength if it has to have any hope of keeping Russia at bay. That‘s not just arms, that’s also credible deterrence. How can Europe achieve that absent the US without spending on arms?
I do think that Ukraine is instructive in terms of Russia not being as almighty as they might seem, but in terms of outcome Putin is scary close to achieving practically all of his war aims short of Ukraine ceasing to exist. I learned that Putin is patient. He can take it step by step. He does not value human life. And that’s dangerous.
At great cost to the Russian people, sure, but does Putin care? Another five to ten years and he can give something else a go. And suddenly he is in the Baltcis or at the Polish border.
Sure that would be preferable if Russia was willing to accept that. But they proved those experts wrong in 2022 and have not changed their ways since. Maybe you could argue in the 90s that NATO shouldn't exist but Russias actions proved such arguments wrong
After how many slaps in your face will you raise your hands? Europe tried peace with Russia and Russia invaded country after country over the past decades. Where would you draw the line?
There's a saying if you want peace prepare for war. Especially with Russia who seem to have a habit of cooperation with countries that can defend themselves and invasion of those who can't.
> There's a saying if you want peace prepare for war.
Sure, EU combined already spends three times as much as Russia in "showing strength". I'm sure there must be a way to use what we have without tripling the expense. If nothing, because if we need 10 times their military expense to keep up with them we'd only show that we are in fact weaker.
Based on the way Russia has been gradually pushing more and more. Step by step. Slowly.
They take what they want. They are appeased. A couple years nothing happens. They take what they want. They are appeased … etc.
Invading Ukraine should be a clear warning that Russia will not just stop. For appeasement to end and for Europe to seriously look for viable paths to peace. Not just yearlong pauses in fighting that allow Russia to regain strength. That is not peace.
The allies actually did create a just peace through strength in Europe during and after WWII. So I’m not sure why you are so offended by that thought? Would there have been a better way to create a peace that all in all has been lasting for more than three quarters of a century now? Would it have been better to further appease the facists?(Obviously not a perfect or complete peace. Obviously the Cold War also sucked. Not disputing any of that.)
Also, obviously I hope that this time around it’s not too late to prevent facists from burning Europe to the ground before we can defeat them.
Do you dispute that showing strength is an element to peace? (I’m not talking about killing people or invading other countries. I’m talking about a demonstrated and credible willingness to defend your values and alliances.)
> The allies actually did create a just peace through strength
They won the war, the goal was clearly defeating the axis. Did you have a shower today or did you achieve a just and long lasting personal hygiene through water?
You should at least be brave enough to say it like it is: you want to win the war.
The only problem is that this time the enemy has enough nuclear weapons to trigger a new ice age, so you resort to Newspeak.
> Also, obviously I hope that this time around it’s not too late to prevent facists from burning Europe to the ground before we can defeat them.
For how I see it we got them already in the commission and doing all they can to burn the EU to the ground.
In general, divide and conquer (aka defeat in detail) is an excellent way to test and break the resolve of a military alliance, or a poorly organised but massively overpowering enemy in the aggregate.
I need logic. Everything else is just speculation, the equivalent of believing that since for the past few days it rained then we're certain that tomorrow will rain as well. It all sounds perfectly reasonable, if you are an ignorant.
Ok, if you want it spelt out, the logic would be something we all learnt in grade school. The only language bullies understand are consequences. Putin annexed part of another sovereign country in 2014 and faced no consequences. He therefore launched a full on occupation of the same country in 2022.
Also, there is no need for ad hominem attacks. Contrary to what you might think, they don't actually serve any purpose in putting your point across.
> The only language bullies understand are consequences. Putin annexed part of another sovereign country in 2014 and faced no consequences. He therefore launched a full on occupation of the same country in 2022.
So yesterday and the day before that were rainy, therefore we come to the conclusion that it has to rain tomorrow as well, am I right?
If only we knew a bit more about how the weather works!
> Also, there is no need for ad hominem attacks.
The "unless you are an ignorant" wasn't directed at you, I just used it to make a point.
When it was raining yesterday, and people with weather experience say "it might rain tomorrow", do you insist umbrellas should be left at home because it's just speculation?
Except in this scenario it's still raining as we speak. What data do you have that Russia will stop?
There are many experts saying that tomorrow won't rain, unless we make it rain ourselves. Don't make it sound like there's a clear consensus.
> What data do you have that Russia will stop?
I’m not the one suggesting we throw away €800 billion, excuse me for asking why. Still, I'll try to explain.
Russia has lots to lose and nothing to gain from a direct war with NATO. The last thing it needs is more land and resources, so we can exclude that as well. I also genuinely think the cause of this war is Russia feeling threatened by NATO expansion and a civil war on its border, whether you consider that legit or not.
The only reason for Russia to not stop is if we don't allow it, at this point.
This sounds exactly like what people were saying right up to February 2022: it doesn't make sense, Russia won't invade Ukraine, Russia has enough land, it is geopolitical suicide. And yet, here we are!
And does it really seem like the USA is going to come to the rescue if Russia pushes into the Baltics? Heck at this point they may very well use the distraction to invade Greenland.
So what's the deterrent but for Europe to buy its own umbrella?
> So what's the deterrent but for Europe to buy its own umbrella?
We already have an umbrella and it costs 3 times as much as Russia's umbrella, while being much less effective. So before burning another €800 billions Iwish we'd put some effort in finding ways to make our current $450 billions of yearly expense work.
Seriously, if we need 10x Russia's budget to keep up with them we've already lost.
On the other hand, if the ultimate goal isn't to make Europe safer, but just to enrich a bunch of weapon manufacturers, then I'd say this plan works perfectly.
The funny thing is that EU already spends 3 times as much as Russia in defence. Rearm EU is clearly a huge gift to weapon manufacturers and not much else. If we really cared about our defence we'd focus first on making what we have more efficient.
If we need to spend more than a trillion € to keep up with Russia's measly $145 billions, then we've already lost.
We need to spend a lot more and do defence very differently than Russia, because Europe values human life a lot higher than Russia.
Russia can attack with ten million men armed with knifes and clubs. They will March on, kill and destroy, until they starve to death or someone stops them.
We won't defend by sending twenty million similarity armed persons into the meat grinder. We will want to arm and armour our troops so that there is minimal loss of life and limb.
Russian may attack with chemical weapons, we are not interested in hitting back the same way.
Russia will target hydro dams and other civilian infrastructure with potential for mass destruction. We care about protecting those things to avoid harm to our citizens, Russia does not care.
> Russia can attack with ten million men armed with knifes and clubs.
This is just baseless propaganda and you know it. What a shame would it be for the west and Ukraine if an army of men armed with clubs was able to stand its ground against them.
> Russia will target hydro dams and other civilian infrastructure with potential for mass destruction. We care about protecting those things to avoid harm to our citizens, Russia does not care.
Of course, just like we did with Iraq's infrastructure[0] for example?
I suggest you use the effort you put in writing such uninformed rethoric in informing yourself, it will pay out at some point.
Whataboutism is of course another clear sign. Ironically your example would imply Iraq should have built up its military to defend from such an attack.
Things would have looked quite different in Iraq, if Saddam had focused his military spending on defense of civilians and civilian infrastructure!
Not making excuses for all the wrongs done by US and allies before, during and after the invasion. It was a terrible idea, badly executed. But it didn't come out of nowhere, Saddam had a history of attacking his neighbours, he and his party had it coming.
I don’t have the exact numbers, but for every billion not invested in healthcare, infrastructure, or clean energy, countless people will end up suffering or dying unnecessarily.
Take this study[0] as an example: austerity measures in Greece led to 10,000 avoidable infant deaths. Plenty of other studies show similar results, cutting social spending costs lives.
So how many deaths will come from shifting €800 billion from social programs to military budgets?
It’s a sure thing that this will cause suffering and death, while the idea that we need all that money for defense is just speculation, especially when the EU’s combined military budget is already far bigger than Russia’s.
The difference in Germany is that they made a historic change to their consitution where they are now able to grow their military by borrowing way more money. They are not moving money away from healthcare and infrastructure, they are actually creating a way to increase their military budget without having to move money away from healthcare and infrastructure (because in Germany, the money is sorely needed there as well).
Basically making more debt that the future generations will have to pay? The end result will be the same. These are just financial tricks, money can be created out of thin air but not resources, energy, etc.
I would even agree on this, but I wonder why do I never hear anyone requesting for the EU leadership to be held accountable for pursuing a policy of blind dependence on the US? We've cut ties with anyone the US disliked, only to be left alone all of a sudden, why aren't we looking for those responsible for this? I can tell you, many of them are currently in a position of power within the EU.
Right now we have top diplomats like Kallas saying publicly that we need to find a way to beat China, all while we already have problems with Russia and the USA. They are putting us in a corner against the rest of the world, and for what? Who has to benefit from this?
> I wonder why do I never hear anyone requesting for the EU leadership to be held accountable for pursuing a policy of blind dependence on the US?
The EU is a democratic institution. Its leaders are elected (or appointed by those who are elected). The way to hold them accountable is during elections.
I don't think that anyone campaigning on a platform to spend money on defense in EU would have been very successful prior to 2025. Things likely changed now.
I don't understand how Von Der Leyen got "elected" again then, given her horrible performance, and that only a 37% of Europeans views her favourably[0]. The catastrophic situation we find ourselves in developed under her commission, after all.
> The way to hold them accountable is during elections.
Given that VDL was elected by the EU parlament with secret ballot, how do I know which MEP voted her, so that I can vote someone else at the next EU elections?
Von der Leyen is president of the EU commission. Members of EU commission are appointed by each EU member head of state - who are all democratically elected. All EU countries should be democracies after all, although Hungary is certainly stretching this definition.
The president of the commission is appointed by the EU council (which is generally formed by the government of each member state), but has to be formally approved by the EU parliament.
If you are unhappy with how your countries' elected members of parliament (or how its head of state conducts your country position within the EU), you can vote to change it.
This includes decisions on which votes are by secret ballot.
Nothing of what I said is incorrect, yet you chose to provide a condescending and pointless explainer instead of addressing my arguments.
Why is VDL ruling the commission if her previous performance was terrible and she isn't viewed favorably by the majority of Europeans?
Why was she appointed by MPEs with secret ballot?
Given the current situation, do you really believe the democratic system in place for the EU provides efficient mechanisms for holding elected officials accountable for their actions?
I'd honestly expect better from the supposed "cradle of democracy".
> Nothing of what I said is incorrect, yet you chose to provide a condescending and pointless explainer instead of addressing my arguments.
I provided an explanation with no particularly condescending tone. I have no idea how your arguments were not addressed.
> Why is VDL ruling the commission if her previous performance was terrible and she isn't viewed favorably by the majority of Europeans?
The opportunity to change is in the regular elections, both at national and EU levels. That's when unpopular leaders are replaced.
The fact that a particular leader is unpopular does not mean much, as they are indirectly elected (as so happens in paliamentarism).
> Given the current situation, do you really believe the democratic system in place for the EU provides efficient mechanisms for holding elected officials accountable for their actions?
Yes, I do. Depending on what you mean by "held accountable", of course. People sometimes use this jargon in a very loaded manner.
The main problem I see is not the "accountability", as the commissioner is accountable to the council that picked them.
The main problem is that the council is formed by national government representatives. This mixes EU politics with local national politics. I may vote for a given party in national elections for local reaasons (e.g.: housing and transportation), but I may disagree with their stance on the EU level.
I don't know a good way to resolve this dissonance outside of some sort of federalization of the EU (something I think would be positive btw).
> The main problem I see is not the "accountability", as the commissioner is accountable to the council that picked them.
You realize that cannot work when both the council and the commissioner play on the same political agenda? For the council to hold the commissioner accountable it would mean to admit their own guilt. There is no incentive for them to do this, so there is no mechanism for accountability at all.
One example? VDL privately conducting EU business with Pfizer for a vaccine purchase on her phone (illicit) and refusing to provide the text messages to the EU's general court. All while her commission is supposedly based on defending standards of transparency, efficiency and so on.
What about her countless delusions about Russia's economy being about to collapse while all she accomplished was to send EU in a recession?
Or her blindly pursuing a policy of dependence on the USA and hostility towards China, only for the US to dump us as soon as they got a new president?
Please tell me where's the accountability in all of this.
Or why now, given her track record made up entirely of failures, we should trust her to guide the EU into a new very delicate historical phase.
You completely ignored the body of my message to complain about EU leadership, offering no sources, just a bunch of grievances (some of which are dubious at best).
Not sure where the conversation would go on from here. You will just keep being angry.
I keep telling you this system is broken, you keep replying that this is how things are supposed to work in this system. I agree that this isn't going anywhere.
Calling anyone who wants peace a bot or troll or foreign agent won't change things. It will only show that you are very displased at the idea that we won't get WWIII. Not a great look, trust me.
People who want peace tend to support giving Ukraine arms yo ensure that. Russia is more not less likely to attack if Ukraine has less support. And if somehow they succeed in conquering Ukraine as unlikely as that is they'll move on to other countries
> haha wow triggered. Sorry, no WWIII for you! But you're still in time to join the fight as a foreign mercenary if it's war you crave.
See, this is why the "discussion" you crave can't happen. We all just assume shit (like that I'm craving war) and throw insults at each other. A while ago I was arguing online and I realized, "Why am I wasting my time and mental energy trying to convince some fucking moron I don't even give a shit about?" (Yeah I know, here I am doing that again). If it were someone whose opinion I care about, I would bother, but a twat like you? It's much easier to just see your comment and think "Fucking idiot. Flag, downvote.", and probably not even be wrong about the snap judgement.
Feel free to think "Fucking Ukranian war-dodging leeches!" and we can both live in our bubbles.
BTW if Ukraine surrenders, do you think the number of Ukranian refugees in Europe will decrease, or increase? I'm sure your intellect will come up with the correct (for you) answer...