Hacker News new | past | comments | ask | show | jobs | submit login

I’ve used quite a few. What are the popular scripting languages to compare with? Python, Ruby, PHP are probably the only real competitors (disregarding others like VB or Perl).

Functional programming is very difficult in those languages due to weird closures, bad lambdas, weird block/proc/lambda rules, etc. async from the ground up means that concurrency story is much better and allows lots of threading (with libuv or whatever low level library handling the difficult parts).

JS used to have less ergonomic syntax, but has benefited from adding it last, so it usually chooses the best version.

Stability of JS is much better. When the implementation is the spec, there are bound to be lots of little breakages. Asa result, there’s not much room for alternative implementations.

Tooling is far better than any other scripting language. Debugging and introspection tools are second to none in the category. All these other languages have broken compatibility so that old software won’t run on new versions. Webpack gets hate, but what other scripting language bundles its output? Babel gets hate, but if Python had something similar, the v2/3 switch would have been no big deal and all the “I can’t use that because REHL doesn’t support that version yet wouldn’t be an issue either. Likewise, minifiers reduce download size, improve performance by removing and simplifying parts of the code and improve parse time, but other scripting languages don’t bother.

Type support via typescript is miles ahead of the competition.

Finally, performance is one or even two orders of magnitude better compared to other scripting languages (luaJIT being a notable exception). In fact, modern JS JITs can come very close to the performance of Java or even C in many cases.

JavaScript isn’t the end all, be all of programming, but it’sa very solid choice with good reasons to like it.




Have you tried Elixir or any Scheme? If the scope is dynamic languages, both put JavaScript to shame with much more power, useful tools and far fewer non-sensical footguns.

If the scope is programming languages in general, since it was stated that JS isn't a "bad language" after all, then you can include a long, long list of type-safe languages that are much better for dealing with both its role in the browser and in the backend. Elm, Reason, F#, OCaml, Scala, Kotlin, Swift, Rust, Haskell, to name a few.


I necessarily confined myself to popular languages because of all the advantages that brings. If I could choose any language and magically have an awesome ecosystem, I'd definitely choose StandardML with my second choice being Scheme.

Most of the languages you mention are as fast or faster than JS. Most of them are also much more niche. Tooling for most of them is lacking. Others drag around a huge ball and chain in the form of the JVM or .NET (even the light versions are generally much bigger than v8).

Reason/ReScript seems mostly abandoned by Facebook at this point. Elm is very deliberately a one-man show (I don't like that bus factor). Ocaml compatibility and tooling seem easy then drop off a cliff in practice. Haskell is way too worried about math and the illusion of purity (and finding people willing to deal with it is very hard). Swift is Apple-only and doesn't actually bring much to the table (honestly, it seems like a rip-off of Dart with tuples and ref counting instead of a GC). Rust is much lower level and writing something in rust will take far longer than in JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: