News for hackers. Stuff that matters.
Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @03:11PM (#32100291)
Ugh, not more C#!

I hope one of these projects takes off: https://github.com/migueldeicaza/GodotSwift https://github.com/kelvin13/godot-swift

Excited to try Godot in a couple of years when it's more mature. Hopefully they can be the Blender of game engines – where it started rough and now is better than Maya or other alternatives.

Re:It’s time to make that indie C# game in Godot by throwaway675309 on Thursday July 14, 2022 @03:34PM (#32100549)
Do you have an actual specific disagreement with c# or are you just venting because you are not familiar with the language?

C# is a robust language with a lot of features like lambdas pattern matching etc. I also find that most of the people who know Swift are Apple developers, so I feel like there isn't a broad enough appeal especially for game devs who are going to be more Windows or Linux centric.

Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @04:18PM (#32100957)
Yes, I know C# reasonably well. I use it in Unity for game development, where it is the only option.

C# is better than many alternatives, but Swift is simply a better language in every regard.

C#'s GC is a constant issue for games, and it makes using things like LINQ nearly impossible since it does so much allocation. Swift is designed around automatic reference counting instead. C#'s structs work weirdly and are hard to use.

Swift is so much more ergonomic. C# has added a few nice things lately, but it's much more verbose than Swift.

Swift is also more focused on performance, and is always AOT compiled.

Unity has had to come up with some insane things to get C# to work across platforms – they have their own .NET IL to C++ compiler (https://docs.unity3d.com/Manual/IL2CPP.html) that doesn't always work right. They also have a SECOND custom C# compiler for high-performance programming (https://docs.unity3d.com/Packages/[email protected]/manual...).

I'm also very excited about Swift 6's upcoming opt-in Rust-like lower-level memory management which should help a ton for performance-critical code. (https://github.com/apple/swift/blob/main/docs/OwnershipManif...)

Re:It’s time to make that indie C# game in Godot by jayd16 on Thursday July 14, 2022 @04:25PM (#32101008)
Sounds like you mostly just don't like what Unity has needed to do over the years with the Mono runtime, not the language.
Re:It’s time to make that indie C# game in Godot by elabajaba on Thursday July 14, 2022 @04:38PM (#32101146)
Dotnet Core is significantly faster than the old version of mono that Unity is currently stuck on.

They've recently announced that they're finally upgrade to .net core over the next couple years, so that should help out a lot. https://blog.unity.com/technology/unity-and-net-whats-next

Re:It’s time to make that indie C# game in Godot by kitsunesoba on Thursday July 14, 2022 @05:52PM (#32101883)
My experience with C# has mostly been working on a personal project WinUI desktop app, and my biggest peeve has been reaching for something I use regularly in other languages only to find that it doesn't exist, and the solutions offered up by googling are usually, "well you can write your own implementation", "[huge utility library] offers that", or "don't do that it's not idiomatic/performant/etc". While none of those are showstoppers they slow development down and act as a source of frustration.
Re:It’s time to make that indie C# game in Godot by kcb on Thursday July 14, 2022 @11:27PM (#32104293)
That's strange because I can't think of a language with a bigger first party library than .NET. The breadth of System. and Microsoft. is enormous.
Re:It’s time to make that indie C# game in Godot by metaltyphoon on Friday July 15, 2022 @12:01PM (#32109488)
It's funny because I keep seeing "Go is the gold standard of what a standard library should be", when dotnet dwarfs it by a BIG margin.
Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @04:27PM (#32101034)
@jayd16 No, they have dropped the Mono runtime for many cases (which causes some of the problems). The language itself is simply much less pleasurable to program in than Swift, and performs worse in key areas.
Re:It’s time to make that indie C# game in Godot by overgard on Thursday July 14, 2022 @03:53PM (#32100719)
I can't speak for the grandparent, but using C# in Unity, the garbage collector is always at the front of mind and dissuades people from using some of the nicer features of C# (LINQ, etc.). Granted my knowledge of this is a couple years old, so maybe the situation has improved, but I'm guessing most Unity developers are still very careful about how they write loops and how/when objects are allocated and all that stuff. Automatic memory management can be more of a hindrance than a benefit if you have to babysit it to avoid GC pauses.
Re:It’s time to make that indie C# game in Godot by Shadonototra on Thursday July 14, 2022 @03:52PM (#32100709)
C# needs a fat runtime, has a slow JIT (say hi to micro stutters in your gameplay and increased input latency), has a slow GC and worst of all is owned by Microsoft with a proprietary debugger that you can only use on visual studio (licence they changed overnight because Jetbrains released a C# IDE)

There are much better languages for game scripting (LUA for example)

Re:It’s time to make that indie C# game in Godot by ianlevesque on Thursday July 14, 2022 @03:25PM (#32100472)
C# is really well suited to the task thanks to value types and structs, that gives you back control of memory that is lost in Java for example. It also has a lot of syntax sugar to avoid being too verbose and the memory safety and GC are desirable most of the time and can be avoided with well known tricks, like object pools, when performance needs are more paramount.
Re:It’s time to make that indie C# game in Godot by overgard on Thursday July 14, 2022 @03:50PM (#32100688)
I don't know Swift very well, but I seem to recall the creator talking about using automatic reference counting instead of garbage collection as an intentional tradeoff. If that's still the case, I'd much rather use Swift over C# in a game (and I am using C# in a game!). The value types and structs are very limited compared to classes and reference types.
Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @04:24PM (#32100999)
Yes ARC is definitely an intentional and well-chosen tradeoff. Swift has real first-class value types (strings, collections, etc are all value types) and copy-on-write semantics that make it all work quite well. C# value types feel like they are funkily bolted on and aren't really very useful in practice (at least in Unity).
Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @04:20PM (#32100967)
Swift is entirely designed around value types and structs, and has a much more predictable ARC model instead of GC for game programming. Plus, an upcoming feature will add Rust-style lifetimes for more control (https://github.com/apple/swift/blob/main/docs/OwnershipManif...).
Re:It’s time to make that indie C# game in Godot by weberer on Thursday July 14, 2022 @03:22PM (#32100425)
Godot's default language is GDscript, which is similar to Python. I'd highly recommend that to new people switching to Godot. I think C# is just cruft for people coming from Unity and stuck in old habits/frameworks.
Re:It’s time to make that indie C# game in Godot by TulliusCicero on Thursday July 14, 2022 @03:47PM (#32100670)
I tried GDScript and hated it, ended up manually porting what I wrote to C#. GDScript currently only has partial support for static typing, which makes things a much bigger pain in the ass. Using C# was a breath of fresh air after that.
Re:It’s time to make that indie C# game in Godot by wilg on Thursday July 14, 2022 @04:21PM (#32100975)
Yeah, I don't want a weird scripting language like Unreal Blueprint or GDScript or Lua. C# beats all of those by a mile. I want a robust, ergonomic, high-performance, compiled language like Swift.
Re:It’s time to make that indie C# game in Godot by kitsunesoba on Thursday July 14, 2022 @03:15PM (#32100333)
C# isn't the worst but out of the newer languages I've tried it's probably the one I'm least excited to write. Swift or Kotlin would definitely be preferred.
Re:It’s time to make that indie C# game in Godot by mdbauman on Thursday July 14, 2022 @03:53PM (#32100720)
You obviously know this since you linked a Swift bindings project, but for others reading who may not be aware: Godot officially supports multiple languages ("GDScript, C#, VisualScript, and C++ and C via its GDNative technology"[1]), but other languages are supported by the community.

In particular, a sibling comment mentions Kotlin. The docs[2] link to a project that adds Kotlin bindings https://github.com/utopia-rise/godot-kotlin-jvm

[1]https://docs.godotengine.org/en/stable/getting_started/step_...

[2]https://docs.godotengine.org/en/stable/tutorials/scripting/g...

Re:It’s time to make that indie C# game in Godot by arcturus17 on Thursday July 14, 2022 @03:33PM (#32100541)
I’ve actually read so many good things about C# lately here and on Reddit that I plan to start learning it in the coming weeks (other reasons include .Net and F# being an adjacent language)

What don’t you like about it?

Re:It’s time to make that indie C# game in Godot by metaltyphoon on Thursday July 14, 2022 @07:23PM (#32102555)
Why Swift, when searching only, you can see that it performs much worse than C#?