2035 came early (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
I think Js is.. okay? I can name some strengths and weaknesses,both of the language itself and the culture/ecosystem, but I certainly don't hate it.
Replies (20)
The C/C++ world where browsers came from didn't have this (closures). So it is actually a miracle we got a language as (relatively) great as Javascript.
Replies (7)
Replies (2)
const add = (a, b) => a + b;
And may need to read this a couple of times because of the lone "+" and the parentheses:
(define (add a b) (+ a b))
... and this is the simplest of examples. It's not slightly unfamiliar syntax. Perhaps Rust is slightly unfamiliar syntax, if we mean really just the syntax - as in, you can tell where the functions start and end.
You could also say that Scheme has very little syntax, for example, no distinction between statements and expressions, no operator precedence, and nearly zero reserved punctuation. So I'd argue that it needs more adaptation because it is less.
Replies (1)
I was banished from golang communities when I said that a language should deviate from already established standards only when it has a good reason to do so. I remember it being quite ironic that golang took pride in not overloading names, and then... overloaded the English word "go". It's really unreadable unless you specifically study golang.
I could go on very long how much I hate golang for its stupid syntax alone, even before we dive deeper into its broken features.
Regarding Scheme itself, functional languages never gain traction because both humans and machines think imperatively. Yes, functional languages are a beauty for someone who understands them well, and in some specific use cases, but I still remember that as a student I finished my project, I just needed to add a few prints... oh fuck I need to rewrite the entire thing just to add "print". Never touched functional programming again, except for functional elements in imperative languages.
Replies (1)
Replies (1)
A feature existed since 1960s...
Replies (1)
Replies (1)
I think it was the right call by the C++ people to explicitly list what objects are captured and how, even if the syntax's not the best.
RAII is a fact of life unfortunately, not just in C++ or Rust, but if you talk over some high level protocol over the internet you go TCP socket->HTTP connection->your stream protocol; and have to do the exact reverse.
Closures break RAII hard.
Incidentally, you don't even need closures for nice looking UI code. Immediate mode GUIs like Dear Imgui or Clay allow for super-simple looking code in basic C
Replies (4)
Having recently worked a lot with Rust, which does this implicitly - I find the explicit notation entirely unnecessary. There's only one choice - are captures moved into closure or passed by reference? - and everything else is inferred. It does lead to some verbose cloning when there are many refcounting pointers at play, but other than that it works flawlessly; I've never been in a situation I couldn't do something I wanted to.
I'm confused by the point about RAII. Why are you saying that closures break it? Personally, I found that closures complement RAII very well - the closure owns its resources, and when it goes out of scope they're all cleaned up automatically. Or do you mean situations where resources outlive the closures? This is no different than any other object that needs a reference to something that lives longer.
Layout computation is always awkward in immediate guis. You have to do an extra pass or throw away a frame.
Replies (2)
Here's a cool explainer video:
https://www.youtube.com/watch?v=by9lQvpvMIc
Naturally it works better in FP and LP languages without concept of global variables, where resources could escape the closure.
Replies (1)
Replies (1)
In any case, you have two ways to do something similar, kind of.
Naturally there are multiple variations thereof, on how to handle errors, or which way to parameterise how to close resources.Then we have the C# inspired way,
And if open_resouce doesn't support using declaration, an helper builder function can be used to wrap it in such a type.Yes it isn't as automatic as pure RAII, but it gets close enough for most practical purposes.
Continue this thread (2 replies) →
Nowadays you can probably vibe/slopcode whatever you need with just a bit of Rust, Python/shell scripts as glue and maybe Javascript if it's a webapp (but we'll likely replace that with WASM soon I'm afraid)
Replies (1)
Replies (1)
Continue this thread (1 replies) →
Replies (1)
Replies (1)
The foundation is still abysmal, but it doesn’t hurt because you don’t have to look at it anymore or you can use modern facilities instead. Note the striking similarity to what LLMs give you, it’s the same thing on a higher level.
Replies (4)
That framework churn, leftpad, etc. stuff I think is something the JS community will gladly memoryhole. Thankfully, I was rightly repelled by that mess, and fled back to backend, and returned only when things calmed down.
Btw, the pre-SPA era of jQuery is an interesting paradigm, while writing modern TS feels like writing basically any other language.
Replies (1)
When learning something new, there's a transitionary era, where you just don't get it, but assume the experts do, and eventually you will as well.
That is unless you're talking about something like quantum mechanics, where not getting it is the sign that you're not smart enough.
And I didn't get it, and I constantly assumed I was two tutorials away from eureka. But no. I suspected that maybe the people dispensing wisdom and confidently decrying how their stuff is better might have been wrong, I thought it was just hubris and hunkered down, and eventually gave up, assuming I can't keep up with the state of the art anymore.
The turning point came when I encountered a bundler bug in a fairly reputable library, and delved into its source - I expected to find some reasonable compiler stuff in there - tokenizing, parsing etc. etc. but what I found was a bunch of regexes and string replacements.
At that point I had evidence that to at least some degree, the patients were running the madhouse, and while VB6 might be deeply unsexy, I highly doubt it's compiler ever featured gems like this (PHPs might have)
Replies (1)
Every couple months a new model comes out and wows everyone, and suddenly everyone is somehow getting an even greater productivity boost. We were already at 10x in GPT 3.5 days, we must be up to something like 50x now, I guess.
Except somehow, every day these models still write the same awful code, make the same mistakes, and apologize profusely when you call them out on the dumbest of errors. I saw Claude delete the project’s README by accident the other day and happily commit the change. Is this the ASI we’ve been waiting for?
But no, I’m just holding it wrong. Just one more model bro, one more data center. A different harness, perhaps. Just don’t look at the code, bro.
Only thing I’m getting out of this whole situation is that I should probably move into people management, too. The corporate IC culture is soulcrushing, though I guess it’s always been that way.
Replies (2)
I don't see how that can be as true for you as it was during gpt3.5 days. It may still happen, but there's no way someone is shipping a full translation of ps5/xbox shaders in the days/weeks we've seen those projects complete in the same timeframe during the 3.5 days. At least not without vastly more tokens/compute/spend.
The same could be said of humans "Except somehow I still see my direct reports forgetting semi-colons, forgetting to merge, merging to the wrong branch, deleting critical files, submitting with obvious typos...".
And yet here we are succesfully maintaining both more and more complicated software than we were doing 5 years ago.
It's the same solution in both cases, from what I've seen. You need solid definitions, architecture, testing, benchmarks, etc to measure your agents against regardless of their natural/synthetic origin. If some are having success managing synthetic agents, then there must be some method by which they are doing so in just the same way that there must be some method to a human succesfully managing human agents.
You can't prompt your average (or really even field leading) humans with "build a saas try hard make no mistakes" and expect to check in next quarter to find success every time, after all.
Replies (1)
I like the specific choice of words in that sentence, isn't that telling? Not "more useful" software, not "better" software.
"Gee, I want my software to be more complicated" -- said no user ever.
Continue this thread (1 replies) →
Well, neither claim is accurate as far as I can see.
We were not at 10x in GPT 3.5 days AND models do not write the same awful code.
Replies (2)
It mananged neither - the runtime is both slower to load, run and is significantly more complex than NaCL ever was, while suffering from lots of limitations, meanwhile WASM code exists separated from the JS runtime. It's high level features like garbage collection, aren't really usable by language runtimes.
Imo the best thing would be, if you could compile Ruby to a generic bytecode, which has extended features to support dynamic objects. .NET kinda managed this back then, and there were things like IronRuby, which supported a decent subset of real Ruby code, but wasn't really popular afair.
Replies (2)
Basically everything in this sentence is false. Wasm runtimes are simpler than NaCl, which required an entire LLVM. They start faster, with lazy compilation, interpreters, parallel concurrent compilation, and dynamic tier up. It has fewer limitations than NaCl--it supports SIMD, can access all JS and browser APIs, and didn't require rearchitecting the browser. It's not separated from the JS runtime--all the browser engines use the same compilation, GC, and runtime infrastructure. The high-level features like GC that you mention not being usable from language runtimes are being used by Scala, Kotlin, and OCaml, with more coming.
I shipped the first versions of Wasm in Chrome, and it's true startup wasn't great. Initially, we compiled all Wasm with the top tier before starting. V8 doesn't do that anymore, nor do any other runtimes. Startup is better, topline performance is better, and integration with JS is better.
And did I mention that Wasm also runs in lots of other places?
Replies (1)
That's highly misleading.
The crippling problem with WASM is that all data must be serialized prior to calling a JS library. You can't just call the API directly. It causes massive overhead and performance problems, making a data-intense "pure" WASM application very slow.
Edit: The problem is very evident if you need to graph 1000s of points. Calling fetch (js-space API) has to translate data to something your WASM language can handle, then after parsing it in WASM there's overhead either for serializing the data into something the JS graphing library can handle, or overhead for passing raw HTML through js-space.
Continue this thread (1 replies) →
Getting people not to use global shared state is a struggle in any language, it’s just that it’s the primary one in JavaScript. But it’s not really global so it at least stops certain designs from making it off the whiteboard.
When I got out of school I was really good at concurrency. Probably a side effect of taking a distributed computing class.
But over and over again people broke my code, and over time I started making more and more grug brained systems and even declining PRs from engineers that tried to do things that I used to think were fine. If you have code only three engineers understand properly it needs to be locked away behind an API where others are discouraged from touching and don’t need to step through for every bug they work on. The latter is particularly tricky to pull off. The alternative is use a less sophisticated solution.
Replies (1)
Personally, ever since ES5 I really started to enjoy writing javascript, and by now practically all the warts feel quite easy to avoid. I can't say if that's personal mastery or language improvements, probably bit of both.
I still hate the ecosystem though, and always disliked it more than I ever disliked the insane var scoping rules or whatever from twenty years ago.
Replies (1)
It's been fun, recently, to discover that agents can deal with all the javascript for me, so I can whip up little visualizers, explorers, interactive reports, etc, to share with my coworkers. Much more fun than plain text and graphs.
Replies (1)
Replies (1)
Replies (2)
JS in 2026 just works.
I mean, you can hate a language compared to another language, but to the point of making you hate programming? To me, if you do, you probably don't really like programming in the first place. Especially considering that Javascript is a conventional language with variables, conditions, loops, functions, etc... the kind that should be mostly transparent to an experienced programmer.
It would be like a woodworker saying that pine made him hate woodworking, sure, you may prefer to work with oak, but pine is still wood.
Replies (3)
> It would be like a woodworker saying that pine made him hate woodworking, sure, you may prefer to work with oak, but pine is still wood.
It would be like woodworker getting dull tools to work and wood being rotten
Your analogy with woodworking is deeply flawed as well. Woodworkers do actually strongly prefer certain types of wood.
Replies (1)
This is exactly the opposite of the truth.
Programmers don't program because they like variables, conditions, loops and functions. In fact some of the best languages ever created don't have most of those things. Apparently your experience of programming doesn't extend very far given your idea of programming seems to go only as far as those basic concrete concepts.
There is such thing as neatness, elegance and beauty, especially in programming and mathematics. As in other fields it's the people with the least taste and appreciation of that who are the haters, like yourself, because they don't understand the issue at hand.
Replies (2)
I don’t even think of programs as code. Instead, it’s a sequence of actions on data. Kinda like open the file, search for the lines that contains this pattern, split it like this, sum the first item,… Expressing those in a programming language is fairly mechanical with slight adjustment according to the paradigm. But there is some effort spent there and the syntax can make it unpleasant.
Reading a program is a whole other matter. The easier a syntax make it to get the idea of a program, the better it is. I don’t like Rust because it’s full of compiler annotations and I don’t like some idiomatic techniques in other languages because they obstruct reading.
But I wouldn’t go to hate in both occasions.
For this, I don't think there are many people, if any who embody these concepts more than Don Knuth. And you know what language he chose for "The Art of Computer Programming" books? Assembly! He has also used Pascal, and C, neither are considered particularly elegant, but it doesn't matter, because the elegance is in the algorithms, not the language. In fact, one of the thing he is best known for, literate programming, could be seen as a testament on how little programming languages matter, by burying it within his prose.
Eventually with a lot of lipstick on the pig, like async / await, it has become much more tolerable.
Replies (1)
Replies (1)
I wrote software in js and then moved to ts and sometimes have to go back to js. It’s fine to me.
Ignorance is bliss I guess.
Replies (1)
People work around this generally by just running lots and lots of processes, but multi-processing as the only solution to parallelism feels like stepping back into the dark ages.
I think after a while, you realize that atrocities will be committed in every possible programming language and to prevent those you need culture over syntax.
But honestly, the thing that I like most about JavaScript is the ease to ship. I'd rather have more people use the thing I wrote than trying to convince people to install what I wrote.
- James Mickens
Replies (1)
this is why people dislike javascript.
The web would be such a nicer place if browsers were built to respect the user's preferences about which content they trust separately from which software they trust.
I'm aware that with some care you can build a wide variety of things with JS. You don't have to import the insane trust model that's part of its origin story. But I can't shake the feeling that the whole space is a slippery slope towards accidentally making bad assumptions that lead to your user being mistreated by a third party.
Replies (1)
Replies (1)
The attack surface for code served over the web at runtime is unnecessarily large, even if you've allow-listed the originating domain name. Also, it puts too much power in the hands of whoever controls that name, and power corrupts. People who are trustworthy today, will start selling their users out tomorrow.
I think Ruby is the one I never loved, and I actually don't enjoy writing it. I don't hate it, though.
Once you understand the prototype chain, some quirks, and get a grasp on the standard library/primitives, I think JS is actually quite capable and powerful. With TypeScript layered on top, I love using it. It's one of my favourite tools, up there with Rust, C#, and Go.
I even like JS more than Python, come to think of it. But I like Python a lot more than Ruby.
https://youtu.be/D5xh0ZIEUOE
(ok, ok, I really just wanted an excuse to post James Mickens)
Part of it comes from the fact that it feels like people who are less serious about software end up dictating the languages/libraries that everyone else has to put up with simply because they're the majority, not because the language is technically superior. Worse is better, and all that.
Again: feels like. There are plenty of serious people doing work in JS, and plenty of non-serious people in other languages.
Replies (1)
It’s slow, it’s hard to read and write, it often produces buggy code because of the infinite edge cases in the type system, and it’s footgunny to the max. At least it’s memory safe. If C++ was memory safe, I’d legitimately say it’s a more sane and less footgunny language. Which is really saying something, because C++ sucks ass.
Sometimes I program in JS enough that I almost start to gaslight myself into thinking it’s sane. But then I program in C#, Java, go, even PHP and I remember… no wait, JS is actually insane. How do we even write reliable software in JS? The answer is we don’t, all the software is buggy as hell but it’s fine because it’s memory safe.
What I don’t have to do often in JavaScript code reviews is lecture someone on concurrency bugs. But there are I am sure other things that I find equally annoying.
But I moved from a job with a JavaScript frontend and a Java backend to a job with only a JavaScript frontend (opaque service API because reasons and asshole) to a JavaScript backend system where I rarely touched the frontend and the lesson I learned the hard way is that I can do JavaScript about 30 hours a week and beyond that I get really fucking tired of dealing with JavaScript with no breaks to touch something else.
So I volunteered to work on shell scripts, our Docker and Terraform work (terraform was awful but I think our OPs team did something with abstraction layers to make it that awful, so I am not making a blanket statement about terraform at this time) as often as they came up.
A lot of juniors see JS hate as a way to make themselves appear more experienced. If you say you hate JS, it's a kind of flex because it implies that you've tried multiple languages and concluded that JS is the inferior one because it imposes fewer guardrails than the others and has a few nasty gotchas (which they all have, if you're being honest).
C's gotchas are pretty nasty if you ask me; mess up a pointer reference or forget to check a buffer's size and you've given an attacker root access. That's as nasty as it gets.
Even a hyped language like Rust has issues in terms of build time, gaps in concurrency safety (e.g. lock issues/complexity), async (function coloring) complexity, panics as a DoS attack surface.
Sometimes a language provides some kind of safety but simultaneously incentivizes anti-patterns and runaway complexity. Actually this point highlights what I like about JavaScript; although it isn't the most safety-conscious language (though at least it does a pretty good job protecting from remote code executions via buffer overflows), it is succinct and the lack of guardrails incentivizes people to keep function interfaces simple which encourages high cohesion and loose coupling. JS punishes you big time for not designing your architecture carefully. I also like this about Python. Python code, in practice, is quite succinct and pleasant to read.
TypeScript's type safety is nice in theory and great in the hands of an experienced architecturally-minded engineer, but it also allows sloppy coders produce overly complex but functioning spaghetti code. An ugly TypeScript codebase can go much further than an ugly JavaScript codebase, but the day of reckoning is often worse with TypeScript as it requires more heavy-handed, less localized, refactorings; even its flaws can create the illusion that TypeScript is useful because it does a great job at pointing out where the different spaghetti stands aren't making contact in the right way but it does nothing in terms of alerting you that "this project is a tangled mess of spaghetti code.'