Hacker News new | ask | show | jobs
by ilrwbwrkhv 546 days ago
Its especially sad to see many YC companies falling for writing JavaScript.
1 comments

No it's not why would it?

Monocole-wielding elitist opinions like these scream to me very low productivity environments that would spend weeks on reinventing the wheel rather than getting to market fast.

I love and practice Haskell, but anybody thinking that technologies like these are fit for fast moving startups are absolutely delusional.

You can easily setup a monorepo and release quickly mobile/native/web/apis and whatever with excellent editor and ecosystem support in TypeScript, good luck achieving that on alternative languages.

Last but not least, 99% of people like you criticizing JavaScript have never seen what kind of great goodies there are in the ecosystem, even for writing pure functional programming that scales, e.g. with Effect-ts[1]

[1] https://effect.website/

Okay, since you made quite a good argument, I will give you my counter.

The primary problem with JavaScript is that one, the entire ecosystem is prone to breaking. It is a very brittle system.

Next, TypeScript gives you an allure of safety, but at the edges it breaks down because underneath it, it's all just untyped JavaScript.

And the last and the most important one is because it makes it so easy to wrap functions in each other and there are no patterns at all, there is a lot of indirection in most typescript code bases.

This causes API surface area bloat which becomes hard to maintain in the long term.

And tooling doesn't completely solve for this problem either. I have seen code bases where the LSP struggles because of tons of generic types.

I think the most pragmatic alternative is Golang if you are building APIs.

And for a full stackish framework Phoenix and Elixir is a great choice.

Or you can just go all in on Rust like my companies and you get the best of everything.

JS/TS primary target is running interactive code in webbrowser. What are the good alternatives?
Sure if you are building a highly interactive app like Google maps go crazy on the javascript but keep it only for that.
I think some business SPA is heavily benefited from JS/TS too.
The issue isn’t the quality of libraries, and as you said, there are nice ones out there. The issue is the churn and dependency management.

And as for fast moving startups, the most important factor will always be the problem (and it’s myriad sub problem) and hiring. Selecting a language is dependent on those.

Paul Graham is a major Lisp advocate, attributing a non-trivial part of his own early success to it.

So there are all those good reasons for it, but it's still a little weird.

No, PG advocating for Lisp because he has had a good experience with it 30 years ago is not a "good reason".

Build a tech team around lisp in your startup then task somebody with scraping a website or handling session tokens refreshing and see the results.

At some point people should ask themselves why there's so little killer software written in Lisps or pure functional languages (besides extremely rare exceptions like Emacs or Datomic) when modest and much hated languages like PHP have plenty.

> scraping a website or handling session tokens refreshing and see the results

Have done this task at work - taking a Java crawler and modifying it to be able to navigate saml-based auth.

It's the goddamn pervasive mutation that kills you everytime. The original author will make assumptions like "I can just put my cookies here, and read from them later". And it works for a while, until you add more threads, or crawl different domains, or someone attempts some thread-safety by storing cookies in shudder thread-locals.

(This was actually the project that convinced me that I'll never be able to diagnose or fix a race condition with a step-through debugger.)

I was so fed up with this task that I whipped up a Haskell version at home. I then used that as a standard to test the Java work crawler against - by comparing mitmproxy dumps. If the Java version didn't do what the Haskell version did, I hacked on it some more.