Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>If you're better with screwdrivers, why struggle with a hammer?

Hammers and screwdrivers are not general purpose tools in the way that languages are.

For most things, most languages are just as fine.

It's not like JS is specialized in some very small niche by design -- like e.g. COBOL is.

>JavaScript has a painfully slow runtime.

I call BS. v8 is one of the fastest dynamic runtimes, at 2x of C or so for lots of tasks, and it totally obliterates Python, PHP, Ruby, and co in speed. And since some of the web's different properties are written in the latter 3, it's certainly not speed (which JS surpassed them far in) that's the issue.

>If you want to make a toy service and don't care about any of this, go ahead and use your favourite language. But when you want to make something incredibly fast and reliable (like nginx), you'll need to consider another technology.

Nobody writes "nginx" in JS.

They write the kind of APIs and apps and services that people also used to write in PHP, Python, Ruby, Go and whatever lang.



> I call BS. v8 is one of the fastest dynamic runtimes, at 2x of C or so for lots of tasks, and it totally obliterates Python, PHP, Ruby, and co in speed.

Any proof for this?

EDIT:

According to "The Computer Language Benchmarks Game"

JavaScript fares pretty well against Python [1] or Ruby [2] but not really that great against C [3] or Java [4] in the CPU intensive benchmarks.

1 http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

2 http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

3 http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...

4 http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...


>JavaScript fares pretty well against Python [1] or Ruby [2] but not really that great against C [3] or Java [4] in the CPU intensive benchmarks.

Considering is a non-static, totally dynamic language, with all kinds of dynamicity in it, it does totally fine. 10x to 30x faster than Python, Ruby etc, and 3x to 5x slower than C/Java is totally fast.


> It's not like JS is specialized in some very small niche by design -- like e.g. COBOL is.

Uhh, what? You don't consider "programatically manipulate the DOM in the browser" to be a niche?


There's nothing about JS as a language meant specifically to "programatically manipulate the DOM in the browser".

Anything it does related to that is just simple library code and methods on the "document", "element", etc objects -- and that's only when run in the browser where those are available (automatically "imported" let's say). Node doesn't even have the "document" object.


Accessing the DOM is not really part of the language specification, but the browser API, no?


And the "Browser API" was invented to do what, exactly? And by what mechanism was said API exposed to developers? And whose cocktail napkin was the specification written on?


>And the "Browser API" was invented to do what, exactly?

Whatever it was inveted to do is totally irrelevant, as the "browser API" is not Javascript the language/syntax but just an API (library/module).

In fact you could trivially implement it in all kinds of programming languages.


Maybe against php 4. PHP 7 is much faster


It's just about 2x as fast as PHP5.

JS JIT were already many times faster than PHP5. There's no comparison to the complexity, quality, resources and top-notch teams in play in JS JITs (just consider the vendors making them: Google, Apple, Microsoft and Mozilla) and PHP.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: