July 16th, 2024

Godotcaml for Godot 4.2

Godotcaml, a project by Matt Walker, integrates OCaml with Godot 4.2 for game development. It enables calling Godot functions from OCaml and defining new Godot classes. Work is ongoing to improve signal support, garbage collection handling, and method definitions. The project is not production-ready yet, needing enhancements in build system integration, hot-reloading, and type safety. Contributions and testing are encouraged for further development.

Read original articleLink Icon
Godotcaml for Godot 4.2

Godotcaml, a project by Matt Walker, has been announced for Godot 4.2. It aims to integrate OCaml with Godot for game development. The choice of Godot is due to its comprehensive game development IDE, while OCaml offers benefits like garbage collection, functional programming, and ease of side-effect handling. The project allows calling Godot functions from OCaml, using Godot operators naturally, and defining new Godot classes in OCaml. However, some features are still in progress, such as signal support, garbage collection handling, and method definitions. The project is not yet suitable for production games, and improvements are needed in areas like build system integration, hot-reloading, and type safety. Contributions and testing are welcomed to enhance the project further.

Link Icon 10 comments
By @eieio - 7 months
Oh this is really cool! It also feels highly targeted at my interests (I worked professionally in OCaml for many years, now make games, and bounced off of Godot because I found GDScript really unpleasant to program in[1]).

From looking through the TODOs here, I think the one thing that would stop me from playing with this soon is signal support. I can't quite tell how non-existent the signaling support is here: can I just Obj.magic (unsafe cast) stuff and get it to work, albeit without type safety? Signals in Godot are great and I'm already used to them not being type safe (they're just strings in Godot 3! Gross!) so that'd be tolerable.

Anyway, very cool stuff.

[1] I've been meaning to go back at try out C#, which might be more my taste. I held off partially because I don't know C# yet and partially because examples for C# in Godot seemed a little lacking when I last looked - but also because Godot 4 web exports were pretty busted for a while, which irritated me enough to make me use something else. I think there's been some progress here though!

By @rphln - 7 months
I think it'd be interesting to compare against F#, especially since Godot already has first-class support for .NET. When the bindings get fully fleshed out, what will OCaml bring to the table to warrant the extra hoops for the user that has no prior preferences for either languages?
By @berkeleynerd - 7 months
Miguel de Icaza's [Swift Godot](https://github.com/migueldeicaza/SwiftGodot) effort is also very active and worth tracking I think.
By @billfruit - 7 months
Which all languages have viable bindings with Godot 4.x?

Does Java have one? What about Javascript?

By @lovegrenoble - 7 months
I want to try my hand at development, what would you suggest to shorten the learning curve, Godot or Unity (https://unity.com) ?
By @alabhyajindal - 7 months
Why didn't Ruby take off in the game industry? As I understand OOP is a critical language feature which led to the success of Java and C#. Is it maybe because of dynamic typing?

OOP experience in Ruby is very pleasant and I wish the language was used more.

By @binary132 - 7 months
This kinda just made me curious about the Rust api. Sorry. :)
By @efilife - 7 months
This is going to sound stupid, but bear with me. Godot is a very simple engine once you get past its learning curve. I know that this thing could be said about anything, but you only need a couple of hours/days to grasp the basics. And once you know the basics, you pretty much know the whole engine and can refer to documentation for anything you want to do. For example, for a Godot beginner even creating a simple 3D cube can be a problem. But once you understand that you need to compose it out of different building blocks, how you should do this and why, everything clicks. It's a delight, I recommend everyone to try Godot
By @kragen - 7 months
exciting and unexpected. i'll try it but i'll be pleasantly surprised if it's good
By @pjmlp - 7 months
Quite nice achievement.