Search Unity

Linq not supported, ever try Finq?

Discussion in 'Developer Preview Archive' started by Antitheory, Dec 23, 2011.

  1. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    I've used Linq quite a bit in some Unity projects. I liked it so much I looked for something similar for Flash in AS3.

    I found this great library here for AS3 called Finq. Maybe the Unity team could look at something like this to translate our .NET Linq code into AS3 for the Flash export. Also since AS3 has support for anonymous functions, I don't see why we cant keep our .NET lambda expressions too.

    Anyone care to enlighten me?
     
  2. AntonioT

    AntonioT

    Joined:
    Feb 3, 2010
    Posts:
    17
    I don't know AS3 at all.

    What I will say, is that not all languages with anonymous methods can necessarily express them as Lambdas. Even .net was using anonymous method constructs before lambda expression syntax.

    Also Linq works using Lambdas with Generic signatures and with Extension (Decorator) methods.

    So the language would need to be capable in all those regards to create a syntactical and functional equivalent to Linq.
    Having said that, I think anyone who uses Linq (myself included) would feel severely crippled without it at hand.

    I must be honest though, I still don't see the benefit of using flash. I would far rather deploy in unity for the web. Flash is platform limited, especially in the mobile world which now IS the majority of internet traffic.

    Perhaps I'm missing something myself ?
     
  3. Lucas Meijer_old

    Lucas Meijer_old

    Joined:
    Apr 5, 2008
    Posts:
    436
    Lambdas already work. Linq to objects will probably added later on, it's not at the top of the list right now though. Fwiw you can use resharper to autoconvert Linq statements to for each loops.
     
  4. Cameron860

    Cameron860

    Joined:
    Jun 1, 2009
    Posts:
    814
    I though it was pretty obvious. Flash is (weather you like it or not) truly ubiquitous. If you're targeting a game portal website sure, go with the web player plugin, but now with a flash target Unity is much more attractive to all sorts of other applications and wider audiences such as movie/product promotional websites where "needing plugin x" would have excluded it in the past. There was also no Linux version of the web player.

    It's not likely to replace the web plugin any time soon, but it's a good start. Think of it as having a "lite" web player of unity pre-loaded on 98% of machines. Also, you now have at least some way to get Unity content running/playing on Linux. You could even deploy though Zinc straight to the Linux desktop: http://www.multidmedia.com/software/zinc/
     
    Last edited: Dec 23, 2011
  5. AntonioT

    AntonioT

    Joined:
    Feb 3, 2010
    Posts:
    17
    LinqToObjects has been working in Unity for some time now already ?

    Isn't the question here about the implementation of a Linq equivalent in AS specifically ?
     
  6. AntonioT

    AntonioT

    Joined:
    Feb 3, 2010
    Posts:
    17
    @Cameron - Yeah I hear you on the already installed on 98% of machines line. Totally valid.

    I suppose what I'm getting at is that right now Unity's install is as seamless as flash and probably quicker. You arrive at the site, click on the install and run the player.

    I mean my flash updates take longer to click through than a new unity install which almost never needs any update. From a user experience perspective Unity just seems so much slicker than flash. It almost feels like a hassle to bother with flash.
     
  7. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    I would rather not export to swf at all. The trouble is that I am in a line of business that has a paranoid dinosaur for a client. Convincing certain institutions to install a new plugin across their networks could take years of review. Meanwhile the client demands the latest and the greatest. It's ridiculous, but it's business.
     
  8. AntonioT

    AntonioT

    Joined:
    Feb 3, 2010
    Posts:
    17
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    They can't be that dinosaurs though because otherwise you won't be able to target flash either cause that requires installation of Flash 11+ too, a new plugin as well compared to the Flash 6-8 'dinosaurs' have installed ;)
    And I am really worried about this business attitude. Its fine to install and upgrade a plugin for a technology that for years has been known to be one of the biggest security threats on the web, but its not fine to install military certified plugins ... thats like saying sniffing cocain is fine but smooking tabac is illegal


    But I agree, if Flash is intend to remain there for more than a '2012-2013 bridge before it dies' then linq or something comparable needs to be added even if unityscript can't use it ;)
     
  10. npsf3000

    npsf3000

    Joined:
    Sep 19, 2010
    Posts:
    3,830
    I still get regular crashes from the unity web player - it's nice... but it's not perfect yet and that will hinder uptake.
     
  11. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Tell me about it. Worse still, my client wants us to use Anark for 3D delivered on their network. It's utter crap, but they were wined and dined I guess. Anark only runs in IE as an ActiveX plugin (with command-line access, neat!) Also you have to pay $10,000 per project for their "SDK" license, without which you cannot open URLs or send commands to javascript.
     
unityunity