Search Unity

Xamarin now free (and supposedly open source)

Discussion in 'General Discussion' started by Acissathar, Mar 31, 2016.

  1. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    I've just tried il2cpp on Android. Just basic scenario: tiny helloworld project with a button that throws exception. The build time was over 6 minutes for a couple of scripts and no graphic assets. Compared to few seconds on Mono 2 backend. And `Debug.LogWarning(ex.StackTrace);` produces empty string in `adb`. No exception stack trace, can you imagine this?

    It's great that il2cpp makes the life easier for developers supporting the bazillion of platforms. But it also would be nice if it made the life easier for users.
     
    Kiwasi likes this.
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    6 minutes sounds a bit excessive. Android IL2CPP is still in experimental state, and incremental builds are not supported yet. Stack traces don't work either.

    Do you honestly believe that the advantages that IL2CPP allows us to achieve don't make user life easier? Stuff like upgraded .NET profile, better performance, higher code protection?
     
  3. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    But they will, won't they? I'm just impressed by your recent article on debugging, and I'm afraid very much to encounter such issues in production with no managed exceptions available.

    “.NET profile upgrade” is the main thing that makes me F5 Unity blog page awaiting for news on it. But I'd rather prefer standard Framework (.NET/Xamarin) than brave new tool chain. I'm usually enthusiastic on developing of new transpilers, runtimes and so on. But at the moment I'm a little bit sceptical on necessity of il2cpp and its reliability.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    They will be. Stack traces work on some IL2CPP platforms (iOS, Windows Store, XBOX One), just they weren't implemented on Android yet.

    I've listed all the reasons before in this thread why a .NET profile upgrade cannot happen without IL2CPP.
     
    Ryiah likes this.
  5. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    This. Again...
     
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Xbox One supports IL2CPP builds now? Is it optional or always IL2CPP?
     
  7. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    It's sad how many times this comes up as a defense of Unity.
     
    Qbit86 likes this.
  8. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Because it was yesterday when I've read about Xenko first time. It looks immature, with small community. But I'll consider moving there after investigation.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    You can choose between IL2CPP and Mono. It supports it since 5.2 if I remember correctly.
     
    Ryiah and Dustin-Horne like this.
  10. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    So quick question, there's a bug that's been reported by two of my customers, any built in Unity3D struct types (Vector3, Vector2, Vector4, Matrix4x4, Quaternion, Resolution, etc) are failing to deserialize with my asset with AOT errors but only on Xbox One. I think the first time this was reported was over a year ago... I've worked around it by creating custom converters. Do you know if this issue also applies to IL2CPP on Xbox One or is it strictly the Mono implementation? The second customer reached out to the xbox team a week ago... I don't have either bug number.
     
  11. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Not even remotely true. Every 1 or 2 person team making small mobile games, maybe. And now that Xamarin is free (the topic of this thread), that's going to change. UNLESS Unity steps up their game. But it seems the Unity Defenders would rather keep the status quo and not have Unity improve itself.
     
    Qbit86 likes this.
  12. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    It's not an attempt to defend Unity. If any game engine were to fail to meet my needs then I would use another. It isn't like I'm not always investigating the competition either. I have Unreal 4 and CryEngine V on my computer right now.

    Once again why would you stick to an engine that failed to meet your expectations if the competition is able to?
     
    kB11 and angrypenguin like this.
  13. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Who knows, maybe your feedback could change something?
     
  14. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Except the feedback taking place right now won't. Unity will continue progressing along with IL2CPP.
     
    hippocoder likes this.
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    It's probably mono. IL2CPP doesn't have any of the Mono AOT problems when it comes to generics and structs.
     
  16. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Come on now. A person mentions one thing in a competing engine that they think is an advantage over Unity, and you think they should switch engines?

    It's not hard to come up with reasoning why someone might not drop everything and switch engines as soon as they find something they don't like about the engine they're using.
     
    Qbit86 likes this.
  17. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    So the whole topic is irrelevant to Unity: Xamarin is free now but this won't affect Unity in any way because they're making their own CLR replacement.
     
  18. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Why do you feel like they should continue using an engine that isn't meeting their needs?

    I can understand if you're mid-project and cannot afford to switch, but at the same time I've known people who have.

    Right, because the path of IL2CPP is somehow completely detrimental despite statements of the opposite from the Unity developers themselves.

    Last time I checked the Common Language Runtime was but a single part of the Mono framework. Xamarin being free is definitely an advantage to them but it isn't sufficient by itself. Thus why development of IL2CPP is continuing.
     
  19. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    You know, switching an engine may require switching the employer. My personal need — is to be satisfied while programming. And I'm revisiting trade-offs.
     
  20. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Or it could involve convincing them to switch engines for future projects.

    Fortunately in the long term it this whole discussion will be moot. We'll have both IL2CPP and newer framework releases.
     
    Qbit86 likes this.
  21. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Good I'll have him give it a try. It wasn't all structs by the way, only the structs in UnityEngine that were causing the problem. We could create our own structs that mirrored the structure and they would work just fine.
     
  22. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Yes, I can try this too :) Unfortunately product owners tend to be conservative.
     
  23. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Who said anything about not meeting needs? Pointing out an advantage of another engine doesn't automatically mean Unity isn't meeting basic needs. Why didn't you discuss the point (that cross-platformness could be considered a drawback)?

    That's not what I meant. But since you mention it, here's a relevant post from a Unity developer:

    Which suggests that if there were fewer platforms, specifically just the platforms that Xamarin already supports, a .NET upgrade could happen sooner and without IL2CPP.

    I'm not saying I think they should do that. But for me, a .NET upgrade is far more important than support for Tizen and Smart TVs.
     
    mrtkhosravi and Qbit86 like this.
  24. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Yeah, who even play games on smart TVs (which has to be most inconvenient thing to do by the way). And Tizen? I've never seen any smartphone or tablet with it. Even Samsung, which is one of main companies developing it is using Android for their every popular product, like Galaxy devices.

    Also, since xb360 isn't produced anymore, support for it could go away as well.
     
  25. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Do you mean “NIH syndrome”? ;)
     
  26. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    How about WebGL? Did you know that both Smart TVs and Tizen use HTML5 for applications? Support for those esoteric platforms may seem unusual but it isn't that strange once you realize that the majority of the effort in supporting them is covered by supporting WebGL.
     
    Last edited: Apr 27, 2016
  27. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Yeah, the web platform is important for a significant number of us.

    I don't care what web technology is developed. I just want it so my games can be played in web browsers. Preferably without the user needing to download anything.
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    What about consoles and WebGL? Tizen and Smart TVs are not the only platforms that we support that Xamarin doesn't.
     
  29. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    That's splendid news. Will unity upgrade the mono version to the latest soon? Please say yes.
     
  30. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    “So the whole topic is irrelevant to Unity: Xamarin is free now but this won't affect Unity in any way because they're making their own CLR replacement.”

    Opensourcing Xamarin doesn't change anything: il2cpp completion is still prerequisite for updating compiler and libraries. And it won't be shipped until it's completed for all of supported platforms.

    Until then please enjoy your massive cross-platformness while waiting for unknown ETA.
     
  31. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    WOW! Now that mono 4 is available for free, how IL2CPP development is justified? Xamarin is now part of Microsoft and that clears every doubt about trusting into it. So Unity still wants to go its own direction?

    I mean OK, IL2CPP was a good move when UT was stuck with mono 2.6.5 and its horrid performance. But when a modern version of mono is available that is open source, widely used and properly tested and reliable what makes IL2CPP, a new, immature, proprietary technology a better investment? Is it proven that IL2CPP has better performance than mono 4?
     
    darkhog and Qbit86 like this.
  32. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Here is a summary by Tautvydas: http://forum.unity3d.com/threads/xa...osedly-open-source.395040/page-3#post-2580763
     
    mrtkhosravi likes this.
  33. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Why do you people keep repeating the same questions when they have been answered several times and by Unity people?
     
    Kiwasi, hippocoder and angrypenguin like this.
  34. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
  35. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    They were too lazy to read the whole thread.
     
    Kiwasi and mrtkhosravi like this.
  36. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Not all of them (at least for me).

    “Interop performance”? Have you read “10000 UPDATE() CALLS” blog post? Some people dismiss using Unity `Update()` at all for their scripts, replacing them by virtual `MyUpdate()`; so there is the only call to Unity `Update()` in `MyGameLoop` script, which invokes the list of `MyUpdatable`s. That's just to avoid interop calls and marshalling on every update. So maybe it's better for engine to move some logic to managed side? In this case moving from native to managed can actually boost performance, even if it sounds paradoxically. It is not Mono fault that there is so much interop in Unity Engine. As far as I understood, there are no such issues in Xenko.

    “Stability” and “Maintainability and customizability”? Does this relate to 8-years-old Mono or to up-to-date Xamarin?

    “Managed code performance”? What if a lot of people are just satisfied with current performance? More over Xamarin may improve this. And il2cpp implies actually worse build time. At least because compiling C++ is much slower than C#, absolutely regardless of actual compilers: Clang, Microsoft, GCC vs. Roslyn, Mono, etc. And this time is added to compiling C# to IL. Not mentioning intermediate conversions on the way from IL to C++.
     
    Last edited: Apr 27, 2016
  37. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Interop performance problems are caused by the overhead of two or more frameworks communicating. Unity has it because the core engine is written in C++ but the scripting is C#. Xenko doesn't have it because it's written in the same language it uses for scripting.

    Yes, that's an alternative to IL2CPP, but you'll lose the performance boosts brought by IL2CPP.
     
    Last edited: Apr 27, 2016
  38. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    I understand this. Core engine being written in C++ does not sound as advantage for me. It can gain more performance, but loses it for interop. It doesn't make much sense for me to go to native code for every API call.
     
  39. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Right, but IL2CPP eliminates the interop performance penalty in addition to giving you higher performance due to C++. Yet again it's a matter of short term benefits versus long term benefits. Short term of adopting the path Xenko took is you'll have the framework updated sooner but you'll lose the long term performance boost of IL2CPP.
     
  40. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    It's a long thread, you know.
    I'm interested to read that.
     
    Qbit86 likes this.
  41. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    I just mean, that mentioned reason is not Mono drawback, but rather consequence of architectural decision. And adding C++ by itself does not guarantee noticeable performance boost.

    I'd prefer Unity to just plug in Xamarin to those popular platforms where Xamarin is available. Instead of solving artificial design problems, which don't actually bother me as user that much. (They are good to be solved but not by sacrificing the overall usability and time.)
     
  42. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Just open each page and scroll down till you see the Unity developer tag. ;)
     
    Kiwasi, mrtkhosravi and Qbit86 like this.
  43. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Except it isn't simply adding C++. It's replacing the portion that requires interop with one that does not. Additionally you have to take into consideration that C++ compilers are extremely good at optimizing code.
     
  44. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    And extremely slow.

    Actually, we already use il2cpp (have to) for iOS edition of our game. (I'm focused on Android and WSA versions, so don't know all the details.) My colleague say they didn't notice any significant performance boost, on the other hand they didn't measure it explicitly. I don't deny probable performance gain, especially after polishing il2cpp; just don't tend to overestimate it.
     
  45. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Only at the compiling stage.
     
    Qbit86 likes this.
  46. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    At some point, it has to go to native code anyway. Unity will never be rewritten to be a pure C# engine.

    Both.

    Some people are content with python performance. That doesn't mean that improving performance, especially in game related scenarios, isn't desired by others: the less time you spend in scripts, the more time you can spend rendering.

    May or may not - it's outside of our control, which by definition means we cannot depend on it.
     
    elbows likes this.
  47. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Doesn't joining .NET Foundation mean possible cooperation in development of Xamarin? Pull requests and so on?
     
  48. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Cooperation? Sure. Many man years to rewrite their codegen to be on par with IL2CPP? That's unreasonable to ask of anybody.
     
    Kiwasi likes this.
  49. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    How does IL2CPP compare to .NET Native? I know .NET Native is specific to UWP, but it does seem more mature and stable. I was curious as to whether it could be used to improve IL2CPP.
     
    Ryiah and Qbit86 like this.
  50. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    Interesting, how Xenko managed to utilize Xamarin on Android as is, without rewriting codegen. Cannot find time to try it :-` Maybe on weekend.