Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GDScript code generation abstraction #41338

Merged
merged 3 commits into from
Sep 1, 2020

Conversation

vnen
Copy link
Member

@vnen vnen commented Aug 17, 2020

This adds an interface for code generation to GDScript. In itself it does not make much of a difference, but it does make it easier to add a new backend without having to worry about the parse tree, instead just implementing a lower-level interface.

This will be useful for the new typed VM, since it can be made without creating a new compiler code. Could also be useful in the future if we want to compile GDScript to other targets.

Also includes a disassembler for the current VM which I used to debug the code generation. It can't be accessed currently since the command for the old tests isn't available anymore, but this is useful to have for when we have a new way to trigger those.

@vnen vnen added this to the 4.0 milestone Aug 17, 2020
@vnen vnen requested a review from bojidar-bg as a code owner August 17, 2020 22:04
@Calinou
Copy link
Member

Calinou commented Aug 17, 2020

Does this close godotengine/godot-proposals#1176? Alternatively, does this PR make that proposal non-applicable?

@vnen
Copy link
Member Author

vnen commented Aug 17, 2020

Does this close godotengine/godot-proposals#1176? Alternatively, does this PR make that proposal non-applicable?

No and no. It might make a tad easier to implement that though, as it could be done as an implementation of this interface without having to touch the compiler.

Copy link
Contributor

@jonbonazza jonbonazza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some quick commemts at a glance. Ill need to wait until i have more time to sit down and give it a thorough review

modules/gdscript/gdscript_abstract_codegen.h Outdated Show resolved Hide resolved
modules/gdscript/gdscript_abstract_codegen.h Outdated Show resolved Hide resolved
modules/gdscript/gdscript_codegen.h Outdated Show resolved Hide resolved
@Xrayez
Copy link
Contributor

Xrayez commented Aug 18, 2020

It can't be accessed currently since the command for the old tests isn't available anymore

#41355 should get you there. 🙂

@vnen vnen force-pushed the gdscript-compiler-abstraction branch 2 times, most recently from 261afb0 to 2f74b37 Compare September 1, 2020 17:15
Implement the abstraction by targeting the current VM.
@vnen vnen force-pushed the gdscript-compiler-abstraction branch from 2f74b37 to 8963035 Compare September 1, 2020 17:31
@vnen vnen force-pushed the gdscript-compiler-abstraction branch from 8963035 to 635c6a0 Compare September 1, 2020 17:36
@vnen vnen merged commit 8e052e1 into godotengine:master Sep 1, 2020
@vnen vnen deleted the gdscript-compiler-abstraction branch September 2, 2020 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants