GDExpr 1.0.1 Scripts 4.3 Community
Submitted by user dementive; MIT; 2024-09-17
GDExpr is a dynamically typed scripting language that compiles to a sequence of Godot expressions and executes them. It is written as a C++ GDExtension, in a single header file, in under 1000 lines of code that only uses godot-cpp headers, with no standard library usage. It is written as a Godot add-on so can be used from either C++ (or any other GDExtension language) and GDScript.
Because GDExpr compiles to Godot expressions and Godot expressions natively support every Variant type and all operations on them out of the box as well as having the ability to call methods directly on any Object pointer, this means you can do pretty much anything with any type and also call your gdscript/gdextension functions directly in GDExpr files!
GDExpr is not meant to be the main language you use to develop your game, it is designed to be an auxiliary scripting language.
GDExpr can be run as a JIT compiler to compile and execute code at runtime, so it allows for hot reloading and quick runtime testing. It can be used to statically compile GDExpr code to Godot expressions which can then be executed at runtime without incurring the compile time overhead.
GDExpr is a structured language and doesn't even have any non-structural procedures (such as function declarations or goto statements) because you don't actually need them. This means the control flow of any GDExpr program will always be a straight line from the top of the script to the bottom, it is impossible to jump to other sections of code that are not the next line to be executed, this is by design.
See the github repository README for more details, documentation, and usage examples.
View files Download Submit an issue Recent Edits