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

Install lua interpreter on demand #12

Open
gustavo-hms opened this issue Apr 17, 2021 · 4 comments
Open

Install lua interpreter on demand #12

gustavo-hms opened this issue Apr 17, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@gustavo-hms
Copy link
Owner

gustavo-hms commented Apr 17, 2021

The fzf plugin for vim has a handy feature: it can automatically install a version of the fzf binary on the user's machine, freeing the user of the burden of dealing with the plugin dependency and making it works out of the box.

The lua interpreter is very tiny (around 300 Kb in a 64 bits Linux machine) and can be downloaded much faster than fzf, almost unnoticeably. So, it would be nice if Luar could detect that a lua interpreter is missing and automatically installs one. This has the potential to make people less worried about publishing Kakoune plugins written using Luar.

It could be something in the following lines:

  • on ModuleLoaded, a script would check if a lua executable is available. If so, nothing happens;
  • if, on the other hand, a lua executable could not be found, download a tar file from here, unpack it in a predetermined location and set a hidden option to inform the lua command to use the custom binary instead of relying on a system installation.
  • optionally, allow the user to set an option informing Luar to not download the interpreter automatically.
@gustavo-hms gustavo-hms added the enhancement New feature or request label Apr 17, 2021
@catdevnull
Copy link

catdevnull commented Sep 8, 2021

I think it would be nicer if auto-downloading would be opt-in as some people may not like downloading binaries to their devices without their interaction.

Also, they may want to install it from a package manager instead.

@gustavo-hms
Copy link
Owner Author

Hi, @catdevnull !

Yeah, the idea is to have an option you can set to disable that behaviour.

@catdevnull
Copy link

Yes, I saw, what I meant is that instead you might want to do the reverse: add an option to enable downloading of Lua.

This is similar to what vim-plug does: https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation

It's also what fzf.vim does; you have to call fzf#install for it to install the binary.

Just a suggestion though!

@gustavo-hms
Copy link
Owner Author

I see...

Ok, I agree with you. When this feature finally get an implementation, it won't be the default behaviour.

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

2 participants