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

"Also which of Javascript's abstractions are do you think are so inherently unsuitable?"

No, that's the wrong way of thinking about it entirely.

When you create a language, you must unavoidably privilege some ways of thinking and working above others. You must make some things easier, at the expense of making some things harder. There's no one set of answers that works universally.

Suppose I want to make an immutable language. Can I program Javascript purely immutably? Well... sort of. You can try, anyhow, but you'll get no help from the compiler, and any existing libraries will be all but useless, it's really a new language. Suppose I want to prove things in Javascript; with both mutable values and object prototypes that can be freely rewritten at any time, it's infeasible. Suppose I need C++; where's my private variables? Expressable? Sure. Useful? No; Javascript has made them much harder while working on making its object system powerful in different ways. That's not a criticism; a language has to make some things harder when it makes some things easier, to be a criticism I'd have to be calling it a "bad tradeoff", which in most cases it isn't.

It's not whether a thing can be done, it's how well it can be done, and Javascript isn't the best at everything. And "how well" something can be done matters, because the harder you make it, the less likely someone is to do it. No amount of theorizing how that doesn't have to be the case will change that.

There's nothing that any Turing Complete language can't do (with the proper hooks into the machine it's running on, anyhow), but no one language can be the best choice for everything. I wouldn't want to try to make an OS out of Javascript. Now, I personally wouldn't want to try to make one out of C particularly either, but Javascript would be even worse.

So either we lock all those apps out of the browser, or we make them much harder to write than they would be in a language actually suited to them. There's a time for C and a time for assembler and a time for Haskell and a time for C# etc. etc. Languages profoundly affect what gets written in them.



The two things i have to say in reply to that. First, i think there's a lot of bunk common wisdom about tradeoffs as well. Scala's a great example of a coherent merger of object oriented programming and functional program, two paradigms that have for whatever reason been typically seen as oppositional (please note, i'm not accusing you of that, but i think it's reasonable to ask which things you think are unsuitable, understanding that there are tradeoffs). Second, when you're talking about suitability, i have to ask about what your constraints are. If all languages have their tradeoffs, then i don't see the problem with saying that JavaScript is as good a general purpose programming language as any other. Sure it's got tradeoffs, but JS as a language and as a programming platform has really hit a firm stride, and clearly has at least a couple years of solid growth ahead of it. Yes, JS like any other programming language, isn't perfect, but it is going to continue getting better and growing into new niches.




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

Search: