Skip to content

godot-nim/gdext-nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

godot-nim/gdext

Nim for GDExtension. A pure library and a CLI tool.



For instance to use, see demo. See wiki to get more detail.

Note

This library is not yet stable. If you encounter any problems in practical use, we encourage you to consider to create an Issue, as it is most likely on the library side. Either way, we will try to help.

Features

  • All classes and methods provided by the engine are available from Nim.
  • New extension classes can be defined that inherit from the engine class and exposed to editors and GDScript.
  • New methods, signals, properties, and enums can be defined in your extension classes and exposed.
  • New virtual functions can be defined and exposed, and overridden from both Nim and GDScript.
  • Recompiled GDExtension can be loaded without restarting the editor. (Hot Reloading)
  • Arithmetic operations such as Vector are more expressive than those in Godot, for example, GLSLang's swizzle operation is also available.
  • It has a CLI tool that allows you to create new extensions, compile, run projects, and so on from a unified interface. (see wiki - gdextwiz)

Limitation

  • Document comments left in Nim source are not reflected in the editor.
  • Editor plug-ins cannot be created using only pure Nim code.
  • Due to engine specifications, Nim code works in the form of calls from the engine; it is not possible to run Nim stand-alone.

Commands

install

nimble install gdext

uninstall

nimble uninstall gdext

upgrade

nimble uninstall gdext && nimble install gdext

Supported environments

OS

  • Linux
  • Macos
  • Windows

Engine

Nim compiler

  • nim-lang/nim 2.0.0 or higher

    Macos

    Use Nim installed via Homebrew, not choosenim. Due to the execution environment of Godot itself, a native AArch64/ARM64 build of Nim is required, and that choosenim installs a x86_64 build emulated via Rosetta.

Tested by author

Note

Support for environments not listed here is based on your reports. Please consider contributing.

  • OS: Linux (Arch)
  • Engine: Godot 4.3.stable.arch_linux
  • Nim: 2.0.0, 2.0.12, 2.2.0
  • CC: gcc version 14.2.1 20240910 (GCC)