Dart 2 - Data as Data

110 views
Skip to first unread message

kc

unread,
May 18, 2017, 10:14:51 AM5/18/17
to Dart Misc
There has been discussion re json, serialization, value objects, immutability etc. Json is basically lists/records which can only contain core value objects - used in Flutter for interop.

Also a common pattern is building a tree of value objects, changing part of the tree and diffing a against the original. Also used in Flutter.

Kotlin has data classes, type safe builders and anko to give a more expressive and declarative feel.

Dart could use something in this space.

K.

Bob Nystrom

unread,
May 18, 2017, 12:46:49 PM5/18/17
to General Dart Discussion
Yes, I totally agree. I've talked about it with various people on the team for a while and toyed with a few ideas (taking inspiration from Groovy builders, Kotlin builders, Flutter, React, JSX, et al.) but so far I haven't had enough time to really put together a coherent proposal.

As you can imagine, moving the world to strong mode is a lot of work. Most languages don't change their static type system after they have millions of lines of code they have to support!

Once that's settled down a little more, we'll have more bandwidth for features like this, I hope.

Cheers!

– bob

David Morgan ☯

unread,
May 19, 2017, 8:43:51 AM5/19/17
to Dart Misc
Did someone say data classes with builders?


Definitely a good fit for flutter.
Reply all
Reply to author
Forward
0 new messages