Live data from Hacker News

What's wrong with JavaScript

rdallasgray.github.io

21–30 of 43 posts

Re: What's wrong with JavaScript

#21
post #18

Earlier quoted context omitted.

I politely submit that what you actually want is Python, Ruby, or Lua in the browser.

Haven't we had python in the browser for a while now with pythonwebkit, pywebkitgtk, and the other webkit-native-DOM python bindings?

Do those work if you want cross-browser compatibility for users who don't have certain plugins?

I'm thinking technologies like Skulpt or Pyjamas, that let you use Python in JS, are better. It's been a while since I investigated this situation, does anyone know of other players?

Re: What's wrong with JavaScript

#22
post #11

Earlier quoted context omitted.

I don't know if you've toyed around with CoffeeScript before, but that's something it adds in (you can use the Ruby-esque '@property' instead of 'this.property')

I had, but I abandoned it for reasons I cannot recall right now. Maybe because I like to go bare metal every time possible. But maybe I should give it a try...

I'd definitely recommend giving it another try. I'm generally very skeptical about adding another layer of abstraction into my toolchain, but I've found the benefits far outweigh the cost. Syntactic sugar like '@' aside, I've found that working in CoffeeScript enables me to write code that's far clearer and more expressive than when I'm working in vanilla JS.

Re: What's wrong with JavaScript

#23

This post is not javascript, it is coffeescript. Stop confusing the two.

From Coffeescript's website: The golden rule of CoffeeScript is: "It's just JavaScript". There was nothing at all coffeescript specific about his examples, other than the syntax. The issues he pointed out were javascript issues discussed using coffeescript syntax.

Re: What's wrong with JavaScript

#24
post #20
post #12

And yet nobody seems to be interested in Dart.

Dart VM will never be in IE , Firefox or Safari. What's the point of Dart ? to compile down to javascript? if i had to work with an alternative to JS i would chose haxe instead of Dart , since it is compatible with some parts of javascript and one can use the DOM api directly. Dart is great in theory but has little future.

> Dart VM will never be in IE , Firefox or Safari.

Same deal with CoffeeScript or TypeScript. But that shouldn't stop anyone since you can just compile to JavaScript. Minifying Dart and compiling Dart to JavaScript is almost the same thing. In both cases it's a single line which calls the compiler. If you already doing one of those things, adding the other one to your build script won't hurt one bit.

You can also use the Dart executable like Node. You can use it to write command line applications or web servers.

You can also embed the VM into other applications. Like V8, the VM itself is just a library.

There will be also a Dart VM for ARM CPUs a bit later this year.

> i would chose haxe instead of Dart , since it is compatible with some parts of javascript and one can use the DOM api directly

You can also interact with JS stuff if you use Dart. DOM stuff is done via 'dart:html', which provides a very idiomatic API. For example, all list-like things are actual Lists, which is very convenient. It's similar to jQuery, I'd say.

> Dart is great in theory but has little future.

It's great in practice, too. If you don't care about IE8, that is.

Also, Google is committed to Dart. They are also already using it for a bunch of new projects.

Re: What's wrong with JavaScript

#25
post #18

Earlier quoted context omitted.

I politely submit that what you actually want is Python, Ruby, or Lua in the browser.

Haven't we had python in the browser for a while now with pythonwebkit, pywebkitgtk, and the other webkit-native-DOM python bindings?

The other way around; Firefox nightlies let you use Python to script the DOM directly.

Re: What's wrong with JavaScript

#26
post #23

This post is not javascript, it is coffeescript. Stop confusing the two.

From Coffeescript's website: The golden rule of CoffeeScript is: "It's just JavaScript". There was nothing at all coffeescript specific about his examples, other than the syntax. The issues he pointed out were javascript issues discussed using coffeescript syntax.

He could have, and should have, used JavaScript for those examples. Otherwise it's needlessly confusing. Not every JavaScript developer knows CoffeeScript. What possible benefit could there be in using CoffeeScript instead of JavaScript in an article about JavaScript?

Re: What's wrong with JavaScript

#27
post #20
post #12

And yet nobody seems to be interested in Dart.

Dart VM will never be in IE , Firefox or Safari. What's the point of Dart ? to compile down to javascript? if i had to work with an alternative to JS i would chose haxe instead of Dart , since it is compatible with some parts of javascript and one can use the DOM api directly. Dart is great in theory but has little future.

Disclaimer: I work on Dart.

Yes, the point of Dart is to compile to JavaScript. That's the point of any alternative language that wants to run in today's browsers.

People are still mistaken that Dart's only road to success is via all browsers adopting the VM. Dart will be just fine even if no browser, including Chrome, uses the VM. The VM in Dartium already provides for a great developer experience, and the standalone VM means it has a great server and command-line platform, and unit-testing story. Dart will be even better off if/as browsers, mobile OSes, cloud hosting providers, etc. support it.

Re: What's wrong with JavaScript

#29
post #8

I'd rather have a fixed JS (no BS coercion, actual hashes, method_missing, better binding rules, local vars by default, "use scrict" checks for everything, int64 arithmetic, and a non manual ad-hoc way to create prototype chains) as the next version, instead of the "backwards compatible" pile-on that the upcoming version is. Such a JS would enable them to reuse large parts (or the entirety) of the current interpreter…

No method_missing please. The lack of it is one of the things I appreciate about JavaScript in contrast to Ruby. It's used similar to macros, but it tends to be used by those who forget that the first rule of macros is Don't Write Macros.

Re: What's wrong with JavaScript

#30
post #23

Earlier quoted context omitted.

From Coffeescript's website: The golden rule of CoffeeScript is: "It's just JavaScript". There was nothing at all coffeescript specific about his examples, other than the syntax. The issues he pointed out were javascript issues discussed using coffeescript syntax.

He could have, and should have, used JavaScript for those examples. Otherwise it's needlessly confusing. Not every JavaScript developer knows CoffeeScript. What possible benefit could there be in using CoffeeScript instead of JavaScript in an article about JavaScript?

Also, I feel like the misunderstandings he posted are somewhat from the perspective of Ruby developers who learned CoffeeScript and not JavaScript. Which I do fall under, but I guess I quickly picked up the quirks in the language which CoffeeScript does make nicer. I guess things like `this` are a problem regardless of how you spell it but I think someone who learned JavaScript properly would learn about the scope rules directly rather than just assuming "it works like Ruby" and then being angry when it doesn't.
Post reply on HN