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

Lua cartridge support #97

Closed
aduros opened this issue Sep 17, 2021 · 4 comments
Closed

Lua cartridge support #97

aduros opened this issue Sep 17, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@aduros
Copy link
Owner

aduros commented Sep 17, 2021

Would this be useful for anyone? Lua seems to be the lingua franca of fantasy consoles, so it might help drive adoption?

Implementation-wise it would be a little different since it's interpreted. We could provide a prebuilt cart.wasm written in C containing the Lua runtime. The *.lua files would then be injected into this cart.wasm somehow to produce the final cart.

The nice thing about this approach is that Lua carts would require no compiler toolchain to setup.

@aduros aduros added the enhancement New feature or request label Sep 17, 2021
@eXponenta
Copy link
Contributor

eXponenta commented Sep 17, 2021

Compile tools will still required, or you will need has CLI
with wasm recompiler that will replace placeholder for lua source.

You should store LUA source because there are not IO in API.
If IO will be - this will hacky, because you allow share resources inside/outside cart files.

Anyway you cannot compile Lua onto 64kb with 64 ram limit:)), because i not seen wasm with luavm less that 200kb

Conclusion:
LUA is bad idea. It requiring use bigger that cart runtime that already not allowed or require store LuaRuntime inside player.
Then main idea of wasm4 - cart is single file in binary representation on pure wasm, and use a lua outside it kills the whole point.

And already exists a pico8 and similar consoles with string representation of source. Why this needed?

@MaxGraey
Copy link
Contributor

The main highlight of wasm4 is WebAssembly. Even the name reflects this. If you add Lua, everyone will firmly associate this project with another pico8 clone IMO

@aduros
Copy link
Owner Author

aduros commented Sep 17, 2021

Compile tools will still required, or you will need has CLI with wasm recompiler that will replace placeholder for lua source.

That's the idea, to allow injecting Lua source into a prebuilt lua-cart.wasm using a w4 CLI command. It wouldn't involve adding anything Lua-specific to the runtime.

Anyways, this would probably be a pain to implement. I'm not planning on it unless there's enough demand.

@aduros
Copy link
Owner Author

aduros commented Dec 21, 2021

Supplanted by #204

@aduros aduros closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants