Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement C# Language Support in Defold Engine #8063

Open
SparkT06 opened this issue Sep 30, 2023 · 3 comments
Open

Implement C# Language Support in Defold Engine #8063

SparkT06 opened this issue Sep 30, 2023 · 3 comments
Assignees
Labels
feature request A suggestion for a new feature

Comments

@SparkT06
Copy link

Description:

As a game developer who frequently uses the Defold engine, I have come to appreciate its versatility and efficiency in game development. However, I believe that the inclusion of C# language support could significantly enhance the capabilities and user experience of the Defold engine.

Reasoning:

C# is a widely used language in game development, particularly in Unity, and many developers are already familiar with it. Implementing C# support in Defold could potentially attract more developers to use the engine and enhance its competitiveness.

Benefits:

Ease of use: C# is known for its simplicity and readability, which makes it a great choice for both beginners and experienced developers. Implementing C# support could make Defold more accessible to a wider range of developers.

Performance: C# is a statically-typed language which can offer performance benefits over dynamically-typed languages like Lua.

Interoperability: C# can easily interoperate with native libraries, which can be beneficial for extending the functionality of Defold.

Object-oriented programming: C# supports object-oriented programming natively, which could simplify the development process for many developers and allow for more complex and structured game logic.

Implementation:
Similar to how Defold currently supports Lua for scripting game logic, Defold could support C# in a similar manner, allowing developers to write game logic in C# scripts. This could be achieved potentially via a transpiler, similar to how the DefoldSharp project has approached it .

I would like to suggest the official implementation of C# language support. Currently, there is an open-source project, DefoldSharp, that provides C# support for Defold. However, having this feature supported officially by the Defold team would be highly beneficial.

Benefit of Official Support:

DefoldSharp is currently in Alpha and, while it provides a promising start, official support could provide more stability and reliability. Official support would ensure regular updates, better integration with the Defold engine, and potential performance improvements.

I would like to propose a community discussion for the official implementation of C# language support.

Csharp_Logo

@SparkT06 SparkT06 added the feature request A suggestion for a new feature label Sep 30, 2023
@JCash
Copy link
Contributor

JCash commented Sep 30, 2023

Hi @SparkT06 and welcome!

While I appreciate the discussion, I feel I should point out a few things.

Defold is a C++ engine, and will likely remain that way for a long time.
If we were to go in a new direction, it's much more likely we'd convert our libraries to Zig, as we are already very "C-like-C++".
Regarding Lua and static typing, we are about to experiment with Luau ("soon"), and we are also doing major updates to the Lua editing in terms of LSP and linting.

Our philosophy of keeping our C++ code very barebones (see our code style and orthodox c++) makes us performant, and keeps the executable size down.
I'd argue that this, and also our eco system of extensions, is a major part in why users consider our engine.

We are always very cautious about what we put into our engine, keeping performance, size and support time in mind.
And adding new language support is a huge effort.

You link to DefSharp, which is a transpiler to Lua, whereas I suspect you actually want a full integration of a separate language in the engine?
Lua and C# are very different languages, and I suspect you are after full C# support.

We recently ackknowledged that we want to add more functionality into our C++ SDK, so that users can do more from within their extensions. Perhaps that is something that may aid you in your effort.

For something like C# support, you could perhaps outline what new things from the C++ sdk you'd need to implement it. If we can help facilitate things from a native extension/SDK perspective, that would be great.

Also, I should bring up the effort it takes to create and maintain things like this.
Development time is not free, and one of the reasons we have native extensions is that our users can contribute with their own time and effort.
And, one of the reasons we are able to keep our team small, is that we don't take on all the extension code out there.

So, in summary.

  • We suggest you try adding your C# support as an extension
  • We can see what (if anything) you'd need from our C++ sdk

@SparkT06
Copy link
Author

I understand that introducing a new language support to an existing game engine requires a significant amount of effort in terms of development, testing, and maintenance. It's not just about adding a new feature; it's about ensuring that this feature will work seamlessly with the existing components of the engine, won't introduce new bugs or performance issues, and will be sustainable in the long term.

In addition to the technical challenges, there's also the resource aspect to consider. Adding C# support to the Defold engine would require allocating resources for the initial development phase, as well as ongoing resources for maintenance, support, and updates. This includes not only developer time but also potentially additional infrastructure and tools.

Despite these challenges, I believe that the benefits of introducing C# support to Defold could outweigh the costs. It would make the engine more versatile and attractive to a wider range of developers, potentially leading to a larger and more active community. It could also open up new possibilities for game development in Defold, by leveraging the strengths of C# as a language. I know design wise implementation is not easy and I will probably wait for defoldsharp addon production ready.

I'm just insisting, I can be wrong. But if team wants to consider this proposal for implementation and I will wait for it.

Thanks

@britzl
Copy link
Contributor

britzl commented Dec 15, 2023

We've started an investigation into C# support in some shape or form.

https://twitter.com/mwesterdahl76/status/1735231363769348419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggestion for a new feature
Projects
Status: In Progress
Development

No branches or pull requests

3 participants