D in Unity?

Does Unity plan on integrating the D language, cause from what I’ve learned D should be the be all, end all of programming languages. Just curious as to if Unity has plans for it or if C#, JS, and Boo is the end.

2 Likes

No language will ever be the end of programming languages. I haven’t heard any news or discussion of languages changing.

From a quick scan of the wiki page it appears D’s main advantage over C# is the access to low level processer commands. I’m not sure how practical this would be in Unity’s multi platform environment. I could be wrong here.

However D can be compiled into IL for .NET. Therefore you can already use D in Unity, if you really, really want too.

Thanks. Don’t know much about D, read a couple articles this morning on it, and thought it sounded much better than C# than just being able to access processor commands. Should have read a little bit more on it I guess. Thanks.

Removed - redundant.

You’re redundant.

I removed my post because it was redundant. (a bit edgy there)

Easy Tiger.

Redundant means he said something that had already ben said. No comment on your post at all.

1 Like

I’m very interested. By “you” do you mean the developers or the end user? What (feasible) efforts need to be done by the end user like me?

Thanks @Kiwasi I thought you meant an alternative to C# scripts that you attach to GO’s. Those dll’s can’t access Unity API which renders them useless as a replacement.

Hmm… from the page:

Sure they can. You just need to link them to the Unity dlls.

Its not path I would recommend. Surely learning C# has to be less painful. But its a possibility.

1 Like

This is me failing epic :slight_smile:

@Kiwasi Oh, but for me C# is a large crater in the butt, too cumbersome and paradoxically at the same time limiting, compared to C++ (or D). I’ll dedicate some time trying the D way. BTW, I suppose C++ is out of the question as it can’t be interpreted.
Please, if you know of, point me to some tutorials or documentation on how to compile D scripts to work in Unity or at least where to go from here. I’ll try to make it worth your while if I get to use D instead of C# scripts (MB’s and SO’s) and be able to use them 1 for 1 (i.e. attach the D MB’s to GO’s in inspector, having its fields showing in Inspector, etc.).
I could find this but it’s still a long way:

Um, just keep one thing in mind: Suppose you get D compiling and working and all that.

Then you run into a problem. Where do you turn to for help?

2 Likes

Any language that can be compiled to IL will work.

But, regardless of which language you write your scripts in, you still have to compile them to IL for the mono/.NET environment. So you’ll likely hit the same limitations no matter what language you use. You won’t be able to use any cool features that don’t exist in the framework.

OP, if you’re looking for day to day use of Unity and choosing a language, the most sensible choice is C#.
:slight_smile:

1 Like

@Kiwasi the whole point of using D instead of C# (for me at least) is not targeted towards high level kind of features (mono, linq or alike functionality built on top of bare syntax). I’ve noticed that C# general mindset is focused on this area of programming. My target is that bare syntax features offered by C++ (D in this case).
I know that Unity API is the limit factor in either case and eventually the code is going to be compiled to the same result but it’s the syntax you go with to reach the same destination, that matters to me.

This is the bit that I’m missing knowledge of. Can you help me?

C#, together with all of the .NET languages (F#, Visual Basic, etc.) are compiled to a language named “Intermediate Language”, IL. This language is run on a virtual machine (the CLR).

Unity uses this technology, and can (in principle) run any IL code, no matter how it was generated. There’s a built-in compiler that compiles C#, but you can write eg. F#, compile it to a dll, and have Unity use it just fine.

To use something like C++ or C or D (or Python or whatever), you’d have to compile it to IL, which means some kind of translation step. AFAIK, this doesn’t exist, so you’d have to build it. That’s a task that’s much, much harder than making a video game.

2 Likes

Looks like there is an existing .Net compiler. But it looks pretty dead.

https://dnet.codeplex.com/

1 Like

Thank you all guys. Well, when life gives you lemons, make lemonade. After all, why would you need unhealthy cocktails when you have The Lemonade?