GDScript and Python runtime environment
Project description
GDScript to Python to C Transpiler
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.
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 help
-
./godot4 -s bin/gds.gd --headless run=bin/gds.gd
(for running GDScript directly using x-python) -
./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 help
-
python -m gdsbin run=bin/gds.gd
-
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] run=bin/gds.gd
-
./gds[.exe] format=bin/gds.gd
-
./gds[.exe] compile=bin/gds.gd
Benchmark
Time for running GDScript code:
func string() -> int:
var x: String = ""
for i in range(0, 300000):
x += " "
return x.length()
func add() -> int:
var x: int = -100000000
for i in range(0, 100000000):
x += 1
return x
Godot | Python | Nuitka | |
---|---|---|---|
benchmark.gd | 11.639s | 4.678s | 1.857s |
License
See LICENSE and CREDITS (third-party licenses)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gdsbin-0.1.5.post2.tar.gz
.
File metadata
- Download URL: gdsbin-0.1.5.post2.tar.gz
- Upload date:
- Size: 62.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0b3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e03bbee7762354b12b5f94683eaf1a60c48566d2eac5bb06eb9c501f3fe04b71 |
|
MD5 | dfe0886938be55ced878694bb91960b7 |
|
BLAKE2b-256 | 6a6f4bf6799ecc044c169064c8da51ce17facc8645de5fb7b48334d176bf5cf7 |
File details
Details for the file gdsbin-0.1.5.post2-py3-none-any.whl
.
File metadata
- Download URL: gdsbin-0.1.5.post2-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0b3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c08e465c3944748ab625fbac5fc70b9ab7e3b15cc788626bf881cdfc6180cbd9 |
|
MD5 | 0a5bbf50329d13898f5aa96a0a310c41 |
|
BLAKE2b-256 | b6e20295af6b49630e5b109cbab9905cc4d0922e639d945fd3edf81516b05af9 |