Live data from Hacker News

I ported a JavaScript app to Dart

blog.sethladd.com

31–40 of 83 posts

Re: I ported a JavaScript app to Dart

#31

I'm concerned that, however good Dart may be, the fact that zero browsers intend on supporting it natively (and I understand they non-natively support it via js compilation), the popularity is likely to escalate. Wasn't the idea of Dart to replace JavaScript as the "lingua franca"? And we still have to run Chromium to support it natively?

Luckily, Dart compiles to JavaScript, so we don't need to wait for browser adoption of the VM. The questions that I see as important are: "Do my Dart apps, when compiled to JavaScript, work across the modern web?" and "Am I more productive building web apps with Dart?".

So does Google Web Toolkit which is what AWS's admin console uses. Why would I use Dart over Google backed GWT?

I'm also torn between using a pure javascript framework like Google Angular or a hybrid such as GWT or Dart. There are seriously too many options and no one has a clue what the long term support for any of these will be.

Re: I ported a JavaScript app to Dart

#33

Earlier quoted context omitted.

Thanks for the feedback. I did point out, in the end of the article, that some of the techniques (e.g. libraries, futures) aren't impossible in JavaScript. And I'm really happy to hear they might be coming to a future version of JavaScript (everyone should have modules and promises!). Part of the point of the article is that Dart has these features now.

Thought you'd might want to know that Promise¹ is available in Firefox & Chrome since quite a while back and the spec for Modules can be found here: Spec: http://wiki.ecmascript.org/doku.php?id=harmony:modules 1: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Yup, thanks! What's the story for modern browsers that don't yet support those features? Do they both have polyfills?

As I mentioned in the article, libraries and futures aren't exclusive to Dart. It's just that they are here now for Dart and are compiled to JavaScript for all modern browsers.

I think it's telling that the original author didn't use Promises or Modules. Of course he could have, but we should ask, why didn't he?

Re: I ported a JavaScript app to Dart

#34

I'm concerned that, however good Dart may be, the fact that zero browsers intend on supporting it natively (and I understand they non-natively support it via js compilation), the popularity is likely to escalate. Wasn't the idea of Dart to replace JavaScript as the "lingua franca"? And we still have to run Chromium to support it natively?

There is nothing preventing Google from release Dartium (Chrome with DartVM). In the meantime it compiles to js and is not the first thing to do so.

In fact I think Google should release Google Chrome with Dart VM and then accelerate a few of their apps (oh look much better Google maps!), before you know it, Opera will get it as well.

Re: I ported a JavaScript app to Dart

#35

I somewhat skimmed the article, but it doesn't mention the fact the JavaScript is on the verge of getting modules. Unless you really love Dart, you can fix most of these problems by using something like the ES6 module transpiler: https://github.com/square/es6-module-transpiler . Even better, in then next few years JavaScript will start adapting these natively, solving many of the organizational issues laid out in thi…

+1, and also, safest place to use es6 right now is on the API side. No need to wait or use the transpiler.

Re: I ported a JavaScript app to Dart

#36
post #15

Earlier quoted context omitted.

He presents the post as if he was learning something new, when he's really a seasoned Dart expert which has access to resources most of us don't have. Then there's the background that he could cherry pick his project to make the outcome look good, and doing so is in fact his job. A misleading presentation potentially leading people to false conclusions is worth calling out.

I picked the Music DNA app not because it makes Dart look good, but because I never really used Web Audio API before and the app looked good. If I really wanted to cherry pick, I wouldn't have picked an app that uses a third-party JS lib. The JS interop in Dart is sufficient, and it works, but obviously is not as seamless as it is in JavaScript. JS interop in JS is better than it is in Dart, and I didn't hide that. I…

He's not saying that you have false conclusions. He's saying that you have false pretenses. It appears as though you are new to the language, porting over some javascript code.

The truth is, you are not new to Dart at all. I believe he feels duped by you.

My personal problems with your post is that you go far too deep into the guts of how Dart works. 90% of your blog post is the internals of Dart as if you are writing the first few chapters of a Dart book. I would personally prefer it if you focused more on the specifics of the library you were porting over. That's what feels illegitimate to me when I read this article.

Re: I ported a JavaScript app to Dart

#37
post #24

Earlier quoted context omitted.

Where does he mention that other than the sidebar? I completely missed the fact that he works for Google while reading the article since it's never mentioned in the body of the article itself, and the article is written as if he's completely new to Dart and trying it out for fun. If he's not trying to present that image, then it's a really awful writing style.

Do you imply a conflict of interest? If you do, please state it explicitly. Your criticism as it stands doesn't add to the discussion and one could say that your writing style is really awful, too. Sidebar is not an unusual place to place author bio and it is definitely enough for me.

Please don't insult his writing style. That's an ad hominem attack and it is the only thing in this conversation that doesn't belong here. You don't have to agree with his concerns, but please cut that out.

Re: I ported a JavaScript app to Dart

#38
post #24

Earlier quoted context omitted.

Where does he mention that other than the sidebar? I completely missed the fact that he works for Google while reading the article since it's never mentioned in the body of the article itself, and the article is written as if he's completely new to Dart and trying it out for fun. If he's not trying to present that image, then it's a really awful writing style.

Do you imply a conflict of interest? If you do, please state it explicitly. Your criticism as it stands doesn't add to the discussion and one could say that your writing style is really awful, too. Sidebar is not an unusual place to place author bio and it is definitely enough for me.

Okay, I'll state it explicitly: I feel that the article is actively deceptive about the background of the author, which makes me distrust the content of the article as well. The sidebar with his background is not visible on the first page of the content, so I would have had to interrupt reading the article to read it.

I say that it is a bad writing style because I am assuming good faith. I assume that the positioning of his bio is merely unfortunate and not specifically chosen to reduce the number of people who read it, and that the article is not actually trying to deceive me about the author. I think it is obvious that coming across as astroturfing to some subset of your readers when that isn't what you're trying to do is a bad thing.

Re: I ported a JavaScript app to Dart

#39
post #4

One of the early issues raised about Dart was that it's compiled nature would make it hard to debug and was against the open source (easy to hack) nature of JS on the web. These days JS is more or less compiled, at least the file you get in your browser is very different that what the developer saw. This seems to improve the case of Dart and I wouldn't be surprised if we saw more languages that compile down to JS in…

Why would the compiled nature of Dart make it hard to debug? Presumably you mean debug by someone other than the original developer?

Re: I ported a JavaScript app to Dart

#40
post #31

Earlier quoted context omitted.

Luckily, Dart compiles to JavaScript, so we don't need to wait for browser adoption of the VM. The questions that I see as important are: "Do my Dart apps, when compiled to JavaScript, work across the modern web?" and "Am I more productive building web apps with Dart?".

So does Google Web Toolkit which is what AWS's admin console uses. Why would I use Dart over Google backed GWT? I'm also torn between using a pure javascript framework like Google Angular or a hybrid such as GWT or Dart. There are seriously too many options and no one has a clue what the long term support for any of these will be.

GWT is ideal for Java developers who prefer to write in Java, but have to deploy in JavaScript.

Pure JavaScript (or a JavaScript framework) are ideal if you either know JavaScript, or are ok learning the language. IMO, learning JavaScript is a good bet since it is the language of the web. Basically, your web apps will either be written in JS or compile to JS, so knowing the language is worth it.

Dart would be selected over GWT if you don't know Java, but like the lang features of Dart.

Of course, there are tons of options in the 'compile to' langs, with CoffeeScript being a popular on.

Post reply on HN