Coffeehouse Thread

13 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

LINQ for JavaScript :)

Back to Forum: Coffeehouse
  • User profile image
    Ion Todirel

    OK its not true, but the title sounds cool Smiley

    http://trimpath.com/project/wiki/TrimQuery

  • User profile image
    odujosh

    I can see hackers having a field day with people who do this Smiley Be careful guys and gals.

  • User profile image
    CRPietschma​nn

    Here's an open source implementation of LINQ to JavaScript that I started.

    http://codeplex.com/jslinq

  • User profile image
    Ray6

    Train wreck ... waiting to happen.

  • User profile image
    littleguru

    LINQ injection Big Smile

  • User profile image
    esoteric

    I'd rather have the full LINQ syntax available and then compiled to Javascript. Isn't that what Volta enables!?

  • User profile image
    littleguru

    esoteric wrote:
    I'd rather have the full LINQ syntax available and then compiled to Javascript. Isn't that what Volta enables!?


    That's the idea...

  • User profile image
    esoteric

    Meh? Javascript is a fun language with higher-order functions, closures and all, but it ain't got LINQ and it ain't got a query system built in. You can build anything on anything, but that's not the same as it "has" it, that's kind of the point here with Volta and LINQ....

    And LINQ is not the enabler for functional programming, rather I'd say it is itself enabled by other functional constructs that have been introduced into C# 3.0. Of course it comes with a very nice syntax.

  • User profile image
    Ion Todirel

    I'd better write JavaScript than using Volta, the idea is cool but it's ugly

  • User profile image
    esoteric

    Can you elaborate on this ugliness you speak of?

  • User profile image
    JChung2006

    Meh, JavaScript already had the functional programming constructs enabled in LINQ for CLR languages.

  • User profile image
    JChung2006

    esoteric wrote:
    Meh? Javascript is a fun language with higher-order functions, closures and all, but it ain't got LINQ and it ain't got a query system built in. You can build anything on anything, but that's not the same as it "has" it, that's kind of the point here with Volta and LINQ....

    And LINQ is not the enabler for functional programming, rather I'd say it is itself enabled by other functional constructs that have been introduced into C# 3.0. Of course it comes with a very nice syntax.

    Let's be more precise.  We're talking about LINQ to Objects here, not LINQ.

    I see LINQ to Objects as an application of the functional programming constructs added to C# 3 and VB 9, constructs which JavaScript already had.  LINQ to Objects' power and expressiveness come from those constructs, not from LINQ to Objects' application of them.  I like the new syntax, too, but the inconsistency of the syntax between C# and VB is a little annoying.

    The implementations of most of the Enumerable extension methods are fairly straightforward.

    Query is important, and LINQ to Objects is great. I love it! But, as we'll see with PLINQ and the TPL, the functional programming constructs that enabled LINQ to Objects are capable of much more than that.

    I don't see how Volta is relevant to your point.

  • User profile image
    esoteric

    JChung2006 wrote:
    

    I see LINQ to Objects as an application of the functional programming constructs added to C# 3 and VB 9, constructs which JavaScript already had.  LINQ to Objects' power and expressiveness come from those constructs, not from LINQ to Objects' application of them.  I like the new syntax, too, but the inconsistency of the syntax between C# and VB is a little annoying.

    The implementations of most of the Enumerable extension methods are fairly straightforward.

    Query is important, and LINQ to Objects is great. I love it! But, as we'll see with PLINQ and the TPL, the functional programming constructs that enabled LINQ to Objects are capable of much more than that.

    I don't see how Volta is relevant to your point.



    The point of Volta is this context is twofold

    1 - It is possible to use C#/VB/_
    2 - It is possible to use the special LINQ syntax(es)

    Some people don't see it, but yes, Javascript is a kind of dynamic functional programming language. The difference of course is that the "var" in Javascript is truly dynamic and cannot not be static whilst in C# it really is as static as possible - meaning as static as the right-hand-side reveals - so unless the value is cast to a less specific type, i.e. object, the left-hand-side type will be specialized to the max, so to speak.

    I think the combination of static safety, the LINQ to Objects and the LINQ syntax is key. Not that I don't like Javascript. I have done a lot with it but I hope the static languages get more dynamic features so we can get dynamic-when-needed and static-where-possible as a certain Meyer has more-or-less put it.

    Not sure where we disagree, except that you seem to like Javascript as is. And perhaps that I don't see how your distinction between the power of a construct and the power of its application as particularly meaningful.

    But the new constructs enable other things than LINQ as they should. They are part of a general purpose language after all. TPL does look like a very good mid-term solution to parallelism. Long-term, who knows.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.