Hacker News new | ask | show | jobs
by baldfat 4127 days ago
I am someone that just can't stand java script I am wondering are we getting to the point where I have an option to use something like this instead? Last time I looked 18 months ago everything that was to replace java script caused me to have to go through the compiled code and deal with java script more then if I just wrote in java script in the first place.
3 comments

You'll need to compile to JavaScript to use Dart on the web. Lots of our developers say that the net win for them is the language, libraries, and tools they use while developing their app.
I really like and appreciate how Seth clearly says that you will need to compile Dart to JS for the deployed apps. Thank you!

For a long time Dart community were awaiting when Dart VM will be finally built-in into Chrome, and it was one of the selling points we often heard - Dart will be natively executed by the browsers. However, I personally don't think it's a big deal. Even if tomorrow Chrome... even if all the browsers tomorrow will be shipped with Dart VM inside, we still will have to deploy compiled to JS version for the next 3-5 years (the same with ES6 btw).

Don't get me wrong, I am looking forward to see Chrome with Dart VM onboard, I just don't think it's critical for real business apps.

I also second @jenscow's opinion, compilation to JS is a feature that has some important advantages. For the last 1,5 year I've been working on a business web app written in Dart, it's deployed into production. Most of the time we use dev channel to get access to the latest features. For 1,5 year we never had an issue caused by compilation to JS. Actually 2 times we had issues reproducible only in JS version, but the errors were in our own code, had nothing to do with compilation process, regular race conditions that had higher chances to occur in JS.

I once thought having to "compile" into Javascript was a small price to pay for the great benefits that Dart provides.

I now believe compiling to JS is actually a feature: You're only targeting a single "VM" implementation. All the hard work is done for us, and I'm able to use every feature of the language without worrying if a particular browser supports it. Also, you have an optimising compiler and tree-shaking thrown in for free.

If you don't like javascript, use whatever you want instead in the front-end that compiles to javascript. There are hundreds of language that can suits your needs. The only thing that matters is whether they allow easy interaction with the DOM. However you should know javascript,even if you don't write it in your app. You can try Haxe,JSX(the original one,not the stuff related to React that stole the name).However I would advise against anything that abstracts the DOM, like JWT.
yeah, I wouldn't use Java for scripting neither. :D