

System.Linq.Parallel Is Now Open Source - fekberg
https://github.com/dotnet/corefx/tree/master/src/System.Linq.Parallel

======
blubbi2
Sorry to be "that guy", but what is System.Linq.Parallel? Can anyone provide a
brief description/ list of links where to read more about it? Why is open
sourcing it such a big deal?

~~~
Quequau
This is actually becoming my chief complaint about submissions. It appears to
me as if folks now believe that it's cool to submit links which resolve as
deeply and closely as possible to subject (in this case a the subdirectory
inside the project's repo) with total disregard to the fact that there is
insufficient (or no) information describing why we should be interested in the
link or what, if anything, we should discuss.

I'm willing to bet the submitter went through a series of links beginning with
some sort of announcement that something changed to get to the link they
submitted. Why do folks think that we would not also benefit from that
information or that it would not help to foster more interesting discussion?

~~~
protomyth
Why? Probably because the "blog spam" or "only submit the original source"
comments will show up and submissions get flagged. Happens enough that I would
imagine the submitter probably followed all the links in response to prior
submissions.

------
NKCSS
Hmm, I wonder why this was added:

    
    
        #if DEBUG
                        currentKey = unchecked((int)0xdeadbeef);
        #endif
    

[https://github.com/dotnet/corefx/blob/master/src/System.Linq...](https://github.com/dotnet/corefx/blob/master/src/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs)
line 110 :P

~~~
Someone
It is a magic marker
[http://en.wikipedia.org/wiki/Magic_number_%28programming%29#...](http://en.wikipedia.org/wiki/Magic_number_%28programming%29#Magic_debug_values).

Both its 16-bit parts have odd values, it is an illegal address (at least on
the systems it was introduced for), and it is recognizable in hex dumps. That
makes it a good value for uninitialized memory.

------
Demiurge
would be awesome if any of the dotnet open sourcing would allow to port linq
to python. i would use it in a hearbeat.

~~~
CmonDev
There is more than one Python for .NET AFAIK. And an awesome VS support as
well: [https://pytools.codeplex.com](https://pytools.codeplex.com)

~~~
Demiurge
I can't use Python on .NET, I use it with numpy and the rest of the great
native ecosystem. There are great ORMs, but I also really like LINQ.

~~~
pjmlp
I hardly do any Python nowadays, but why do you want LINQ if you already have
itertools and comprehensions?

~~~
zuck9
LINQ is way more than just itertools and comprehensions.

~~~
pjmlp
Only if you are speaking about things like LINQ2SQL, LINQ2XML and similar.

Which can be done if the right ABC are implemented.

~~~
CmonDev
Also LINQ Rx.

~~~
pjmlp
Which is just reactive programming.

~~~
CmonDev
...readily available and idiomatic as part of the LINQ universe.

~~~
pjmlp
A simple google search gave me

[https://rxpy.codeplex.com/](https://rxpy.codeplex.com/)

------
pekk
I guess that's useful for people who are already bought in to the .NET world,
but isn't LINQ encumbered by patents that pose a risk to anyone building on
top of it?

~~~
useerup
No. That was/is just FSF FUD.

You have always been able to build anything on top of it without concerns
about patents from the implementation. This claim was so hilarious that it is
incomprehensible that anyone ever believed it.

You have also been able to reimplement .NET CLR and core libraries without
fear of patent litigation (from Microsoft). They have placed the CLR and core
libraries under the legal estoppel of the community promise since 2007 (IIRC),
_in addition_ to publicly granting patent license to anyone creating an
implementation of NET CLR and core libraries from the specifications. This
latter was part of the process under which C#, .NET CLR and core libraries was
standardized under ISO. A precondition for the standardization was that any
necessary patents (for implementation) be offered on RAND terms (reasonable
and non-discriminatory). Microsoft has always offered the patent grants free.

The _community promise_ was created in response to FUD from (among others) FSF
that Microsoft would just sue anyway (despite patent grants), and with their
vast army of lawyers and deep coffers they could bury in court. The community
promise creates legal estoppel, whereby a case by Microsoft would be dismissed
if you acted "in good faith" by relying on the promise.

Open sourcing Parallel LINQ has no bearing on the patent status of anything
building on top of it. If you believe the FSF FUD, you will be ensnared in
.NET technology and Microsoft will sue you out of existence if you ever become
successful. If you do not believe the FUD, you can continue to take advantage
of LINQ, Parallel LINQ, .NET, C#, F# etc.

~~~
makomk
No, it's not just FUD, and it doesn't just apply to LINQ either. Microsoft
only promised not to sue over certain kinds of patent infringement in core
libraries; that promise didn't extend to code you wrote on top of those
libraries, which is unsurprising. Unfortunately they've patented a bunch of
common ways of using .NET functionality, including many of the things you
might use LINQ for and one of the most common idioms for using delegagtes and
events. (Both of the commonly used GUI libraries - Windows.Forms and Gtk# -
infringe the latter patent. So if you're running a GUI-based .NET app on
anything but Windows then Microsoft can sue you if they ever decide it's to
their advantage to do so.)

~~~
MagicWishMonkey
If Microsoft is willing to spend millions of dollars and take a huge PR hit to
sue you, it's safe to assume that whatever you've built is successful/popular
enough to make you very a wealthy man.

At that point, who cares?

~~~
kbenson
Possibly it matters if it's not you that's sued, but you have similar usage as
the company that is. Investors may or may not find that an acceptable risk if
MegaCorp XYZ is currently embroiled in a large lawsuit.

For example, if your company had the same strategy as Google (and/or made some
similar mistakes) with regard to circumventing Java licensing/restrictions, I
could see investors or possible investors that were aware of that being
somewhat spooked at certain points in the past.

------
mhaymo
Can anyone knowledgeable tell us how this compares to Java's parallel streams?

~~~
kasey_junk
LINQ/PLINQ are the obvious inspirations for Java 8s stream API. I don't know
if they are exactly functionally equivalent but streams bring declarative
style programming to Java iterable collections that C# has had for years.

But, don't be confused by the .NET Rx libraries which provide LINQ style
methods to observable event streams and have been ported as RxJava.
Personally, I think that is a better use of the term streams and find the Java
8 standard streams name confusing.

------
QuadDamaged
As far as I am concerned, all of the BCL has pretty much been 'open source'
since Reflector came around in 200..2?

~~~
CmonDev
No, you still have to deliberately decompile it. JavaScript web sites on the
other hand are always open-source (readable with a standard browser).

~~~
TheCoreh
Having access to the source code doesn't mean it's "open source". Open source
has to do with being able to reuse the code yourself, not to being able to
read it.

~~~
CmonDev
But the server literally pushes the source to me, and I don't typically
explicitly accept any agreements. Why cannot I simply use a readily available
feature of my browser and take a piece of code and just use it? Especially if
there is no licence agreement right in that JS file.

~~~
squeaky-clean
Unlicensed code does not grant permission to use, in fact it's the exact
opposite.

The server is not pushing the source to you so that you can take it and use it
in your own projects. It's pushing the source because that's how the browser
will run the program.

Of course you CAN take and use the code. But you MAY not.

