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

Implement basic function inlining #3869

Open
GearsDatapacks opened this issue Nov 21, 2024 · 3 comments
Open

Implement basic function inlining #3869

GearsDatapacks opened this issue Nov 21, 2024 · 3 comments
Labels
help wanted Contributions encouraged priority:medium

Comments

@GearsDatapacks
Copy link
Member

As discussed in #3722, and this thread.
As pointed out here, some key functions such as bool.guard can cause a stack overflow with recursion in javascript, while giving a false appearance of being tail recursive.

Inlining bool.guard would solve this issue. As Louis suggested, we could initially implement a basic version of inlining (i.e. the inlining itself, without complex heuristics etc.), and later we can expand and improved upon this. @lpil could you elaborate a bit on how you were imagining we would decide which functions to inline?

I did a bit of research into how function inlining works when the about discussion was first created, so I'll write up a quick summary of how this will work soon, and then I'll look into implementing this.

@lpil
Copy link
Member

lpil commented Nov 21, 2024

Thank you

@lpil lpil added help wanted Contributions encouraged priority:medium labels Nov 21, 2024
@Olian04
Copy link

Olian04 commented Dec 8, 2024

@GearsDatapacks any update on this issue?

@GearsDatapacks
Copy link
Member Author

GearsDatapacks commented Dec 8, 2024

After a back and forth discussion on Discord, we decided that inlining is perhaps not a very helpful optimisation at the moment, due to a couple of other inefficiencies in codegen. We would like to focus on implementing #3968 and #3969 before working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants