So I know that GDscript is interprated but I wanna know the exact details.

Most "interprated" languages aren't purely interprated, For example Python is actually compiled to intermediate bytecode which is then interprated by the Python virtual machine.

Older versions of JavaScript were "purely interprated", As in there's no compilation but rather line line interpration.

So how which type does GDscript use ? I'm gonna guess it first compiles it into bytecode because I've heard of .gdc files, I've also heard that Godot 3 compiled bytecode while Godot 4 temporarily removed this and just used pure interpration, I really don't know though...

Also when you export your game to windows for example, It results in a .exe file, How is it possible to compile a language with dynamic typing into native machine code ? Unless it's just straight up including the GDscript interprater with every export, Which probably isn't an issue seeing as the language is light weight.

Now I wonder if there's an extension that can make GDscript "compiled" like how Python has a it's "Cython" implemention, Cython is a superset of Python that allows you to compile Python code into native machine code, But of course you must specify variable types and array sizes because compilation requires static typing.

  • xyz replied to this.

    More on that last paragraph: Compiled GDscript would be awesome, People constantly complain that GDscript is slow (it's not) and resort to C#/C++ for game dev, It would be awesome if there was an official (or unofficial) alternative implemention of GDscript that is compiled and statically typed

    • Edited

    buzzbuzz20xx Everything ends up as native code in the end. It's just that with interpreted languages, there's much more native code to be executed per interpreted line of code 😃

    GDScript's performance is quite sufficient for most typical game tasks... if you know what you're doing.

    If you need heavy lifting, C++/GDScript combo works pretty well, with only the performance critical stuff delegated to C++.