-
Notifications
You must be signed in to change notification settings - Fork 61
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
bad argument #2 to 'loadstring' when using with Playdate SDK #28
Comments
I looks like the loadstring function is used to simplify the parsing of filter strings. I’m looking to use tiny ecs in a playdate game too, I’ll fork and see if I can change the parsing to not need loadstring. |
Maybe replacing the https://stackoverflow.com/questions/53049668/why-does-lua-loadstring-not-work-on-the-demo-site |
The code does a loadstring or load in tiny.lua; I think it’s likely that Panic removed load() to disable runtime code loading |
Yeah that might be the case. Not sure though. |
Ok, first cut here: https://github.com/iansharkey/tiny-ecs I focused on the requireXXX/rejectXXX API functions, as the filter string version would require some more heavy-duty parsing that I don't want to tackle right now, especially given that a workaround exists (ie, write the function in Lua). I added tests, but they aren't exhaustive. Kick the tires a bit, and if it works alright, I'll submit a PR. |
It seems like it works mostly fine. I used your version in a project, and it does not seem to have caused any issues. I am mainly using Also not sure if this repo is still active and accepting PRs though. Seems like this has not been updated in a couple of years |
I didn't do any performance comparisons, that's a bit of a concern, but I'll poke around (the ipairs call should likely be changed). bakpakin has contact details on their GitHub page, and seems to be active, I'll reach out and see what's the status. |
#29 PR opened |
Awesome! |
So, I did run a performance test on your version @iansharkey. Seems like the changes don't affect performance in any way. Seemed just about the same as tiny_ecs. |
Much appreciated! I’ll take a different tack and do a bytecode comparison between a moderately complex requireXXX structure and my code. |
Hello! I'm trying to use tiny-ecs with the Playdate SDK. However every call to
tiny.require*
fails with:This works fine when using the non-playdate version of lua. I imagine that somehow
load
refers to something else in this environment. Doesn't seem to be a problem with tiny-ecs itself, but since I'm new to lua and I'm having trouble debugging this, I'm posting here with the hope that someone else had the same problem.Maybe the maintainer of this library has an idea of what to check/debug. Feel free to close if this is obviously not related to tiny-ecs.
The text was updated successfully, but these errors were encountered: