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
[Discussion]: introducing %lua{ } expansions? #1383
Comments
Just a heads up: there is a little bit of discussion in
|
This question is addressed in the FAQ. Adding more custom scopes creates coupling between the project and third-party interpreters that might not be available on the target system, whereas we're guaranteed to have a shell if kakoune is to run at all. Another issue could be the version of the language targeted, e.g. how do we handle python2 and python3 ( I used to think adding custom scopes would be nice as well, but now after deploying software to completely different systems, I've learned that the less dependencies (even soft), the better. |
Thanks for these precisions. I explicitely mentionned lua (and not python, ruby or another language), because from what I understand about all the work that has been done on the neovim side (and I may be totally wrong), lua seems specifically designed to be embedded in the host project. So it means that it's supposed to be a lightweight intrepreter merged into the final kak binary and avoid the issue of relying on an external interpreter. |
There are several drawbacks to this approach that
Kakoune is very UNIX-centric, and I don't think the above approach fits very well with this paradigm: users who want to use lua can do so with the method described in the FAQ, to everyone's benefit, and no additional burden is put on the maintainer's shoulders in the process (c.f. above list). |
I'm not good enough in C++ to attempt to write a proof of concept. I also don't want to put this burden on mawww. So closing for now. |
As food for thoughts for future attempts, here's a similar prototype by @doppioandante embedding a scheme manager: doppioandante@0451d28 |
If anyone found this issue looking for something similar for personal use, I've implemented The MuJS API is very similar to the Lua API, so one for Lua could be done in the same way. |
Thanks! This integration looks great. https://mujs.com/introduction.html
Unfortunately, going back to prehistoric era will feel a bit too harsh for me. |
There's that js interpreter by Fabrice Bellard, QuickJS which might be a good candidate too. |
Hi.
The recent release of neovim 0.2 made a big splash partially because it lets you replace
viml
scripts bylua
ones. (the API is currently a bit cumbersome, but it should be better with version0.3
).Clearly, people love this new addition.
So this has me thinking: would there be any benefits to have some kind of similar mechanism to also write native lua script in kakoune?
Something like
%lua{}
string expansions alongside the already existing%sh{}
(or something else).Note that I'm a JavaScript guy and know nothing about the feasibility, the difficulty, the memory cost or the weight cost of such en embedding in the kakoune C++ codebase.
I know that mawww vision (shared by many other people, myself included) is to keep the project small and this feature may clearly be out of scope, and I totally understand.
Current
kak
scripts already work quite well, and so far they have let us do pretty much everything we needed.But, I personally find working with shell scripting quite hard, the whole POSIX compatibility, the string escaping madness, and I have the feeling that using the power of higher level language such as lua would really simplify the creation of bigger and more complex plugins.
Do some of you feel the same way? Is this proposal completely stupid or following this path may eventually result in something good?
The text was updated successfully, but these errors were encountered: