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

Add a REPL #38

Closed
fewkz opened this issue Apr 18, 2023 · 10 comments · Fixed by #83 or #88
Closed

Add a REPL #38

fewkz opened this issue Apr 18, 2023 · 10 comments · Fixed by #83 or #88
Labels
enhancement New feature or request

Comments

@fewkz
Copy link

fewkz commented Apr 18, 2023

Add a REPL so that we can run luau code with the lune runtime without having to create a script, would be useful for modifying Roblox place files interactively from the command line. Suggested this to Remodel before, but since Lune is a successor to Remodel, I'd love for Lune to have it rojo-rbx/remodel#90

@filiptibell filiptibell added the enhancement New feature or request label Apr 18, 2023
@fewkz
Copy link
Author

fewkz commented Jul 30, 2023

I'd just like to bump this because this is a really useful feature for a script runtime! I really wanted to use this for inspecting rbxm/rbxl files interactively from the command line instead of having to write and re-run a script again. I do hope it gets added

@CompeyDev
Copy link
Contributor

I'd be up to implement this whenever I can :)

@CompeyDev
Copy link
Contributor

As posted on Discord, I have created an intial Proof of Concept implementation here.

image

@filiptibell
Copy link
Collaborator

REPL has been implemented in #83 courtesy of @CompeyDev 🎉

I'm reopening this issue so that we can still track progress on important features such as context preservation

@filiptibell filiptibell reopened this Aug 16, 2023
@CompeyDev
Copy link
Contributor

Mention me here once the core library allows for context preservation to be implemented, and I'll implement it accordingly.

In the meanwhile, I'll work on other issues :^)

@filiptibell
Copy link
Collaborator

The rewrite of the task scheduler and require (#88) now preserves context between calls to Lune::run, meaning the REPL will too. I'll go ahead and close this when that PR gets merged.

@CompeyDev
Copy link
Contributor

The rewrite of the task scheduler and require (#88) now preserves context between calls to Lune::run, meaning the REPL will too. I'll go ahead and close this when that PR gets merged.

Perfect! Is there a way for me to get the last declaration (such as a variable, or function declared) within the stack? This way I could get some value previews going...

@filiptibell
Copy link
Collaborator

Perfect! Is there a way for me to get the last declaration (such as a variable, or function declared) within the stack? This way I could get some value previews going...

Not as of right now, no, for this we would need some separate function which evaluates the given chunk and returns the lua value instead, and that also means our Lune lib would need to re-export mlua. I feel like this is probably a big enough thing to have it's own feature request / issue.

@CompeyDev
Copy link
Contributor

Alright, I'll create an issue for tracking's sake.

@CompeyDev
Copy link
Contributor

Created #92.

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
3 participants