News for hackers. Stuff that matters.
Re:Rust Is Eating JavaScript by rednafi on Sunday February 16, 2025 @09:08AM (#43068120)
Maybe that’s because you only know one language and focused on using that everywhere.

I have worked at 2 of those named companies where people made conscious decisions of moving away from TS backend because JS is an awful language to be used for system critical things.

Re:Rust Is Eating JavaScript by epolanski on Sunday February 16, 2025 @09:12AM (#43068161)
Care to expand?

I've been writing backend TypeScript for 8 years and it's more than fine.

It's not my favorite language but it's a great compromise, and I would never choose a Lisp, Haskell, Java or C over it (the other languages I know).

Re:Rust Is Eating JavaScript by rednafi on Sunday February 16, 2025 @09:25AM (#43068273)
JavaScript, in general, is awful as a language in terms of design, and more astute people have wasted many words on this before me.

It was originally designed for writing throwaway frontend code, but people liked it so much that they started using it to build their system architecture—only to realize it doesn’t work well for anything beyond glorified RPC backends.

The type system is wishy-washy, and TypeScript needs a massive type space to compensate for it. Python is also dynamically typed, but it has a strongly typed system that saves you from runtime blowups. JavaScript doesn’t even properly blow up at runtime—you just get [object Object] or some random undefined error. TypeScript is a fantastic piece of engineering from the C# guy, but even they couldn’t fix all of JavaScript’s language-level blunders.

Few people want to build mission-critical backends on a weakly typed language.

The ecosystem is a mess, and things randomly break after a few days. My Python and Go apps from 2018 still work exactly as they did on day one. Go’s gorm and Python’s SQLAlchemy are the default ORMs that pretty much everyone uses. And how many ORMs does the JS ecosystem have?

And let’s not even start with frontend frameworks—no one loves them two days later.

The Next.js project I built yesterday is already showing 69 vulnerabilities. This sorry excuse of a language, coupled with terrible design and an indecisively childish community, makes it difficult to take seriously.

Re:Rust Is Eating JavaScript by epolanski on Sunday February 16, 2025 @03:55PM (#43071601)
You're throwing random things but you have failed to explain real world pains.

By the way you can be extremely strict and safe in typescript, it's really up to the team using it, but you can encode virtually everything and have it fully type safe.

Also, there's great tools like effect-ts if you're more functionally leaning.

Re:Rust Is Eating JavaScript by hot_gril on Monday February 17, 2025 @02:30AM (#43076192)
If you really want to waste time on types, the bolted-on TS is never going to work as well as Golang where they're native. Maybe TS types are better than Python types is all.
Re:Rust Is Eating JavaScript by epolanski on Monday February 17, 2025 @02:32PM (#43082499)
Golang's type system is not as expressive as TypeScript's.

It's fine to not know about the goods in the TypeScript ecosystem.

Again, I recommend you checking libraries like effect-ts or effect/schema or even better trying them.

https://effect.website/docs/getting-started/why-effect/

Re:Rust Is Eating JavaScript by hot_gril on Tuesday February 18, 2025 @01:10AM (#43086565)
To be honest, I don't like the look of Effect for the same reason I don't like error handling in Golang. It's easier to assume anything can fail (which is 99% correct) and use exceptions. But anyway, every language can be extended in many ways, so I can really only compare default vs default.
Re:Rust Is Eating JavaScript by hot_gril on Monday February 17, 2025 @02:27AM (#43076185)
In common JS or Py use cases, static typing makes your code less safe, because all that extra time you spend on it is less time writing tests. Meanwhile the types won't catch any bugs even the most simple test coverage would.

Sure, JS has some quirks that language design gurus complain about, but nothing that actually matters on the job. Like, == operator is weird, oh well.

Python is rightfully king for certain things like data science, but parallelism and package management are two big messes in it. ||ism is trying to be fixed with asyncio, but it's kinda too late. You know packaging is broken because every Python repo has a Dockerfile, not something you see in JS where npm is solid.

Golang is more for different use cases. Looks good but really should have done error handling like Rust, or used exceptions.

Re:Rust Is Eating JavaScript by rednafi on Monday February 17, 2025 @10:59AM (#43080252)
> npm is solid

sure it is

Re:Rust Is Eating JavaScript by hot_gril on Monday February 17, 2025 @03:17PM (#43082922)
It's solid enough that people don't fall back to Docker.
Re:Rust Is Eating JavaScript by lucsky on Monday February 17, 2025 @06:35AM (#43077797)
> My Python and Go apps from 2018 still work exactly as they did on day one

My NodeJS apps from 2014 still work exactly as they did on day one as well, what's your fucking point?

Re:Rust Is Eating JavaScript by rednafi on Monday February 17, 2025 @07:26AM (#43078201)
My point is that the JS ecosystem is masqueraded by script kiddies who will throw a hissy fit every time someone criticizes JS, and you just proved that ;)
Re:Rust Is Eating JavaScript by stuartjohnson12 on Monday February 17, 2025 @07:44PM (#43084767)
This is an embarrassing comment, there are few things this world needs less than more smug engineering tribalism. Even weakly typed languages. Typescript has many downsides, as does Python, and if you think the downsides of Python are trivial then I would invite you to take a look at the sea of different competing tools for environment management. I need a python env, now will that be with pyenv or venv or pipenv or pyvenv or virtualenv or poetry?
Re:Rust Is Eating JavaScript by eknkc on Sunday February 16, 2025 @09:19AM (#43068219)
I’ve been writing JS and then TS on the backend since 2013. Built large apps, startups and while it does the job fine I’d not go with Js on the backend anymore.

We built some stuff with Go and then went with full .Net. Its like fresh air after years of Js.

Re:Rust Is Eating JavaScript by auggierose on Sunday February 16, 2025 @09:42AM (#43068407)
What exactly did you like better in .Net than in TypeScript?
Re:Rust Is Eating JavaScript by eknkc on Sunday February 16, 2025 @04:27PM (#43071874)
- Proper static typing. This is not .net specific but bolting types on a dynamicly typed language only works to some degree. It also opens the gate to runtime type intospection such as generating OpenAPI definitions without any other input than the handler signatures themselves etc. This is handled fine by a full stack ts framework like next or nuxt and such but you are still trapped in that implementation.

- Proper multithreading and performance story. Performance itself is not the most important thing when your app mostly waits on IO. However you still get to use thread pooled async in .net or parallel goroutines in go etc and they sometimes make a difference.

- ASP.NET Core is fully feature packed and easy to work with. .net has a more cohesive ecosystem where tools, libraries, and frameworks are designed to work together seamlessly. In js runtimes, you often need to piece together different approaches and deal with compatibility issues.

- Proper standard library. Both node.js stdlib and the js globals are really weak compared to what Go or .NET or Java etc provides you out of the box. I hate dealing with npm dependencies with a passion at this point and you can have minimal dependencies when the standard library is decent. There is also the fact that upgrading an npm package is a dice roll as you need to trust the semver or check update logs etc. At least with a static typed language you get to catch public api changes on your dependencies during compile time, not in runtime.

- Linq is good, Linq expressions are great. I don't really love ORMs but I tend to use Entity Framework Core on top of low level SQL access in .NET. Makes life easier.

I don't hate TypeScript though. I still use it on the frontend obviously and I'm fine with it but given the choices on backend, it does not make much sense for me anymore.

Re:Rust Is Eating JavaScript by hot_gril on Monday February 17, 2025 @02:13AM (#43076093)
I know about 10 languages by now, and JS is one of the later ones I learned. Nah, it's the best at what it does. And if I drew a graph of every project that's moved from language A to B, it would have cycles.