Hacker News new | ask | show | jobs
by TillE 4602 days ago
Unity really desperately needs a Mono upgrade, as their version is years old. Unfortunately it seems to be a licensing issue with Xamarin, because of LGPL constraints on mobile platforms.

It's quite frustrating to work with C# without all the features of the last few versions, particularly if you want to use third party libraries.

5 comments

Agreed. It's starting to become a bit of an issue, particularly, like you said, with third party libraries.

It's one thing if you're a major version behind (unfortunate, but manageable), but 2.0 was 5 years ago. That's not a major version, that's practically an entire generation.

Also, lack of compute shader support for anything other than Windows and DX11 is a bit of a drag. Compute shaders are really the future of development and it's a bit of a pain not to be able to use them without going through a number of hurdles. This should be fixed eventually though, I'd imagine.

Hopefully they figure out a better way to handle all their platforms equally, at least for development purposes. Being held back on the desktop just because Unity can deploy to mobile is, again, a bit of a drag. I'd rather have the option.

AFAIK, compute shaders only became available in D3D11 and OpenGL 4.3. MacOS was stuck on OpenGL 3.2 for a long time, and even the latest version only supports 4.1. On Linux, Intel and open source drivers (Mesa) only reached OpenGL 3.2 support last month. So that leaves proprietary drivers from AMD (4.3) and Nvidia (4.4) + D3D11 on Windows. I don't know much about mobile platforms but I don't think they support compute shaders.
You're right. It still sucks though. :)

AFAIK you can do OpenCL on OSX with Unity, you just don't have the typical Unity integration so you'd have to handle all the details yourself. It's on my list of things to try out soon... the switch to general purpose GPU processing is too large of a revolution to ignore.

I mostly program C# inside of Unity. What are some of the newer C# language features that it's missing that you think are pretty cool?

I have my game server as a C# MVC app as well (latest .NET running on Windows, not Mono/Linux) and the only things new that I seem to be using are the async and await keywords. But you don't need them inside of Unity since they have Coroutines and yield.

I can't speak directly to the differences with Unity, but comparing C# from .NET 2.0 to the latest you're missing: LINQ, dynamic data types, extension methods, optional and named method parameters, covariance and contravariance, async and await... and a whole bunch I'm probably forgetting. It's a lot more flexible now and lets you take advantage of dynamic/functional code. After coding in 4/4.5 for awhile, I certainly wouldn't want to go back to a 2.0 ecosystem.
Extension methods work (I use those all the time), and async and await are unnecessary because Unity gives you coroutines and yield.

The rest of that stuff seems cool though. Oh well =\

Yes, they posted on their forums about the licensing issues:

http://forum.unity3d.com/threads/197948-New-version-of-Mono-...

Of course, I find it somewhat amusing that licensing is what prevents Unity from upgrading their C# support, since licensing the Unity source code is something that is also very difficult:

  We license Unity source code on a per-case and per-title
  basis via special arrangements made by our business
  development team. As this can be quite expensive, we do
  not generally license source code to smaller operations,
  educational institutions, nor to companies in countries
  which do not have adequate legal intellectual property
  protection.
http://unity3d.com/unity/faq
It's especially frustrating because ClojureCLR won't run on such old versions of Unity. I spent a good three days trying to backport all the necessary library code and eventually gave up. I was really hoping to get a decent interactive environment working with Unity.
Never used Clojure but Boo has pretty good support for this, including an interpreter and repl hook.

The compiler and parsing pipeline is exposed, there is an interpreter built-in, you can hook into the assemblies, etc. I have a console in my game that does input/output from a Boo interpreter and it is exposed to everything in the game scope with no real extra effort on my part.

Only took a few hours to set up, most of which was spent either writing a UI for it or sorting out some compatibility issues (Unity doesn't come with a copy of Boo.Lang.Interpreter).

It's pretty sweet.

Which might be why this version of Unity updates to MonoDevelop 4.0.1.
MonoDevelop != Mono. MonoDevelop is a standalone application, the default Unity code IDE. No doubt an improvement (at least for folks who don't switch Unity to another editor entirely), but not a change in the Unity C# runtime.
Checking the forums, it's indeed only an update to MonoDevelop. I stand corrected.