Won’t this invalidate IL2CPP?
https://www.dotnetfoundation.org/blog/announcing-llilc-llvm-for-dotnet
Are there any plans to transition Unity to this?
Won’t this invalidate IL2CPP?
https://www.dotnetfoundation.org/blog/announcing-llilc-llvm-for-dotnet
Are there any plans to transition Unity to this?
How many platforms does it support?
Note that it’s aimed at the .Net Core technology platform and Unity is currently using legacy .Net
There was some discussion on this in the other thread. Unity’s opinion seems to be that they are “almost ready” with IL2CPP so they’re going to keep on keepin on. Consensus seems to be that we should wait a year, and if at that point Unity’s still only “almost ready” but MS and Xamarin are out and battle-tested with things like LLILC, they may give it a look.
It’s more complicated than simply being “almost ready” with IL2CPP though. Since no one deemed it important to respond to my earlier post I’ll mention it in more depth. Unity currently supports about two dozen platforms. Any worthwhile replacement for IL2CPP has to support a similar number of platforms.
LLILC is not battle-tested but even if it were a rock solid solution… it only supports a single platform. One platform a year after it was announced is not impressive in the slightest. By comparison IL2CPP is considered to be “almost ready” and supports multiple platforms only two years after it was announced.
IL2CPP only supports Apple and WebGL, and neither are particularly great at the moment IMHO. All of the other platforms are still using Mono, except WinPhone/Store which is using a devil hybrid of MS .NET and Mono.
Right, I said if in a year, clearly LLILC’s not battle tested yet. But it is being developed by MS and Xamarin, who I trust with core .NET features more than Unity. And it’s not just “a single platform”, it targets “CoreCLR” which is the base cross-platform component of the new open source .NET, so it currently targets anything that CoreCLR targets: Windows, Mac, Linux, iPhone, Android, and WebGL as far as I know. That’s most of Unity’s platforms. I don’t know if there are PS4 and XboxOne specific CoreCLR ports but they should be similar to the Windows and Linux ports and I’m almost positive MS will have Xbox-specific builds at some point.
It supports Android per a dev post in the thread @Ostwind posted. Just not beyond a beta state at this point.
https://github.com/dotnet/llilc
Right, by a company that has a poor past record when it comes to platforms they don’t own.
Both the blog post and Github make mention of the fact that it only supports Windows right now.
No offense, but the lack of a .NET upgrade has been a sore spot for me for the last decade since Unity first was “almost done” figuring out how to do it, so I’m probably going to take their advice and wait a year to see how it turns out, rather than arguing about why it would make more sense to use the free open source frameworks backed by the actual developers of .NET rather than making their own. If it all works out like they plan, and IL2CPP is super amazing and better than anything Microsoft or Xamarin could dream of, then hey, I’ll admit I was wrong and will be happily using the world’s best .NET platform that is for some reason a closed source game engine. If not, then next year I’ll continue this argument with you.
None taken and I’m definitely in agreement. I want a .NET upgrade too.
Be prepared for disappointment. At least that’s my advice. Back when they announced IL2CPP I quickly came to the conclusion that if it were a very solid path to take then the other companies were bound to do it too. I’m not expecting it to beat the solution made by the competition but I’m not expecting Microsoft or Xamarin to necessarily be better either.
Sounds like we’re in agreement then. I guess my beef with the whole thing is that I don’t think there needs to be a thing that converts IL into C++ at all. There were two reasons they started down this path: 1) They needed to update Mono but couldn’t because it wasn’t open-source-enough on iPhone due to LGPL and they didn’t want to pay Xamarin for a license upgrade, and 2) They wanted to support WebGL, which at the time didn’t have a lot of support, so they decided to use asm.js and Emscripten which required them to somehow get C++ code out of IL code.
Now, reason number one is no longer an issue due to Xamarin and MS becoming open source, and number two is no longer as much of an issue due to tools coming out for WebGL that just directly convert C# or IL to asm.js. Converting to C++ as an intermediary step now just seems needlessly complicated and an unnecessary possible point of failure in the compilation step.
Edited to add: I know they’ve said there are performance tricks they can do by having the C++ code directly linked to their engine somehow, but I will believe that when I see it…
I made this thread with a question but really, it does, it completely invalidates IL2CPP.
If you understand what LLVM is, do some reading on it, it is the ultimate solution. It’s not just a research project either, LLVM is already used in prodution. All of Apple’s technology rests on LLVM. Objective-C compiles to LLVM, swift compiles to LLVM. Microsoft is moving to using LLVM too. Android is moving to using LLVM too.
LLVM is the new compiler. It is replacing GCC.
But the thing is LLVM is not just a compiler, it is an intermediate language and a compiler. LLVM calls it Intermediate Representation or LLVM IR.
So Swift compiles to LLVM IR, it then compiles that to machine code.
So the idea is that all languages can now just produce LLVM IR, then automatically gain cross platform capability, as there is a LLVM compiler for most platforms, and eventually there will be for every platform as it is replacing GCC in the industry.
Currently on iOS, when you build Unity you are doing this.
C# > IL > CPP > LLVM IR > Machine code
This is going to be the case for every platform over the next few years, and eventually consoles too. LLVM is going to be their C++ compiler, meaning their C++ will just produce LLVM IR. Then LLVM compiles that to machine code.
What LLILC means is that we can now do this:
C# > LLVMIR > Machine Code
Meaning C# compiling will literally have as many steps to machine code as C++ does. Meaning C# can literally be as fast as C++, Swift, or anything, it can literally then be considered a “compiled language” comparable to C++ and C. Although really with the advent of LLVM the terms ‘Compiled’ and ‘Managed’ are going to become irrelevant. All languages will just be LLVM languages.
BTW, Emscriptem, which Unity WebGL uses, it actually takes LLVM IR internally. So currently it goes:
C# > IL > CPP > LLVM IR > ASM.JS
Could be:
C# > LLVM IR > ASM.JS
Right, for a single platform. That’s the part you’re apparently missing. LLILC only supports Windows right now.
Its not only supporting platforms. It also has to be easy to port to a new platform. This is just as important.
One of Unity’s strengths is how quickly it gets to new platforms. Often even before the hardware gets to devs. Plenty of devs I know that use Unity for exactly this reason.
It currently runs on linux and windows. It’s in development as a core .NET tool, eventually it will run on everything.
It is still a year or so away.
As said above, it also has Android support down the pipe. They’ve also said that there is a desktop version that has been around for ages, but since it provides the least benefit they decided not to release it until it stabalizes on platforms needing IL2CPP more.
IL2CPP is honestly exceeding expectations. All issues with it have been fixed in timely manners, and at this point, from looking through the logs, the only issues remain with some extreme corner cases.
Let’s take a moment to appreciate the size of Unity’s code base, and realize that any code base of this size does not turn on a dime; and in this case, there really isn’t even a reason to try.
For what it’s worth, IL2CPP also supports Windows Store Apps, and most (all?) of the console platforms that we currently support.
EDIT: And note that a large part of the work is not in emitting machine code, but in providing a runtime library that works with the platform. Simply compiling C# code to assembly isn’t much good if there is no runtime to do stuff like garbage collection.
People keep suggesting that Unity integrate Microsoft and Xamarin solutions, but I feel like they have it backwards. Those companies should be licensing IL2CPP from Unity.
That’s probably just as dumb. IL2CPP is built for real time games. And would probably do poorly on regular UI applications.
Doesn’t it simply convert IL to C++ prior to compiling it into native code? I’ll admit I’m not knowledgeable about compiler architecture but I wouldn’t think it’d be too dependent on the engine itself. Might be optimized for it though.