News for hackers. Stuff that matters.
Re:Announcing Dart 2: Optimized for Client-Side Development by nozzlegear on Thursday February 22, 2018 @04:22PM (#16441504)
I'm a huge fan of Dart and very happy to see this. I haven't been able to use it in any non-hobby projects yet, but I love that Dart compiles to JavaScript on the frontend and runs in a VM without any compilation on the server. A good programming language that works on both the server and the browser is like my "holy grail" of programming.

However, there's one thing keeping me from using Dart more professionally, and that's how surprisingly difficult it is to work with JSON out of the box. For a language that compiles to JS I would expect JSON interop to be as easy as "Json.Serialize" and "Json.Deserialize", but instead you need to fiddle with mirrors, add properties and metadata to classes, extend other classes, monkey around with maps and keys, add build steps, etc. This is a big showstopper when you work with web apps, and I'm slightly disappointed to not read any improvements on this front in Dart 2.0, unless I've missed something.

(Shameless plug, I wrote a very brief summary of my thoughts on Dart -- 1.2, not 2.0 -- after trying it for the first time: https://nozzlegear.com/blog/quick-thoughts-on-the-dart-langu... )

Re:Announcing Dart 2: Optimized for Client-Side Development by munificent on Thursday February 22, 2018 @04:41PM (#16441665)
> However, there's one thing keeping me from using Dart more professionally, and that's how surprisingly difficult it is to work with JSON out of the box.

We've talked about this a lot on the team. We definitely know it's a problem but so far we haven't had enough bandwidth to devote anyone to really digging in and addressing it. (It turns out that redesigning a type system and re-implementing the entire front end takes a lot of work...)

Hopefully once things settle down after Dart 2 we can take another look at this.

Re:Announcing Dart 2: Optimized for Client-Side Development by nozzlegear on Thursday February 22, 2018 @08:06PM (#16443272)
Good to hear it's on your radar, and I certainly don't mean to trivialize how much work is involved in making Json work more smoothly with Dart's type system. I'm looking forward to any improvements that might come down the road after Dart 2!
Re:Announcing Dart 2: Optimized for Client-Side Development by kevmoo1 on Thursday February 22, 2018 @05:44PM (#16442251)
In some cases, there is a trivial one-to-one mapping between a Javascript object and it's JSON serialization.

This is not the case in Dart for a number of reasons.

Many folks are happy with the solution we have – here's an example: https://github.com/dart-lang/json_serializable/tree/master/e...

We're certainly interested in making this better in the future, but as Bob said (https://news.ycombinator.com/item?id=16441665) we're very focused on finishing Dart 2 first.

Re:Announcing Dart 2: Optimized for Client-Side Development by nozzlegear on Thursday February 22, 2018 @08:09PM (#16443288)
Thanks for the link, I remember stumbling on this at some point but don't remember why I didn't use it; I'll give this solution another shot! And like I said above, I don't mean to trivialize how much work would be involved in making Json work better with Dart. I'd love to use this language in my day-to-day work, but the Json story has been the only blocker there.
Re:Announcing Dart 2: Optimized for Client-Side Development by markdog12 on Thursday February 22, 2018 @07:26PM (#16442975)
Another huge Dart fan here. While I love Dart, my complaint is exactly the same as yours, JSON serialization/deserialization. I don't want to think about all the hours I've lost researching various 3rd party packages which didn't meet my needs. In my opinion, it's so important, first-class support should've been done right out of the gate.

Edit: There was a repo for ideas to address this: https://github.com/matanlurey/dart_serialize_proposal

No activity for quite a while