[HN Gopher] uWebSockets
___________________________________________________________________
uWebSockets
Author : tosh
Score : 168 points
Date : 2022-10-26 10:29 UTC (12 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| matesz wrote:
| For those who didn't know, uWebSockets is one of the reasons for
| Bun's high performance in server benchmarks [1], not just
| JavaScriptCore.
|
| [1]
| https://github.com/uNetworking/uWebSockets/discussions/1466#...
| Tepix wrote:
| The project description:
|
| _uWebSockets is a simple to use yet thoroughly optimized,
| standards compliant and secure implementation of WebSockets (and
| HTTP). It comes with built-in pub /sub support, URL routing, TLS
| 1.3, SNI, IPv6, permessage-deflate_
| white_dragon88 wrote:
| Developer appears to be a pretentious dork. For that reason I'll
| not use this library
| alexhultman wrote:
| Thanks
| truetraveller wrote:
| Hey, thanks for uWebSockets!
| sirsinsalot wrote:
| I'll upvote you. That's a fine reason not to use a library.
| arthurcolle wrote:
| is this an inside joke that I'm too cool to understand?
| RedShift1 wrote:
| I too would like a captain to step in please
| [deleted]
| 314 wrote:
| This is a valid choice. I doubt that the developer will lose
| any sleep over it.
| chrisweekly wrote:
| "Besides this Node.js integration, you can also use Bun where
| uWebSockets is the built-in web server."
|
| Interesting. Bun keeps getting more compelling.
| cphoover wrote:
| This is perhaps only tangentially related... but I'm trying to do
| something to support sharding of websocket connections based on a
| user_id....
|
| I want the connections to be distributed to separate instances of
| a WS server based on modulo-based or consistent hashing
| algorithm... above that in the stack we have a message broker or
| queue partitioned using the same sharding algorithm for the
| number of websocket servers running. This queue/message broker
| sends publishes messages to each web socket service which in-turn
| pushes the message to the client. This is how I want to handle
| horizontally scalable web socket connections...
|
| The question I have is the best way to do this and the best way
| to migrate connections. From one service to another when/if the
| replication factor of web socket servers changes (we add/remove
| servers)...
|
| One way I would think would be to send a disconnect message to
| the websocket service when this event happens and it would
| disconnect it's clients and then have a random delay for when re-
| connection happens... so as to avoid trying to reinitialize all
| of those connections at once. This seems sub-optimal as with
| consistent-hashing many of the connections will stay on the same
| server, and terminating those connections would be unnecessary.
|
| What is the best way to migrate an open TCP from one server to
| another? Or if the connection must be closed... how can we
| minimize the number of connections that are to be closed.
|
| BTW: I know I can broadcasts to all instances of the websocket
| server, and then unless that server holds the connection it is
| no-op... if the server does have a connection then send the
| message back... This also seems it would have a limit to how far
| this scaling-strategy would grow before running into limitations.
| Savageman wrote:
| By curiosity, can I ask you which sharded message broker you
| are using? (The one "above in the stack")
| cphoover wrote:
| Could be anything (redis pub/sub with a channel for each
| shard, sqs with separate queues for each shard, separate
| partitions in kafka, etc)...
|
| haven't committed to using one particular technology. queues
| that support retries could be useful in the event that a
| disconnect happens messages wouldn't be necessarily lost.
| Something custom built on top of Redis could accomplish the
| same perhaps.
| 10000truths wrote:
| Linux has TCP connection repair, which can be used to
| transparently migrate an active TCP session between two Linux
| boxes. The TCP traffic will be paused for the duration of the
| migration, but the other endpoint will not notice as long as
| the migration is complete before TCP timeouts kick in.
|
| https://lwn.net/Articles/495304/
| detaro wrote:
| migrating an open socket to me sounds like it'd be more hassle
| than it's worth. It's possible to do, but unusual.
|
| Can't you not involve the client and send it an explicit
| "reconnect to server XYZ" message, only move clients that
| really need to move?
| cphoover wrote:
| Yes... but this seems to be then a timing issue to me... what
| happens if the replication factor changes again while they
| are reconnecting to the wrong server... then they will miss
| the second 'reconnect' message... and will stay connected to
| this server where it will never receive messages... perhaps
| an edge-case scenario.
| dsiddharth wrote:
| We're solving exactly this problem with Hathora. Checkout a
| blog post that we recently wrote:
| https://blog.hathora.dev/scalable-websocket-architecture/
|
| You're welcome to checkout the docs and get started:
| https://docs.hathora.dev/#/buildkit/README
|
| If you'd like to get in touch, feel free to shoot me a message:
| sid [at] hathora.dev
| vanviegen wrote:
| Can you just store the shard id for each user in a database?
| Each server could check if it is authorative for each incoming
| connection, and redirect if not.
|
| That way, you can migrate users one by one (sending a
| 'redirectUserConnections(userId)' to the original server, and
| even pick a shard that is geographically close to the user. (If
| you care about race conditions during migrations, you need to
| be really careful though.)
| cphoover wrote:
| Yea something like this makes sense...
|
| race conditions during migrations are the biggest concern....
| You do not want a client with a connection to server they
| will never receive a message on.
| rwl4 wrote:
| I wonder why they wrote the whole thing in header files...
| Matthias247 wrote:
| Header-only libraries are a common thing in C++. They allow
| pretty easy consumption, because the consumer only needs to
| specify the include path. That's fairly easy with any build
| system (and C++ has a lot of them).
|
| Any binary library would also require building the library
| itself using the same toolchain and then linking to it - which
| requires a lot more configuration on the consuming side. It
| might be easy if both projects use the same build system (e.g.
| cmake), but that's far from guaranteed in C++.
| commitpizza wrote:
| Like so many developer facing products or services, this one also
| fails to tell me what it is and what problem it solves and leaves
| me guessing.
|
| I _guess_ that it is a backend library for doing websocket
| communication for node and perhaps also bun?
| 323 wrote:
| It's an extremely fast library for creating websocket servers.
| It's used by some crypto exchanges for it's high performance
| and low latency.
| Deukhoofd wrote:
| The first link on the page explains exactly what it is, and
| what the motivations are.
|
| https://github.com/uNetworking/uWebSockets/blob/master/misc/...
| londons_explore wrote:
| Seeing the example[1], I suddenly realised how nodejs and C++,
| which started so far apart, are slowly merging into one
| language...
|
| [1]: https://github.com/uNetworking/uWebSockets#battery-
| batteries...
| stevefan1999 wrote:
| nl wrote:
| Anytime you calling a group of people that includes Peter
| Norvig stupid is a good time to reconsider your
| classification method.
| vbezhenar wrote:
| That's not politically correct to call JavaScript people
| stupid. Better term would be alternatively typed.
| ly3xqhl8g9 wrote:
| Any sufficiently advanced programming language is
| indistinguishable from JavaScript... for the better and for the
| worse.
| musingsole wrote:
| Eh, I think you picked the wrong side of that comparison.
| JavaScript looks like C by virtue of age and influence.
|
| It's common to remark on a language being "C-like"; not so
| much that a language is "JavaScript-like".
| AlmostAnyone wrote:
| This is not about the syntax (indeed that's C-like), but
| much more about the style of API. This style of API was
| basically invented in Node.js land and then carried over to
| other languages. And lots of JS-style syntax sugar has been
| added to the other languages to make it possible.
|
| If someone made a web app in C++, it used to be OOP heavy.
| There's no class declaration in sight here.
| TeMPOraL wrote:
| > _This style of API was basically invented in Node.js
| land and then carried over to other languages._
|
| You mean Lisp, and no surprise there, since JavaScript
| was supposed to be Scheme, except the commercial
| interests forced it to have Java-like syntax :).
| AlmostAnyone wrote:
| I write some Common Lisp and while it's alike, this C++
| API is much more similar to the JS API than to anything
| I've written in CL or Clojure. But yeah, I guess the
| basic idea is from Lisp.
| TeMPOraL wrote:
| Yes, I meant that in the sense of underlying idea, not
| the surface-level syntax.
| ly3xqhl8g9 wrote:
| It was more or less a tongue-in-cheek snowclone based on
| the famous Arthur C. Clarke adage [1].
|
| [1] https://en.wikipedia.org/wiki/Clarke%27s_three_laws#Var
| iants...
| pkrumins wrote:
| Looks like Bun and uWebSockets are the next two technologies I'll
| be exploring. Very exciting!
| lloydatkinson wrote:
| Having dealt only a tiny bit with Node, GYP (it's garbage C++
| interop layer) and the inexplicable dependency on _Python_ (???)
| being installed on the devs machine in order to build the C++
| code that got copied into node_modules, I know better than to
| ever try another library making use of that.
| alexhultman wrote:
| That's why the library ships prebuilt binaries with no
| dependencies at all. No compiler is even needed.
| mmis1000 wrote:
| I don't think you have less dep when building other c++
| projects. People also use automake, autoconf or whatever to
| generate makefiles. It is just that the author choose python
| here. I never see anybody writes makefile manually and build
| moderate or big size project. There are always tons of tools
| used.
| the_optimist wrote:
| Would be great to have the C and Rust APIs built out.
| hcayless wrote:
| Title needs correction: that's a Greek letter mu, m, not a u.
|
| Addendum: though it is clearly a u in the URL. Someone may be
| confused...
| wccrawford wrote:
| It's pretty common to use a u instead of mu in situations that
| need just plain ascii. I don't think anyone's confused.
| uTorrent comes to mind, too.
| pcthrowaway wrote:
| what do people use for Ypsilon (u) then?
| anecdotal1 wrote:
| I've never seen a software project choose a Ypsilon in
| their name before. Have any examples?
|
| m provides a good contextual clue about the project. What
| would the e character tell me?
| pcthrowaway wrote:
| > What would the e character tell me?
|
| That's epsilon, not ypsilon (it just occurred to me that
| it's more common to see it called "upsilon" in English,
| though I don't know why based on how the letter is
| pronounced - "eee-psilon")
| jraph wrote:
| > What would the e character tell me?
|
| Smaller than m. Still strictly positive but as small as
| you want. Nothing possibly smaller.
| yboris wrote:
| Except maybe the _surreal numbers_ ?
| https://en.wikipedia.org/wiki/Surreal_number those are
| smaller than "as small as you want" :P
| adamrezich wrote:
| I like the CODE_OF_CONDUCT.md
| [deleted]
| 323 wrote:
| Cool little library, I'm using it, but author has an ego the size
| of Wolfram's. This is just one snippet, there are many if you
| rummage through the docs and issues:
|
| > _In the 1970s, programming was an elite 's task. Today
| programming is done by uneducated "farmers" and as a result, the
| care for smart algorithms, memory usage, CPU-time usage and the
| like has dwindled in comparison._
|
| https://github.com/uNetworking/uWebSockets/blob/master/misc/...
| c7DJTLrn wrote:
| I used to vehemently agree with stuff like this, but now I just
| cringe. Yeah software today sucks, but comparing it with the
| 70s/80s/90s is just stupid. We don't ship software for one
| piece of incredibly simple hardware and a few thousand
| customers anymore. Elitism isn't going to make the situation
| any better and frankly unproductive whining like this is just
| getting exhausting.
| MisterTea wrote:
| I "vehemently agree" but I don't insult farmers or other blue
| collar workers because that's a shitty thing to do. The
| author is just an asshole and should be punched in the face
| by a farmer.
| zmxz wrote:
| Why is the author asshole? You don't insult farmers but you
| won't stoop before insulting the author of microwebsockets.
|
| At what point does one assume moral high ground with 100%
| certainty?
|
| It's as if all this hate comes from the inability to read
| text carefully, without isolating malicious intent first.
| girvo wrote:
| Insulting an entire group of people, by directly implying
| that farmers are not skilful or educated, is worse than
| insulting the person who made the insult in the first
| place.
| codeguro wrote:
| Insulting, whether at an individual or at a group, is a
| lowly, immoral act in of itself _despite_ one being
| slightly better than the other.
| zmxz wrote:
| But he didn't insult _crop_ farmers, he placed the word
| in quotes.
|
| A "farmer" (note the double quotes) is a gaming/internet
| culture term that denotes someone who does repetitive,
| boring tasks in order to accumulate some kind of value.
|
| I'm pretty certain that intelligent people who comment
| here are aware of it, but are using mental gymnastics in
| order to justify the insults they'll direct towards the
| author of microwebsockets.
|
| Is that not hypocrisy in its finest form?
| orf wrote:
| No, because an old and crusty term like that isn't common
| knowledge anymore.
| hunterb123 wrote:
| You're saying that gaming term is "crusty and old"
| therefore your misinterpretation of his statement and
| your emotional outrage is justified?
|
| What is the cutoff date for terms we can use that won't
| confuse and emotionally outrage you?
| orf wrote:
| I'm clearly saying, like others are in this thread, that
| just because _you_ associate calling someone a "farmer"
| with an anachronistic gaming term doesn't mean that
| _almost everyone_ will read it in a different way, nor
| does it mean that your interpretation is correct.
|
| 'What do you do for a job?'
|
| 'I'm a farmer'
|
| 'Oh right what's the best quest to farm on in WOW?'
|
| Said nobody ever.
|
| It reads very poorly, in short.
| hunterb123 wrote:
| Why do you think he put it in quotes?
|
| Did you read the full context, or just rage at the cut
| out sentence that someone else here provided to you?
|
| It's very clear in long form what he was talking about.
|
| He has no control of people taking one sentence out of a
| long opinion that he has written.
|
| It's up to you to inform yourself before joining the mob
| and sharpening your pitchfork.
| orf wrote:
| > Why do you think he put it in quotes?
|
| Because they are not actually farmers, but have similar
| negative stereotypical traits?
|
| Why are you so eager to accuse everyone of blind rage? I
| read the whole thing. It's bog standard "these kids on my
| lawn" stuff which isn't worth any brain power discussing.
|
| However, you not being able to understand why people
| didn't assign some convoluted meaning to the word farmer
| is quite interesting.
| MisterTea wrote:
| > I'm pretty certain that intelligent people who comment
| here are aware of it,
|
| It has nothing to do with intelligence. I don't game. I
| don't consume media that would constantly expose me to
| gaming memes either. Mind you, I have heard of gold
| farmers in passing. Though when I read the word 'farmers'
| the definition I am familiar with is older than all of us
| put together. Nice try at an insult though.
| wzdd wrote:
| a) For what it's worth, I did not immediately think of
| that meaning of the term, despite being familiar with it.
| I suspect that despite your claims most people would not.
| Using quotes just means that the author is not claiming
| that programming is done by literal farmers.
|
| b) Even if that's what the author meant, it is still a
| derogatory term when you consider its origin. Why do you
| think gaming culture picked "farmer" as the word used to
| describe someone who performs mindless repetitive tasks?
| Waterluvian wrote:
| The author should be a farmer for a season and we can live
| stream their crying and incompetence for charity.
| fernandotakai wrote:
| one of the reasons i LOVED clarkson's farm (jeremy
| clarkson -- from top gear/grand tour -- series on
| farming). it showed how absurdly hard farming.
|
| comparing software development (which, let's be honest,
| is super cushy) to farming is insulting.
| Waterluvian wrote:
| Oh wow I need to see that series. I hope it's hilarious.
|
| I think farming is misunderstood because historically
| it's what 95% of people did, and it wasn't all that high
| tech. Not that pre-modern farming was easy: there's
| endless nuances about how to actually grow plants/animals
| optimally. But modern farming is ridiculously high tech.
| A modern farmer is a business owner, a logistics
| engineer, a mechanic, a programmer/hacker, and a
| labourer. I'm probably missing a dozen sub-professions of
| farmer. I bet "calories generated per farmer per year"
| would be a fascinating timeseries graph to view.
| fernandotakai wrote:
| > Oh wow I need to see that series. I hope it's
| hilarious.
|
| it's crazy good. small spoiler: it starts with jeremy
| buying a lamborghini tractor, because, well, it's a
| lambo!
|
| at the end of the day, it made him respect farmers quite
| hard. and it showed a ton of people (including me!) how
| does modern farming works.
| pantsforbirds wrote:
| also farmers are incredibly resourceful. Every farmer i
| have ever met can fix any just about equipment they have
| because its so difficult and expensive to get someone to
| come out and fix it.
| hunterb123 wrote:
| bee_rider wrote:
| Does he use it elsewhere or anything like that?
|
| I would call players who expend time in lieu of skill
| "grinders." "Farming," on the other hand, is often a
| late-game playstyle which gets the best results (farming
| for rares to fully equip a build).
|
| I mean the necessity to do this can be seen as bad game
| design, and maybe the players are dummies for picking bad
| games (although the Diablo and Destiny series are pretty
| well received), but this sort of thing is required to
| play at the highest levels...
| MisterTea wrote:
| > Some of you need to learn how to read, or learn how to
| not get so emotional.
|
| How is anyone supposed to infer that from the quotes? I
| am not a gamer so I would never know this. Its domain
| specific jargon that overlaps with long standing
| definitions.
| hunterb123 wrote:
| zarzavat wrote:
| > but author has an ego the size of Wolfram's
|
| Stephen Wolfram is going to be _so_ pleased that he _finally_
| has his own unit named after him!
|
| Mathematics, physics, computing, and now psychometrics, is
| there anything that man can't make groundbreaking progress on?
| skrebbel wrote:
| Reminds me of the Dijkstra, a unit for arrogance proposed by
| Alan Kay:
|
| "I don't know how many of you have ever met Dijkstra, but you
| probably know that arrogance in computer science is measured
| in nano-Dijkstras"
| carapace wrote:
| The unit of arrogance of computer scientists (et. al.) is the
| _Dijkstra_.
| jsd1982 wrote:
| By contrast, the unit of humility in computer science
| should be the Bellard.
| intelVISA wrote:
| the unit of Kings
| throwaway0x7E6 wrote:
| is he wrong?
| [deleted]
| sirsinsalot wrote:
| It is a really poor take, not least because "memory usage, CPU-
| time..." was more important when computers had less resource.
|
| We can instead spend our time doing really cool things with
| massive amounts of data, beyond the wildest dreams of the early
| coders.
|
| The uWebSocket's authors take is SO bad in SO many other ways
| too. They should be prescribed a dose of real world.
| fbn79 wrote:
| How to not agree?
| Cthulhu_ wrote:
| I mean you can be critical about performance and lack of
| optimization without punching down. People like this have never
| worked on applications in a normal corporation, I'm sure.
| vanviegen wrote:
| > People like this [...]
|
| I mean you can be critical of communication forms without
| punching down.
| nske wrote:
| hehe yeah, though it doesn't have to be a bad thing. There
| are quite a few brilliant mavericks that never have and never
| would be able to fair well doing that -it would crush their
| soul or drive them mad. They just do what they love and
| everyone's better off for it. I think in time they tend to
| stop being permanently irritated/critical/disgusted about
| these things, and learn to accept and ignore -for their own
| sanity.
| Dave3of5 wrote:
| Yeah I have a look, really difficult to work with i'll pass.
| zmxz wrote:
| > In the 1970s, programming was an elite's task. Today
| programming is done by uneducated "farmers" and as a result,
| the care for smart algorithms, memory usage, CPU-time usage and
| the like has dwindled in comparison.
|
| What's wrong with that statement? In 1970's, the number of
| people who dealt with programming was significantly smaller
| than today. It's a matter of fact. And people who worked with
| computers back then were highly educated and pioneers of the
| technology, there was no room for half-hearted effort or "let's
| copy the first result from stackoverflow.com".
|
| Today, programmers who are meticulous, detail-oriented and who
| genuinely recognize the problem first are in minority and
| that's how I read the above.
|
| The author might have stated it abruptly, but it does not mean
| he's wrong. You're using the "cool little library", yet you
| have this kind of resentment for the person who made it, have
| you even tried to look at the situation from their perspective
| before you passed the judgement?
|
| I'm asking out of curiosity, because I can relate to having to
| work with under-skilled individuals who spend more time sorting
| out their CV and online presence than their work.
| alexhultman wrote:
| This. 1970s programming was like 2020s quantum computing. It
| was an elite's task. That's my message here.
| Beltalowda wrote:
| He follows through with an entire rant about people using
| "2022-10-26 14:59:42" to represent dates instead of
| 1666789167 Unix timestamps, and JSON in general. If that's
| really your best example then meh... I use JSON and string
| time formats because it's just easier to inspect things with
| curl or whatnot and gives a nice balance between human-
| readable and machine-readable, which I rather like for APIs.
| I do the same with database stuff, so "select * from foo" can
| be easily read. It can be quite helpful in debugging and the
| performance difference (even with compression) is just
| negligible in most cases.
|
| But what do I know ... I'm just a farmer. Now excuse me while
| I go shove my computer down a shredder and go do something
| else.
| edf13 wrote:
| Right tool for the right job... JSON and long format dates
| work in 90%+ of cases where bleeding edge optimisation is
| not required.
| 323 wrote:
| You can be both right and an asshole. These things are not
| exclusive. There is a way to say what he is saying without
| calling all of today's programmers "farmers", which also has
| some undertones that being a farmer is somehow shameful.
|
| > _under-skilled individuals who spend more time sorting out
| their CV and online presence than their work_
|
| That sounds more like a organizational/hiring problem.
| zmxz wrote:
| In gaming culture, a farmer is someone who repeats the same
| actions for extended periods of time.
|
| It's not an insult in gaming context, and "farming" in the
| context of our craft does not relate to actual farmers. It
| sounds like taking things out of context to gain moral
| upper hand which allows for insulting the author.
|
| I have to be devil's advocate, this whole shaming because
| someone else might have gotten offended is seriously
| tiresome.
|
| Library is crafted well, guy's annoyed with self-proclaimed
| crappy devs, yet the freedom to say so is revoked by the
| very community he helps.
| [deleted]
| 323 wrote:
| Calling someone a "farmer" or a "peasant" is a well known
| insult. The gaming use of the word is much less known.
|
| > 1. a person who farms; person who operates a farm or
| cultivates land.
|
| > 2. Slang: Disparaging and Offensive. an unsophisticated
| or ignorant person, especially one from a rural area.
|
| https://www.dictionary.com/browse/farmer
| alexhultman wrote:
| Yeah a "farmer" is not a literal farmer. It's slang for
| uneducated people aka peasants.
| naasking wrote:
| Sure, it's well known to English-speaking natives. This
| library was written by a Swedish consulting firm.
| Kiro wrote:
| "Farmer" is even more degrading in Swedish ("bonde"), to
| the point where you avoid using it even for actual
| farmers and say "agriculturalist" ("jordbrukare")
| instead.
| zmxz wrote:
| But it's not an insult towards _actual_ farmers, it 's an
| insult towards an impostor that pretends they're doing
| valuable work while all they do is the opposite and they
| merely throw time at a problem, creating illusion of
| value.
|
| I'm saying this because I'm raised on a farm, I was
| always proud of it, I still do it as a hobby (and I love
| my crops) and I never, ever considered it an insult when
| I heard a term "farmer" or "peasant".
|
| Nowadays, I read about people being offended in my stead,
| giving themselves the right to insult other people, like
| author of microwebsockets.
|
| Is there a world in which haters could hate without using
| excuses such as "it insults farmers"?
|
| I'm one of the farmers, I am not insulted, I do have the
| right to say this and point the attention at the *real*
| problem - and it's fake developers.
| iam-TJ wrote:
| I join you in these sentiments - born-n-bred on the farm,
| still there, and hacking software since 1981!
|
| My most regular outburst of swearing is about 'dev-ops'
| and lack of engineering discipline and occurs almost
| daily :)
| jasonlotito wrote:
| > In gaming culture, a farmer is someone who repeats the
| same actions for extended periods of time.
|
| This isn't gaming. This is a programming library.
|
| > It's not an insult in gaming context
|
| This is not a "gaming context."
|
| > and "farming" in the context of our craft does not
| relate to actual farmers
|
| I've never heard anyone refer to "farming" in the context
| of programming. Please share with me more of the use of
| farming in the context of programming (not gaming).
|
| > I have to be devil's advocate
|
| This is a lie. You do not "have" to be devil's advocate.
| This was a choice you made.
|
| > yet the freedom to say so is revoked by the very
| community he helps.
|
| This is a lie.
|
| Stop being a liar.
|
| Finally, do not "revoke" my "freedom" to say this to you
| by disagreeing or arguing against me.
| nske wrote:
| Speaking for myself, how I interpreted it is that there
| is some relationship between how unskilled developers do
| their job and what takes place during actual farming.
|
| When I first heard of the term farmer/farming in-game, I
| didn't think anyone meant to point to any stereotypes
| either, just that the actual act had similarities with
| farming. Granted, in this sentence it's easier to
| interpret it the other way, but isn't it always better to
| give someone the benefit of the doubt? I can see how the
| process of programming lazily without understanding can
| resemble farming -and there might be a more intuitive
| metaphor if the author is not a native english speaker.
|
| peace
| epicide wrote:
| > In 1970's, the number of people who dealt with programming
| was significantly smaller than today. It's a matter of fact.
| And people who worked with computers back then were highly
| educated and pioneers of the technology, there was no room
| for half-hearted effort or "let's copy the first result from
| stackoverflow.com".
|
| And yet probably the same percentage of what they wrote was
| utter crap [0]. The illusion comes from having more people
| writing more code for more reasons now. Sturgeon's law still
| applies.
|
| On top of that, the industry rewards those who:
|
| * "Produce results" insetad of those who pre-empted a bug 5
| years in advance by building something to be robust [1].
|
| * Job hop every year or two, and thereby disproportionately
| rewarding those who work on their CV.
|
| * Are personal friends and family of higher ups [2].
|
| To claim the major reason why software is in its current
| state is largely/solely because of all the "farmers" is
| harmful ignorance, at best.
|
| > programmers who are meticulous, detail-oriented and who
| genuinely recognize the problem first are in minority
|
| Perhaps the biggest problems in(/with) technology today
| aren't of a technical nature. If even somewhat true, then
| those who are "meticulously and genuinely recognizing the
| problems" aren't necessarily even programmers.
|
| [0]: This is hard/impossible to know one way or the other due
| to survivorship bias. A lot of software from the 70s is just
| gone.
|
| [1]: Instances of this are hard to even find, naturally.
| Squeaky wheel gets the grease and all that.
|
| [2]: Hardly exclusive to IT, but still a significant factor.
| aniforprez wrote:
| As someone who once was part of an outsourced team
| maintaining a COBOL system, I can attest to the fact that
| people wrote shit then, and will continue to write shit. I
| was trying to debug and figure what the hell was going on
| in some especially complex logic and found the author's
| comment at the top of the file with the date "1983". I put
| my resignation papers 2 weeks later and moved on to JS,
| Python and systems design
| bmitc wrote:
| That wasn't my understanding of the past. I had the
| perspective that early programmers were basically cowboys in
| the wild west, people from a variety of backgrounds that were
| just in the right place and took on the projects.
| jbirer wrote:
| Did his sentence hit close home with you? He's mostly right.
| mardifoufs wrote:
| Programming wasn't an elites task back then lol. I guess I
| can't disprove his statement about being peasants now, but
| they are completely wrong about the 1970s.
|
| Just ask the programmers back then;
| https://youtu.be/AxSdWhkMB_A
|
| It sure does not sound like an elite career to me. It was
| just regular people working with the constraints they had at
| the time, not because of some super intelligence or leet
| genius focus on perfection.
|
| If anything, projecting yourself (not you in particular!)
| into some mythical lost elite, as opposed to the current
| stupid pleb sounds like pure cope imo.
| intelVISA wrote:
| It is pure cope, whilst software has definitely diluted in
| quality with the lower barrier to entry... that barrier was
| never some IQ gate it was mostly socio-economic.
|
| There is a very valid case to be made for the current state
| of performance but back then if it wasn't optimized for the
| resource constraints it didn't run -- nowadays software is
| optimized for shipping quickly so of course it sucks once
| the buzzword paint falls off.
|
| We're comparing buy-once bespoke boots vs. assembly line
| fad-of-the-month trainers. The idea that either was the
| result of some 'giga brain' creators and not market
| influences is delusional.
| p1mrx wrote:
| > We have had standardized, time-zone neutral representation of
| time in binary, efficient, 4-byte representation since the
| 1970s. [...] This is just an example of how we have regressed
| in our algorithmic thinking.
|
| Now I'm wondering if uWebSockets will fail spectacularly in
| 2038.
| scaredginger wrote:
| As if whoever wrote this would survive on a farm
| a_c wrote:
| "uneducated farmer" are those who can survive on a piece of
| land dependency-free. They know weather, season, plant, animal,
| chemistry, machinery and many more. Us engineers without 30mins
| of internet are less useful than a sprouting potato. I'm not
| sure what the author meant.
| hunterb123 wrote:
| a_c wrote:
| I stand corrected for misunderstanding the context :)
| metadaemon wrote:
| Yikes! Imagine believing this and yet still having 20 open
| issues. Sounds like a bit of delusion.
| 314 wrote:
| I find it interesting that everybody in this thread seems to
| take exception to the comparison to "farmers". I mean, farming
| is brutal hard work but it also does not require a high degree
| of thinking, so I can see his point even if he has made it in
| an offensive way. Personally, I'm much happier sitting in a
| warm comfortable place thinking hard about code instead of
| being out in a cold field 20 hours a day, but meh.
|
| Much more offensive (to me) is this gem from later on:
|
| > Designing clever, binary and minimally repetitive protocols
| saves enormous amounts of CPU-time otherwise lost to
| compression.
|
| Well yes, but also, and more importantly no. This is
| technically true - not compressing the data is more efficient
| in terms of computation per bit on the wire. But it is also
| wrong in a much more subtle way.
|
| The advantage of using JSON (or an equivalent) and then
| compressing it down is that we inject a large amount of
| redundancy into the format. The CPU is taking that redundancy
| back out for us to save bandwidth, but we get to exploit it in
| much more valuable ways. The encoder/decoder are generic,
| simple and highly optimized. We can use them everywhere and
| trust them to work. This has value in itself, and it means that
| we can spend our limited budget of programmer time in
| optimizing other code where the payoff is higher. It means less
| time tracking down bugs in "super 10x programmer's one-off
| encoder that was only written for this specific application".
| And lastly, but my favourite - it means that when something
| goes wrong we have a hope of repairing the damage to the data.
| Because redundancy gives us options for error checking and
| recovery, while optimizing the binary format generally does
| not.
|
| Also, if you want the format to really be optimal it should not
| be designed as byte streams (as low-level binary formats
| generally are) and instead should be a stream of variable-sized
| tokens that are fed through an arithmetic encoder.
|
| The first half of this week I spent repairing data corruption
| caused by some of my code. Luckily there is a lot of redundancy
| in how I encoded the data (in a structure that is described in
| JSON inside the records) so I could write a tool that repaired
| the damage. I guess I'm lucky that I'm just a "farmer" :)
| janee wrote:
| >farming is brutal hard work but it also does not require a
| high degree of thinking
|
| I disagree strongly. Most people I encounter in the
| agricultural industry are quite creative lateral thinkers.
|
| But yeah I guess they wouldn't think of higher lvl thought
| such as using JSON because it "helps" with corruption...good
| luck with your data
| nurettin wrote:
| What a low hanging fruit. Is this haternews or hackernews?
| alexhultman wrote:
| You find what you look for. If you look for humble posts they
| are there to be found. But you don't want to, so you won't find
| them.
| joshxyz wrote:
| Lol, easy to nitpick but if you'll read the whole document this
| guy really knows his stuff. It's not a coincidence that
| uWebSockets is continuously being used by most trading
| platforms.
|
| "It's not bragging if you can back it up." - Muhammad Ali
| beardedman wrote:
| Making derogatory remarks is not bragging.
| [deleted]
| metadaemon wrote:
| Lol, it's also easy to blanket insult groups of people with
| zero evidence :P
| dmw_ng wrote:
| As an uneducated farmer this gave me a giggle, it suggests if I
| filed a ticket about a performance problem in the project it'd
| likely be fixed instantaneously. That quote is basically an
| advert, if the author wishes to establish such a high bar for
| themselves it'd be foolish not to avail of it.
| xorcist wrote:
| To be fair to the author, that quote is part of a longer
| passage about how one should not optimize for free form ascii
| first when fixed size buffers are an option. At least that how
| I read it, it's clearly opinionated writing.
| k__ wrote:
| That library was on HN a few times, and I read quite some
| discussions he was involved in.
|
| He's a bit like Linus. He knows what's up and sees all the
| people around him building sub par software.
|
| But instead of telling them how to improve, he's very
| confrontative and I think those times of gatekeeping are
| over.
| threatofrain wrote:
| > But instead of telling them how to improve
|
| Gatekeeping implies that this author actually has something
| he can keep from you, like universities gatekeeping a
| certificate for intellectual credibility, or OpenAI saying
| that they have information that is too dangerous for the
| world. The personal refusal to acknowledge anyone for
| anything is only gatekeeping insofar as the public ought
| have some moral prerogative to that person's
| acknowledgment.
|
| Why is this one author's acknowledgment so interesting that
| we should have a debate over it? In the face of all
| priorities, does this really bubble up to the top?
| goalieca wrote:
| Clearly someone didn't use software from even the 90s.. a lot
| of it was pure crashing garbage.
| Kiro wrote:
| They most likely didn't considering the author was born in
| the 90s.
___________________________________________________________________
(page generated 2022-10-26 23:01 UTC)