Live data from Hacker News

Dart 1.5

news.dartlang.org

111–120 of 167 posts

Re: Dart 1.5

#111

Hi! I'm on the Dart team. If you'd like, I'll try to answer any questions you have.

One of the things that for some reason really confuses me about Dart even though it probably shouldn't is it's status as being full stack. I really want to use AngularDart for the front end of an application I am using and I would like to use Rails for the back end as well as some static content. I can't seem to find an easy way to make that happen. In addition, how does Dart interact with existing JavaScript librari…

You can find JS Interop docs at: https://www.dartlang.org/articles/js-dart-interop/

IMO integration is as straight-forward as it gets, basically just use a HTTP Client to call JSON services. Here's an AngularDart example for calling a REST backend: http://japhr.blogspot.com/2013/10/http-requests-in-angularda...

I've also created a JsonClient that provides a terse API for calling JSON services: https://github.com/dartist/json_client

Re: Dart 1.5

#112

Hi! I'm on the Dart team. If you'd like, I'll try to answer any questions you have.

How practical is today to start with Dart for web apps instead of Javascript? speaking from someone who doesn't know JS.

It's very familiar if you're a C# or Java developer and provides a rich, clean and consistent API library which abstracts away JavaScript and DOM apis: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vie...

The code-labs provide pretty good, practical walk-thru's: http://io2014codelabs.appspot.com/static/codelabs/dart-start...

Re: Dart 1.5

#113

Earlier quoted context omitted.

Dart in Chrome? Dart on Android? Will the Dart IDE look correctly on Windows 8 high-dpi devices? (I know that's partially an Eclipse problem) In fact, what is the future of Dart? Is it just a complement to browser-based JavaScript?

> Dart in Chrome? We're working on it! Having two language virtual machines with objects that can contain references to each other is quite technically challenging. There's a bunch of work to be done to address that[1]. Along the way, we're working with the larger Chrome team to address any other requirements they have. > Dart on Android? The Dart VM does run on Android right now [2]. My understanding is that the per…

>Aside from the splash screen, it looks nice and sharp on my retina

Heh, I believe it, but it is a bit of a mess on high-dpi Windows 8 machines (e.g. Lenovo Yoga 2 pro). Some elements get scaled, some don't, and the entire thing looks broken. It is functional, just ugly.

Re: Dart 1.5

#114
post #42

Earlier quoted context omitted.

Has there been much internal dogfooding, such that some external-facing thing I use is really powered by JavaScript that came out of dart2js? If I'm using GWT, should I be thinking about using Dart instead?

re: GWT. GWT is still actively developed and making progress. I just talked with some GWT team members at I/O, and they're adding better JS-interop (like we are), incremental compilation, and are looking at web components support. One thing we talked about that would be nice is GWT-Dart interop, (if we get everything else done). I'm biased, being on the Dart team, but I think Dart is a much nicer language that Java,…

Although it won't fix all the language boilerplate problems, we are also adding Java 8 support to GWT shortly, which does let you go from this nastiness :)

button.addEventListener("click", new EventListener() {

  public void onEvent(Event e) { Window.alert("Hello"); }   
});

to this:

button.addEventListener("click", e -> Window.alert("hello"));

Re: Dart 1.5

#115
post #60

Earlier quoted context omitted.

>As things currently stand, Dart compiles to JavaScript, which is exactly the right way to do it That was never going to change. The idea, as far as I understand it, is for Dart to be executed natively where there is a Dart VM. Where there isn't, the dart2js output would be executed. The DOM itself would be unchanged. I think that's reasonable. In fact, more than reasonable, that's just a good idea.

The danger is that the VM has different semantics (for example, integer overflow) than dart2js code. If the same dart code sometimes runs in JS and sometimes in the dart VM, people are going to hit weird bugs. Also, if it is possible to ship dart code by itself - without the JS fallback - then we are going to see sites that don't bother with the JS fallback, and those sites are only going to work in chrome. For both…

Do you have any example other than integer overflow?

It's the only difference I've ever heard referenced.

The Dart team spends enormous efforts on maintaining JS-compatibility, so much so that it rejects adding any language features that can't efficiently compile to JS.

Re: Dart 1.5

#116

Hi! I'm on the Dart team. If you'd like, I'll try to answer any questions you have.

What does Dart do to improve/address security for web? Is there any advantage of using Dart over JS in terms of security? Thank you.

Yes, there is!

I don't know the details, but I believe sanitize uses of innerHTML to avoid some common security vulnerabilities. More details here: https://groups.google.com/a/dartlang.org/forum/#!topic/misc/...

Re: Dart 1.5

#117

Earlier quoted context omitted.

I actually think microsoft is very much behind non-.net technologies as well nowadays. My experience with their TypeScript initiative has been really smooth, feels like they're trying to improve JS instead of inventing something new (by sticking as close as possible to the ES.next specs). The generated JS is very close to the original, both in size as readability.

disclaimer: I'm a huge fan of TypeScript and the folks working on it, but now work on Dart and JS stuff at Google, so I'm probably biased in all kinds of ways :) The way I like to think of it: If the main thing you want in JavaScript is types and classes, TypeScript is brilliant. It adds exactly those things, and does so in a very attractive and seamless way. Classes are already in EcmaScript 6, and I wouldn't be sur…

Dart is a platform play influenced by Javascript with some JS interop, but mostly requires its own new libraries and ecosystem, which allows many things to be fixed.

Typescript is a layer on top of Javascript and existing Javascript libraries that adds hybrid/latent typing. Typescript doesn't require a new ecosystem, but instead allows enhancements to the existing one.

Both approaches are valid.

(Disclaimer: MS employee, but had this discussion with Gilad a few weeks back)

Re: Dart 1.5

#118
post #101

I just don't trust Google to do languages and developer tools very well. They don't seem to depend on developers enough to bend over backwards for us the way that Microsoft does. Plus, they seem to want to use web tech to build native desktop tools all the time and little things like "keyboard acceleration" don't seem to matter to them because there are no standards for that in web-world.

Not sure what you mean: MS has a history of abandoning its developer platforms and frameworks that thier developers have invested in, so much so that there's no longer a clear UI story for building native desktop windows apps, i.e. VB6, Silverlight, WinForms and WPF are all effectively deprecated. Although they have long support life, when they officially abandon a platform they also refuse to Open Source it so other…

I'm feeling a little defensive here (disclaimer, MS employee, but I work for MSR, not devdiv):

> Not sure what you mean: MS has a history of abandoning its developer platforms and frameworks that thier developers have invested in, so much so that there's no longer a clear UI story for building native desktop windows apps, i.e. VB6, Silverlight, WinForms and WPF are all effectively deprecated.

WPF is still chugging a long strongly even if there aren't so many new features. Visual Studio was recently rewritten in it, and its a very good design with lots of room for encoding desktop apps in the future. I use it daily and cringe at the thought of ever doing something for the web without it.

> Whilst VisualStudio is a great IDE, I find it a subpar experience without R#.

I use visual studio just fine without R#. I see no point these days writing code without an IDE, I'm addicted to code completion. Not to mention amazing things are being done with Roslyn.

> By contrast, C#'s configuration model, msbuild project format, heavy frameworks and tooling makes it unfeasible to develop without an IDE.

C# is totally usable from the command line, most developers just refer the IDE.

> he worlds best VM engineers work on the Dart VM, i.e. the same pedigree responsible for the StrongTalk VM that was later acquired by Sun to form the basis of the world-class Java Hotspot VM that later went on to develop V8, are now leading the development on the Dart VM.

The CLR is one of the best VMs ever (read: very fast), worked on by some of the brightest who are very comparable to the Animorphic crowd. The DLR feature (ability to generate/compile expression trees at run-time) is also very cool and missing from the JVM. If you are into building language run-times, it is an awesome base for a dynamic language.

True: it is only available on Windows, but Mono has made progress as well (most features available sans WPF). I've been thinking about porting my language work [1] over to mono.cairo to see if I can achieve cross platform without going to Java or the web.

[1] http://research.microsoft.com/en-us/people/smcdirm/liveprogr...

Re: Dart 1.5

#119
post #91

Earlier quoted context omitted.

Dart doesn't work correctly in Firefox 31 Beta. People will have to recompile all their Dart apps next month.

Wow, seriously? I've been using Beta and not noticed any breakage (but that doesn't mean there isn't any). Do you have any more context?

https://code.google.com/p/dart/issues/detail?id=19489

Re: Dart 1.5

#120
post #111

Earlier quoted context omitted.

One of the things that for some reason really confuses me about Dart even though it probably shouldn't is it's status as being full stack. I really want to use AngularDart for the front end of an application I am using and I would like to use Rails for the back end as well as some static content. I can't seem to find an easy way to make that happen. In addition, how does Dart interact with existing JavaScript librari…

You can find JS Interop docs at: https://www.dartlang.org/articles/js-dart-interop/ IMO integration is as straight-forward as it gets, basically just use a HTTP Client to call JSON services. Here's an AngularDart example for calling a REST backend: http://japhr.blogspot.com/2013/10/http-requests-in-angularda... I've also created a JsonClient that provides a terse API for calling JSON services: https://github.com/dart…

So in theory it's as easy as using AngularDart and compiling the javascript and throwing that in my rails assets? I feel like I knew that and for some reason it blows my mind.
Post reply on HN