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

How would you not make it a middle language if you want a web front-end language?

The only other way I can think of is baking it up with the browser. Like Google is doing with Dart. But even they are making Dart compile to JavaScript to make sure you don't lose compatibility between different browsers who opt to not cook Dart in. I remember an interview with one of the Dart developers where he said that having it as a requirement that Dart compiles to JS was greatly limiting the potential of what they can do with Dart. But they can't opt out of it, because compatibility with other browsers is too important.

In short, they're using JS as a middle language because there's no other way to do it. JS is a terrible language, but because of how the web historically developed, we're forced to use it.



> In short, they're using JS as a middle language because there's no other way to do it. JS is a terrible language, but because of how the web historically developed, we're forced to use it.

Like any language, some people like it and some people hate it. I love it. If you stay away from the bad parts, it's a cool, flexible dynamic language. And it is pretty good to compile to, benchmarks of C compiled to JS for example are quite good.


I've heard that same argument for a long time from PHP people. Yea, these are all but tools we use for the job. But bottom line is, some tools are just worse than others at pretty much any real practical use. [1] You make it sound like you've read the Javascript: The Good Parts book [2]. I've read it too, and it's a great book I recommend for anyone who must work with Javascript and have no way out of it. But keep in mind that an important premise of the book is aid those who are in this position where they can't run away from Javascript. As shown by this thread of languages that compile to it, it's often perfectly possible to dodge the shortcomings of JS by just not using it. You shouldn't torture yourself for no good reason. If you are in a position where you must work with JavaScript. Then I recommend reading this book to learn to stay away from the bad parts, as you said. But if you can work with any of the compilable languages, I highly recommend you stay away from JS as much as you can.

I would repeat the exact same argument for using SASS or LESS instead of CSS. There is no good reason to torture yourself with CSS instead of these better languages. It's very clear that there is such thing as one language that is much better than another in every practical sense.

[1] http://www.flickr.com/photos/raindrift/sets/7215762949290803...

[2] http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor...


His argument wasn't that "it's just a tool for the job" but that JavaScript is actually a rather cool language. And it is. At any rate, I certainly like it more than most other "scripting" languages, except maybe for Lua.

I would never suggest using most of the languages on that list over JavaScript. In fact, the only ones I recommend are Lisp, Ocaml and Haskell. Maybe something like Ur/Web as well. Coffeescript is good too, but it's basically lightly improved JavaScript. I find JavaScript simpler, more expressive and generally nicer than most of the other languages listed (ignoring the ones I've never seen or used).

Ultimately, JavaScript is a nice language with some warts. But, for whatever reason, the warts are blown out of proportion compared to other languages--in my experience (out of the languages I've used significantly) Python, Perl and Java all have more significant shortcomings. I think the main reason is that JavaScript position in the browser forced a lot of people to use it against their will, which leads to more complaining.


I think javascript's main "problem" is the combination of duck typing with prototypal inheritance. People coming from a classical strictly typed OO language are very put off by that.

Ofcourse, my problem is I'm so used to javascript's duck typing that I now feel horribly constrained by a strictly typed environment.




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

Search: