Hacker News new | ask | show | jobs
by icebraining 4998 days ago
I don't think those excerpts show any attack on C, he just doesn't like that he can't use higher level languages without sacrificing performance. Which is a position that you may disagree with, but I don't think it's an attack on C.

would love to use JavaScript from, e.g. the command prompt, outside of a browser, but it has never been easy to do that without pretending you are running a web browser (learning DOM an so forth). The language is designed for a browser.

I don't think there's anything in the language itself that is designed for the browser; it's just the standard library that is lacking.

The Rhino shell, for example, comes with functions like readFile/2 and runCommand/N which are much more adequate for that kind of programming.

But it's certainly not as useful as C, and I certainly don't use. Though I tend to use Python, not C either (ctypes is awesome).

C does not have that sort of limitation. That's all I'm saying. And C works for many purposes right now - my OS has a vast library of C functions to do all manner of things low and high level. And that's without even looking at other huge repositories on the web. Compare this with mere "theoretical" capabilities, e.g. ideas like "low level JavaScript".

Sure; I don't think anyone denies that.

That said, it's not true that those functions are closed to you if you use JavaScript; check out node-ffi: https://github.com/rbranson/node-ffi

Running JS on bare metal is, at the moment, a pipe dream, though.

Certainly you can understand my position a little, can't you? Why do so many people love Perl and Python? If we took away all the libaries (=enablement, empowerment) would they still love them as much? For what I want to do (i.e. potentially anything, from booting to browsing), C gives me ample enablement and empowerment. Self-hosting JavaScript doesn't. And if someone writes a BIOS for ARM scriptable in JavaScript, but they write some part of it in C, well, I'm still going to want to learn C before JavaScript. That's just how I think.

Sure, I can understand your position perfectly. I just don't think your portrayal of the article was fair to the author, that's all.