navigation

What is GDNative-Go

GDNative-Go is a Golang bindings to the Godot GDNative API.

History

The GDNative-Go project started as a fork of the godot-go project created by William Edwards in 2017 and hosted in Github. While Edward’s project encloses both GDNative bindings and Godot classes wrapper, GDNative-Go aims to be just a GDNative API bindings for Golang with the goal of easing the task of write Golang code that can be invoked from godot’s GDScript, C# or VisualScript.

Motivation

This library makes possible to write Go code that can be called from GDScript, it enables its users to:

  1. Bind Golang ecosystem applications to GDScript
  2. Delegate heavily CPU bound calculations to the Golang runtime
  3. Use Golang’s concurrency capabilities and patterns on GDNAtive modules from GDScript

Example Use Cases

A non curated list of use cases that ourselves already gave to the library are listed below:

  • Made GDNative bindings to BBoltDB so we can use it directly form GDScript
  • Made GDNative bindings to CockroachDB so we can use it directly in GDScript
  • Made GDNative bindings to NATS creating a GDScript client for it
  • Leverage heavy DSL parsing and calculations to Golang runtime increasing performance by several orders of magnitude

Can I make Godot games using GDNative-Go?

The short answer to that questions is, no, at least not for now. We are working in a wrapper to add all Godot API classes into a side library that could be used to develop Godot games in pure Go but that is far for now. If you want to write your Godot games in something more performant than GDScript you have other options like using godot-mono if you can bear C#, or even take a look at the fantastic godot-rust project or godot-cpp.