Search Unity

Isn't IL2CPP a hugely valuable piece of technology outside of Unity?

Discussion in 'General Discussion' started by techmage, Mar 11, 2015.

Thread Status:
Not open for further replies.
  1. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    So if the benchmarks are true about IL2CPP, that it can run some algorithms over 10 times faster. If properly packaged, and sold with the proper tools for it's use and integration. Doesn't that mean then that it could be a killer tool in the enterprise .NET server world? The ability to migrate select functions to IL2CPP in a server system and gain 10x+ the performance? It's basically the equivalent of Facebooks PHP HipHop only for C#.
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I think that Microsoft are working on something for that with .NET Native or something along those lines.

    I think it took so long because, broadly speaking, the kind of thing you write in .NET isn't the kind of thing typically bottlenecked by CPU code execution performance. Edit: And being .NET, there are options to integrate other things where that kind of performance is important. But of course having this kind of tool available now is a big plus.
     
  3. R-Lindsay

    R-Lindsay

    Joined:
    Aug 9, 2014
    Posts:
    287
    Where did you see 10x speed improvement on selected algorithms quoted?

    I read 2x-3x on selected scripts here http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/

    I would love to see what kinds of things are 10x slower in C#.

    Edit I'm not disagreeing or being sarcastic. I really would like to know what kinds of algorithms this is exceptionally good for.
     
  4. bigdaddy

    bigdaddy

    Joined:
    May 24, 2011
    Posts:
    153
    R-Lindsay likes this.
  5. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    It's not as huge as the existing LLVM framework. IL2CPP is very focused on UT's needs, while LLVM would be a more generic solution. It's supposed to be very easy to add another language to Clang, generating native code straight away without intermediate steps.

    IL2CPP is a Unity thing, and will most likely remain that. I just hope it means we get neat features like dropping in the C++ equivalent of scripts we wrote before or instead of dynamic libraries, and that all platforms will have natively compiled code as an option for publishing.
     
  6. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    As has been pointed out here, others, like Microsoft, are building solutions with goals aligned with what you describe.

    While IL2CPP could be directed to become a similar solution, that would take away from its Unity-integrated value.

    As an integrated solution, Unity is able to add target-specific optimisations like platform-specific GC behaviour, engine API integration optimisation (simple example: why do a virtual call when you can link directly?), and even per-component custom allocation and behaviour dependent on where that component is used (probably far down the line though). Plus all the opportunistic stuff you come across as you work on both sides of the divide.

    Pursuing a second goal for the project would not only make implementing these optimisations harder, but also take development time away from their implementation.

    Even if it was decided to pursue this anyway, it is highly doubtful that it would make much business sense in the end - let alone provide meaningful consumer value, given the presence of the before mentioned alternative solutions.
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Il2cpp might indeed be very valuable outside of the Unity context, and we have been discussing this. Opening il2cpp is something which might happen indeed some day (or not), but it is not as easy as it sounds. There are some points to consider, such as how we could possibly license it (which includes considerations about redistributing third-party code used in il2cpp), and figuring out how would we feel about our competitors using the fruit of our work.
     
  8. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    To be honest. I look at this as a way of securing .net code, at least at the UT level. For example, say I have an asset that I want to sell on the asset store. It's a .net dll providing some functionality. even obfuscated, it's relatively easy to reverse.*However*, it occurs to me that the IL could be read, converted into cpp and 'baked' into the executable upon compilation, thus potentially providing more security as well as reduce the headaches of deployment. It also allows the possibility of code/build once for many platforms. even if it was written in .net it could be 'baked' into an executable for Mac etc.. right now I couldn't take a .net dll/code and deliver to osx natively. They would have to host it.

    To be honest, dunno why this isn't being done now.. it would also allow us to use the full .net (4.X anyone?) And get rid of mono altogether. Downside would now be that UT would now be in the compiler business as well..

    Edit: we would have to have complete faith in the conversion as well to make sure that something nasty was introduced into the compilation. .
     
  9. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    Patents can be a wonderful thing ;)

    Just think about it in reverse: how would your competitors feel about supporting UT? ;)

    If you have the patent they have to pay you, plain and simple. Hehe so 'powered by Unity IL2CPP' on an Unreal splash screen anyone?

    Lol ;)
     
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    You make it sound like the concept employed by IL2CPP was invented by Unity, but the concept is pretty much identical to how the backend for a compiler works.

    Basically a compiler is divided up into two stages. The first stage, or frontend, works by converting the code you've written into an intermediate bytecode. The second stage, or backend, takes this intermediate bytecode and converts it into native machine code.

    Essentially Unity has written a new backend for Mono's compiler.
     
    Last edited: Mar 12, 2015
  11. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    I absolutely know how a compiler works. What my tongue in cheek comment pertains to is their implementation. .

    We're not talking about concepts here. We're talking about actual functionality, which is patentable..
     
  12. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    Which was my point. Why limit it to Mono? If you have the ability to read IL then it could be used on regular .net assemblies as well..
     
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Only if someone else hasn't patented it first.
     
  14. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    So are you just being argumentative? Of course if it hasn't already been patented.. which the assumption is, that it hasn't. ..
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    No, I'm pointing out the flaws in your reasoning. You also have to take into consideration the concept of prior art. Is this concept already known and are others making use of it? The answer is dependent on whether or not other compiler backends are close enough to IL2CPP to qualify.

    http://www.epo.org/learning-events/materials/inventors-handbook/novelty/prior-art.html
     
  16. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    Just so that we're clear: concepts aren't patentable. *Implementations* of those concepts *are*. When sitting with a patent attorney you have to not only show the complete implementation but do a search first to see if it infringes. If it does not, then they attorney could also ask for the source code in escrow for a period of time to refute claims etc..
     
  17. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    We're not talking about art or assets or models. We're talking about code..
     
  18. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    http://en.wikipedia.org/wiki/Prior_art
     
  19. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    How ignorant I am? Who the hell are you Again? Are you a patent attorney? Ever patent anything? No? Then just stop..

    And btw? If someone creates a game about an ork, does that mean that no one else can make a game contains an ork? Of course not. That *particular* ork? Yes.
     
  20. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Are you? :p

    Are we talking about an orc or an ork?
     
  21. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    No, but I *have* been deposed for patents which I created.. you?

    Yeah, didn't think so.. go troll elsewhere..
     
  22. bigdaddy

    bigdaddy

    Joined:
    May 24, 2011
    Posts:
    153
    That's copyrights, not patents.

    They are 2 different things.
     
    Ryiah likes this.
  23. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
  24. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    It was a metephor for the code we were talking about..

    For example: I create a compiler that converts IL code to cpp. Someone else does it as well. As long as I don't infringe on their implementation I can write and patent that implementation. .

    another example: images, specifically the gif format. In concept it's still just an image. Technically though *how* it's displayed and it's format and compression *is* and *was* patented..

    Copyright would cover if you have the permission to use it. The patent provides protection in the case that you made an alternative for example, and called it something else, but implementation-wise was considered close enough to be actionable..
     
    Last edited: Mar 12, 2015
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Cool, well. It's not happening in the near future, and people are just arguing semantics, so you can perhaps take up a hobby like game development instead. To assist in this, I've locked the thread.
     
    Marionette and Ryiah like this.
Thread Status:
Not open for further replies.