Skip to content

Repository files navigation


GDScript to Python to C Transpiler

GodotMIT licensePython


gdscript-transpiler-bin is a GDScript compiler (using Nuitka), minimal scripts can be transpiled to Python.

Binary builds are compiled using Forgejo Actions for Alpine Linux, macOS and Windows x86_64.

Other compatible platforms: Android (aarch64 and x86_64).

Also see generated Python source from GDScript.

Video

Example

git clone https://codeberg.org/LinuxUserGD/gdscript-transpiler-bin.git
cd gdscript-transpiler-bin
git submodule update --init --remote --progress

Godot Engine command line (stage0)

  • ./godot4 -s bin/gds.gd --headless --format bin/gds.gd (for generating Python project)

  • ./godot4 -s bin/gds.gd --headless --compile bin/gds.gd (for compiling GDScript to binary using Clang and Nuitka)

Python environment (stage1)

Installing python gds

python -m pip install gdsbin
python -m pip install git+https://codeberg.org/LinuxUserGD/gdscript-transpiler-bin.git@python
  • python -m gdsbin --format bin/gds.gd

  • python -m gdsbin --compile bin/gds.gd

Nuitka compiled binary (stage2)

Installing gds binary (available at itch.io)

unzip gdscript-transpiler-bin.zip
cd gdscript-transpiler-bin
chmod +x gds
  • ./gds[.exe] help

  • ./gds[.exe] --format bin/gds.gd

  • ./gds[.exe] --compile bin/gds.gd

Benchmark

Time for running GDScript code:

funcstring() ->int:
varx: String=""foriinrange(0, 300000):
x+=" "returnx.length()
funcadd() ->int:
varx: int=-100000000foriinrange(0, 100000000):
x+=1returnx
GodotPythonNuitka
benchmark.gd11.639s4.678s1.857s

License

See LICENSE and CREDITS (third-party licenses)