mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.5K
active users

LinuxUserGD :godot:

Released a cli tool "gdscript-transpiler-bin" which translates basic gdscript files to python

Python code can later be compiled into a standalone executable

linuxusergd.itch.io/gdscript-t

Source code: codeberg.org/LinuxUserGD/gdscr

@HugeGameArtGD Pretty cool. What's the use-case for this?

Search and replace isn't a scalable option (it gets hairy really fast). A better option would be to build a parse tree, This old project of mine might be helpful: github.com/nightblade9/dragon

GitHubGitHub - nightblade9/dragon: Dragon is a universal Python translater.Dragon is a universal Python translater. Contribute to nightblade9/dragon development by creating an account on GitHub.

@nightblade9 Thanks, the use-case is a standalone GDScript compiler that runs GDScript projects slightly faster and doesn't require the Godot Engine, e. g. for reimplementing small algorithms in GDScript.
I tried to write a simple tokenizer to transpile scripts instead of search-and-replace, though I can't use lark directly as it's too difficult to rewrite it in gdscript.
github.com/MikeSchulze/gdUnit4
The GDUnit Project uses a parser for unit tests which would also work for a transpiler I think.

GitHubgdUnit4/GdScriptParser.gd at master · MikeSchulze/gdUnit4A Godot Unit Test Framework. Support for GDScript and C# unit testing - gdUnit4/GdScriptParser.gd at master · MikeSchulze/gdUnit4

@HugeGameArtGD @nightblade9 So it's useful if I wrote a general algorithm in GDScript and I want to reuse it in Python, for instance?

@leyn @nightblade9 Yes, because it should be easier to write optimized GDScript (which can be compiled AOT even if variables are not statically typed) than writing Python or cross-platform C code.

Could also be used in Python projects (e. g. by uploading transpiled code to PyPi, and possibly(?) run with godot-python as an external package).