<story><title>System.Linq.Parallel Is Now Open Source</title><url>https://github.com/dotnet/corefx/tree/master/src/System.Linq.Parallel</url><text></text></story><parent_chain><item><author>mattmanser</author><text>I hate to be nit-picky, what you&amp;#x27;re presenting is non-idiomatic C#, I would guess you&amp;#x27;re not a C# programmer. No-one really uses the SQL-esque langugage. The simple methods reads better, are quicker to type, are clearer and are more succinct. &amp;#x27;p&amp;#x27;, &amp;#x27;q&amp;#x27; also tends to be the de facto standard operator in lambda expressions, rather than &amp;#x27;x&amp;#x27;, &amp;#x27;y&amp;#x27; or &amp;#x27;i&amp;#x27;, &amp;#x27;j&amp;#x27;. And why would you use IEnumerable&amp;lt;int&amp;gt; where you used it, it makes no sense?&lt;p&gt;Your code should have read:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    var numbers = new List&amp;lt;int&amp;gt;() { 1, 2, 3, 4, 5 };
    var newList = numbers.AsParallel().Select(p =&amp;gt; p + 1);&lt;/code&gt;&lt;/pre&gt;</text></item><item><author>ultimape</author><text>Linq is a library that injects a whole bunch functional style operations on top of list-like objects. Technically speaking, its implementing a type-safe query (think SQL) language on top of them, but the difference is very minimal in practice.&lt;p&gt;What this does is allow for certain operations to automatically be run in parallel.  If you wanted to add 1 to every element in an array, you could do that with with Linq:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    IEnumerable&amp;lt;int&amp;gt; numbers = new List&amp;lt;int&amp;gt;() { 1, 2, 3, 4, 5 };
    var newList = from num in numbers.AsParallel()
                    select (x =&amp;gt; x+1);
    &lt;/code&gt;&lt;/pre&gt;
but by adding &amp;quot;.asParallel()&amp;quot; to the chain:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    var newList = from num in numbers.AsParallel()
                    select (x =&amp;gt; x+1);
&lt;/code&gt;&lt;/pre&gt;
your code is automatically run on each element in a parallel fashion and the runtime handles marshalling it all into a queue for processing... or however it does it&amp;#x27;s magic.&lt;p&gt;The MSDN document on the way it does it is quite clear: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd997399(v=vs.110).aspx&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;msdn.microsoft.com&amp;#x2F;en-us&amp;#x2F;library&amp;#x2F;dd997399(v=vs.110).a...&lt;/a&gt; - describing many linq operations as &amp;#x27;delightfully parallel&amp;#x27;.&lt;p&gt;I personally love Linq. To me it feels like using a Functional Relational Mapping system when combined with Linq-To-SQL, and the same semantics can be used to create a reactive programming model similar to what is intended with kefir.js and Akka ( &lt;a href=&quot;http://msdn.microsoft.com/en-us/data/gg577609.aspx&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;msdn.microsoft.com&amp;#x2F;en-us&amp;#x2F;data&amp;#x2F;gg577609.aspx&lt;/a&gt; )&lt;p&gt;The idea itself isn&amp;#x27;t new, Perl 6 has something like this planned for trivial cases like  for (1..10) { $_ = $_ +1; }&lt;p&gt;----&lt;p&gt;I don&amp;#x27;t know the full story, but for me the significance of open sourcing this code is that it will potentially encourage forks and extensions that allow running stuff upon GPGPUs or other massively parallel architectures while still using Linq style syntax.&lt;p&gt;TL;DR:
With Linq, Anything that implements iEnumerable (lists, arrays, streams, etc) can be made to automatically support all sorts of nifty transforms. The Parallel bits let many of them run in parallel quite trivially</text></item><item><author>blubbi2</author><text>Sorry to be &amp;quot;that guy&amp;quot;, but what is System.Linq.Parallel? Can anyone provide a brief description&amp;#x2F; list of links where to read more about it? Why is open sourcing it such a big deal?</text></item></parent_chain><comment><author>ajanuary</author><text>&amp;gt; &amp;#x27;p&amp;#x27;, &amp;#x27;q&amp;#x27; also tends to be the de facto standard operator in lambda expressions, rather than &amp;#x27;x&amp;#x27;, &amp;#x27;y&amp;#x27; or &amp;#x27;i&amp;#x27;, &amp;#x27;j&amp;#x27;.&lt;p&gt;The authors of the plinq library are clearly not C# developers then.
&lt;a href=&quot;https://github.com/dotnet/corefx/search?p=1&amp;amp;q=select&amp;amp;utf8=%E2%9C%93&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;dotnet&amp;#x2F;corefx&amp;#x2F;search?p=1&amp;amp;q=select&amp;amp;utf8=%E...&lt;/a&gt;</text></comment>
<story><title>System.Linq.Parallel Is Now Open Source</title><url>https://github.com/dotnet/corefx/tree/master/src/System.Linq.Parallel</url><text></text></story><parent_chain><item><author>mattmanser</author><text>I hate to be nit-picky, what you&amp;#x27;re presenting is non-idiomatic C#, I would guess you&amp;#x27;re not a C# programmer. No-one really uses the SQL-esque langugage. The simple methods reads better, are quicker to type, are clearer and are more succinct. &amp;#x27;p&amp;#x27;, &amp;#x27;q&amp;#x27; also tends to be the de facto standard operator in lambda expressions, rather than &amp;#x27;x&amp;#x27;, &amp;#x27;y&amp;#x27; or &amp;#x27;i&amp;#x27;, &amp;#x27;j&amp;#x27;. And why would you use IEnumerable&amp;lt;int&amp;gt; where you used it, it makes no sense?&lt;p&gt;Your code should have read:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    var numbers = new List&amp;lt;int&amp;gt;() { 1, 2, 3, 4, 5 };
    var newList = numbers.AsParallel().Select(p =&amp;gt; p + 1);&lt;/code&gt;&lt;/pre&gt;</text></item><item><author>ultimape</author><text>Linq is a library that injects a whole bunch functional style operations on top of list-like objects. Technically speaking, its implementing a type-safe query (think SQL) language on top of them, but the difference is very minimal in practice.&lt;p&gt;What this does is allow for certain operations to automatically be run in parallel.  If you wanted to add 1 to every element in an array, you could do that with with Linq:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    IEnumerable&amp;lt;int&amp;gt; numbers = new List&amp;lt;int&amp;gt;() { 1, 2, 3, 4, 5 };
    var newList = from num in numbers.AsParallel()
                    select (x =&amp;gt; x+1);
    &lt;/code&gt;&lt;/pre&gt;
but by adding &amp;quot;.asParallel()&amp;quot; to the chain:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    var newList = from num in numbers.AsParallel()
                    select (x =&amp;gt; x+1);
&lt;/code&gt;&lt;/pre&gt;
your code is automatically run on each element in a parallel fashion and the runtime handles marshalling it all into a queue for processing... or however it does it&amp;#x27;s magic.&lt;p&gt;The MSDN document on the way it does it is quite clear: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd997399(v=vs.110).aspx&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;msdn.microsoft.com&amp;#x2F;en-us&amp;#x2F;library&amp;#x2F;dd997399(v=vs.110).a...&lt;/a&gt; - describing many linq operations as &amp;#x27;delightfully parallel&amp;#x27;.&lt;p&gt;I personally love Linq. To me it feels like using a Functional Relational Mapping system when combined with Linq-To-SQL, and the same semantics can be used to create a reactive programming model similar to what is intended with kefir.js and Akka ( &lt;a href=&quot;http://msdn.microsoft.com/en-us/data/gg577609.aspx&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;msdn.microsoft.com&amp;#x2F;en-us&amp;#x2F;data&amp;#x2F;gg577609.aspx&lt;/a&gt; )&lt;p&gt;The idea itself isn&amp;#x27;t new, Perl 6 has something like this planned for trivial cases like  for (1..10) { $_ = $_ +1; }&lt;p&gt;----&lt;p&gt;I don&amp;#x27;t know the full story, but for me the significance of open sourcing this code is that it will potentially encourage forks and extensions that allow running stuff upon GPGPUs or other massively parallel architectures while still using Linq style syntax.&lt;p&gt;TL;DR:
With Linq, Anything that implements iEnumerable (lists, arrays, streams, etc) can be made to automatically support all sorts of nifty transforms. The Parallel bits let many of them run in parallel quite trivially</text></item><item><author>blubbi2</author><text>Sorry to be &amp;quot;that guy&amp;quot;, but what is System.Linq.Parallel? Can anyone provide a brief description&amp;#x2F; list of links where to read more about it? Why is open sourcing it such a big deal?</text></item></parent_chain><comment><author>Infinitesimus</author><text>&amp;gt;I hate to be nit-picky&lt;p&gt;Then don&amp;#x27;t :). What you&amp;#x27;ve presented is very much like saying &amp;quot;I don&amp;#x27;t encounter many people with your style of programming and thus, no one uses that style and you&amp;#x27;re not an actual programmer in this language&amp;quot;.&lt;p&gt;Don&amp;#x27;t forget that there are varying styles of doing things. You use &amp;#x27;p&amp;#x27;? great! Others will use foo, i, j, lalal, etc. No need to get worked up over such a minor issue and detract from the actual conversation at hand.</text></comment>