Linq-Dart

324 views
Skip to first unread message

Tristan McNab

unread,
Aug 1, 2012, 8:10:21 AM8/1/12
to mi...@dartlang.org
Hi All,

I got thoroughly enthused when I started learning Dart last week and to get my head around the language I decided to do a port of .NET 3.5's Language Integrated Query (LINQ) library which you can find here on GitHub. It's not fully completed, but I wanted to get some feedback on style/execution before I get ahead of myself. So if you've got any pointers or criticisms of my code, please don't hesitate to point them out and let me know via GitHub Issues!

Tristan.

Dominic Hamon

unread,
Aug 1, 2012, 10:44:11 AM8/1/12
to Tristan McNab, mi...@dartlang.org
Hello

I don't have any comments on style but wanted to add a hearty round of applause for taking this on. LINQ is one of my favourite features of the .NET framework.

One thing you might be interested in, in terms of execution, is the method cascade syntax. Support for it was recently added to the editor[1] and it seems made for LINQ-style method chaining.


- dominic



Tristan.

--
Consider asking HOWTO questions at Stack Overflow: http://stackoverflow.com/tags/dart
 
 

A Matías Quezada

unread,
Aug 1, 2012, 10:56:04 AM8/1/12
to Dominic Hamon, Tristan McNab, mi...@dartlang.org
I like the idea, I only want to remark than Dart Style Guide recommends to use lowerCamelCase for methods: http://www.dartlang.org/articles/style-guide/#names



2012/8/1 Dominic Hamon <dom...@google.com>

Bob Nystrom

unread,
Aug 1, 2012, 12:54:06 PM8/1/12
to Tristan McNab, mi...@dartlang.org
On Wed, Aug 1, 2012 at 5:10 AM, Tristan McNab <tri...@seditious-tech.com> wrote:
Hi All,

I got thoroughly enthused when I started learning Dart last week and to get my head around the language I decided to do a port of .NET 3.5's Language Integrated Query (LINQ) library which you can find here on GitHub.

Very nice!
 
It's not fully completed, but I wanted to get some feedback on style/execution before I get ahead of myself.

As Matías pointed out, we name methods in lowerCamelCase in Dart. Also, files and libraries are named using lowercase_with_underscores. Otherwise, it looks good. :)

- bob

Bob Nystrom

unread,
Aug 1, 2012, 12:56:29 PM8/1/12
to Dominic Hamon, Tristan McNab, mi...@dartlang.org
On Wed, Aug 1, 2012 at 7:44 AM, Dominic Hamon <dom...@google.com> wrote:
Hello

I don't have any comments on style but wanted to add a hearty round of applause for taking this on. LINQ is one of my favourite features of the .NET framework.

One thing you might be interested in, in terms of execution, is the method cascade syntax. Support for it was recently added to the editor[1] and it seems made for LINQ-style method chaining.


Cascades are really cool but this is actually one of those cases where they don't help. With stuff like LINQ and other "pipelined" APIs, each method is returning a new object, which is what subsequent method calls need to invoked on.

Cascades are for the cases where you're invoking a series of method calls on the same object. It's usually incrementally building up or modifying some mutable object. Think StringBuffer where you often do a whole bunch of .add() calls on it.

Cheers!

- bob

dominic

unread,
Aug 1, 2012, 1:03:41 PM8/1/12
to Bob Nystrom, Tristan McNab, mi...@dartlang.org
Ah, good point. I thought the implementation would reuse the same mutable object to save GC pressure and help performance but I can see that there might be some issues with that approach.
 

Cheers!

- bob


Paul Brauner

unread,
Aug 1, 2012, 2:25:48 PM8/1/12
to Tristan McNab, mi...@dartlang.org
Very nice! You may want to have a look at http://code.google.com/p/dart-immutable/ if you need efficient immutable maps (for groupBy or whatever it's called in LINQ).

Paul



Tristan.

--

Ladislav Thon

unread,
Aug 1, 2012, 3:38:03 PM8/1/12
to Tristan McNab, mi...@dartlang.org
I got thoroughly enthused when I started learning Dart last week and to get my head around the language I decided to do a port of .NET 3.5's Language Integrated Query (LINQ) library which you can find here on GitHub. It's not fully completed, but I wanted to get some feedback on style/execution before I get ahead of myself. So if you've got any pointers or criticisms of my code, please don't hesitate to point them out and let me know via GitHub Issues!

Nice work there. This seems to be a recurring theme, so I'll shamelessly advertise here that I've already got most of that and much more covered in http://github.com/Ladicek/dart-query, both in eager and lazy implementation.

LT

John Evans

unread,
Aug 1, 2012, 4:24:47 PM8/1/12
to mi...@dartlang.org, Tristan McNab
Nice job Tristan!  Coming from the .net world myself, one of my first Dart projects was a close cousin of Linq:  https://github.com/prujohn/Reactive-Dart  :)

mythz

unread,
Aug 1, 2012, 10:52:54 PM8/1/12
to mi...@dartlang.org, Tristan McNab
Hey Ladislav, Nice lib. 

Could definitely do with some examples on the README page - I find that it definitely helps with adoption in my own projects.

Ladislav Thon

unread,
Aug 2, 2012, 1:45:08 PM8/2/12
to mythz, mi...@dartlang.org
Hey Ladislav, Nice lib. 

Could definitely do with some examples on the README page - I find that it definitely helps with adoption in my own projects.

Thank you. I'm terrible at technical writing and I've still got some code to write... :-) Documentation is severely lacking in all of my Dart-related projects, with a single exception of https://github.com/Ladicek/dartlings, because, well, there's very little to document :-) But anyway, I'll try to get better at it.

LT

Gero

unread,
Aug 13, 2012, 4:46:43 AM8/13/12
to mi...@dartlang.org, mythz
Are we going to get some Linq to XML love?  That would be awesome!
Reply all
Reply to author
Forward
0 new messages