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

Feature: Implementation of Lobster as a scripting language embedded in rust. #297

Open
gustavomh opened this issue Feb 4, 2024 · 3 comments

Comments

@gustavomh
Copy link

I would love the ability to use Lobster as a scripting language built into Rust. something similar to what you have with Lua (rlua crate) or python (PyO3 crate).

@aardappel
Copy link
Owner

I'm sure that could be done.. but I doubt that is something this project would provide directly. Likely a separate repo that could implement that.

In fact, as you can read about in the "extending Lobster" section in https://aardappel.github.io/lobster/implementation.html, what would likely be much more interesting is having a way to use Rust to take the role of C++ in providing built-in functionality to Lobster, i.e. not "Lobster embedded in Rust", but "Rust embedded in Lobster".

A language like Lobster is much better at being the main program, and providing all the plumbing/glue.. you want Rust for speed, not for plumbing :) Imagine the velocity of development if most non-speed sensitive changes in a combined Lobster-Rust program can be done instantly, without a Rust build.

@istathar
Copy link

istathar commented Apr 5, 2024

i.e. not "Lobster embedded in Rust", but "Rust embedded in Lobster".

I realize that you explicitly differentiate what you're after away from their pattern, but perhaps the vocabulary being looked for here is "host language" in the sense of Lua and Wren.

Lua is implemented in C, yes, but it's more that you can communicate between Lua and the language that's hosted in (via C via FFI to anywhere). At that point yes the scripting language is calling the shots, but the heavily lifting of the implementation (not to mention the compiler/interpreter) is available in the host language that is the actual runtime/ecosystem/whatever at play.

So here's the question, restated: would you countenance having the implementation language of Lobster change away from C++?

@aardappel
Copy link
Owner

If I could snap my fingers and change all the C++ involved in the project into Rust overnight, I probably would.

But the reality is that rewriting it all in Rust would be a crazy amount of work. And a mixed project (both C++ and Rust) would be worse than just one of them.. at least with just C++ I get nice tooling and debugging.

There's also a lot of low level stuff going on in the VM that Rust likely wouldn't be able to do as well as C++.

The project also uses a lot of C/C++ libraries that would need replacing and wrapping.

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

No branches or pull requests

3 participants