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

Request: Add Lua Language Support to Wasmer #5335

Open
JustKira opened this issue Jan 11, 2025 · 2 comments
Open

Request: Add Lua Language Support to Wasmer #5335

JustKira opened this issue Jan 11, 2025 · 2 comments
Labels
🎉 enhancement New feature!

Comments

@JustKira
Copy link

Thanks for proposing a new feature!

Motivation

The motivation behind this request stems from my ongoing project to build a custom game engine where the core is developed in Rust, and the UI layer is implemented in Lua alongside my custom language. The idea is to allow developers to contribute to the engine using different languages, enabling the creation of specific features in their preferred language while maintaining seamless integration within the same engine.

Wasmer appears to be the ideal foundation for this project due to its support for multiple languages. However, Lua—an essential component of my project—is currently not supported. This feature would fill a critical gap in Wasmer’s otherwise robust language support and make it an even more versatile runtime.

Proposed solution

Add support for the Lua language in Wasmer. This feature would allow developers to compile Lua code to WebAssembly and execute it via Wasmer, similar to the existing support for other languages. Ideally, this could include:

A Lua-to-WASM compiler or integration with existing compilers.
Runtime compatibility with Lua-specific features, such as its lightweight nature and efficient scripting capabilities.

Alternatives

I’ve explored existing Lua-WASM and Lua-Rust interpreters, but they don't fully meet the needs of this project, particularly when it comes to the ability to seamlessly integrate multiple languages within a single engine runtime. By integrating Lua support directly into Wasmer, the ecosystem gains flexibility and scalability, aligning with Wasmer's goal of being a universal WebAssembly runtime.

Additional context

This feature would open doors for projects that require multi-language integration, particularly in game engines, scripting, or similar domains. Lua’s lightweight design and widespread use make it a strong candidate for inclusion in Wasmer’s supported languages.

For reference, there was a related issue (#2612) that was previously closed without a solution. Given the importance of Lua for projects like mine, I believe this deserves reconsideration.

@JustKira JustKira added the 🎉 enhancement New feature! label Jan 11, 2025
@syrusakbary
Copy link
Member

Thanks for opening the issue. It seems the first step would be to compile Lua to Wasm/WASIX and then use Wasmer for that.

Lua community could probably help on this as well (compiling Lua to WASIX), but we would be more than keen to help you on that if you encounter any issues

@JustKira
Copy link
Author

To ensure I understand correctly: Does Wasmer load WebAssembly (Wasm) files? If so, do I just need to make sure I compile Lua properly into the Wasm or WASIX format? I'm new to WebAssembly and exploring it—it's such an interesting technology!

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

No branches or pull requests

2 participants