Skip to content

Add yielding support to mlua #518

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

radiantgurl
Copy link
Contributor

No description provided.

@radiantgurl
Copy link
Contributor Author

woops

@radiantgurl radiantgurl reopened this Jan 25, 2025
@cheesycod
Copy link

cheesycod commented Jan 26, 2025

Oh wow, ig someone managed to do the impossible . Still seems to be some errors left to fix though like ``Assertion failed: (((nresults) < (L->top - L->ci->func)) && "not enough elements in the stack"), function lua_yieldk, file ldo.c, line 697.
test test_chunk_env ... ok
error: test failed, to rerun pass `--test thread```

@radiantgurl
Copy link
Contributor Author

Oh wow, ig someone managed to do the impossible . Still seems to be some errors left to fix though like ``Assertion failed: (((nresults) < (L->top - L->ci->func)) && "not enough elements in the stack"), function lua_yieldk, file ldo.c, line 697. test test_chunk_env ... ok error: test failed, to rerun pass `--test thread```

It still has many many issues, as i have to modify callback_error_ext

@cheesycod
Copy link

Oh wow, ig someone managed to do the impossible . Still seems to be some errors left to fix though like ``Assertion failed: (((nresults) < (L->top - L->ci->func)) && "not enough elements in the stack"), function lua_yieldk, file ldo.c, line 697. test test_chunk_env ... ok error: test failed, to rerun pass `--test thread```

It still has many many issues, as i have to modify callback_error_ext

How exactly does this solve the issue of the Rust/Lua call boundary?

@radiantgurl
Copy link
Contributor Author

Oh wow, ig someone managed to do the impossible . Still seems to be some errors left to fix though like ``Assertion failed: (((nresults) < (L->top - L->ci->func)) && "not enough elements in the stack"), function lua_yieldk, file ldo.c, line 697. test test_chunk_env ... ok error: test failed, to rerun pass `--test thread```

It still has many many issues, as i have to modify callback_error_ext

How exactly does this solve the issue of the Rust/Lua call boundary?

This doesn't, it relies on Err to stop it.

I'm planning to add both this and an async system where Lua acts as the waker.

@cheesycod
Copy link

Any updates on this PR @radiantgurl

@cheesycod
Copy link

@radiantgurl @khvzak Have integrated this PR into my general PR for yielding and luau continuations (which go together anyways as you cant use continuations really without the yielding): #588

@radiantgurl
Copy link
Contributor Author

@radiantgurl @khvzak Have integrated this PR into my general PR for yielding and luau continuations (which go together anyways as you cant use continuations really without the yielding): #588

Ok, can you co-author me on the specific commit that integrates this PR?

Sorry that i was basically dead, i have a bunch of volunteering activities irl.

@cheesycod
Copy link

cheesycod commented Jun 5, 2025

@radiantgurl @khvzak Have integrated this PR into my general PR for yielding and luau continuations (which go together anyways as you cant use continuations really without the yielding): #588

Ok, can you co-author me on the specific commit that integrates this PR?

Sorry that i was basically dead, i have a bunch of volunteering activities irl.

How do you co author someone on a commit (im new to this type of git stuff)

Also, I didn’t really use much of your code in the end besides the inspiration for yielded_values in extra_args and the is_yieldable bit. The rest had to be reworked a lot (especially to work with luau specific stuff in its continuation implementation) and due to general errors I found when testing/trying to use it (turns out yielding isn’t as easy as it looks lol)

Sorry for not attributing you in advance though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants