Introducing luavm - Lua Version Manager

classic Classic list List threaded Threaded
48 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Introducing luavm - Lua Version Manager

Dhaval Kapil
Hello, everyone!

'luavm' is a version manager for Lua.

https://github.com/DhavalKapil/luavm

Recently, I was working in lua and needed to switch between different versions frequently. This caused me various issues, like reinstalling versions of lua, reinstalling luarocks to with the new lua versions, etc. I even messed up with my installation somehow. To help deal with these problems and being inspired by the usefulness of 'nvm'(Node Version Manager) and 'rvm'(Ruby Version Manager) I decided to develop 'luavm'.

Features:

1. luavm helps to install multiple versions of Lua, LuaJIT, and Luarocks.
2. It helps to switch between these versions easily. At a particular time, only one version is in use.
3. The developer directly uses the commands 'lua', 'luajit' and 'luarocks' without worrying about anything.
4. Consistency is maintained between Luarocks and Lua. i.e. changing lua version also changes the luarocks version without any glitches.

My main motive was to remove from the programmer, the burden of managing different versions.

You can learn more about luavm by going to the above-mentioned link.

It is still in its development stage, suggestions and improvements are most welcome!
I would be very grateful if people try it and report back any bugs.

Thanks!
--
Dhaval Kapil
Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Justin Donaldson
Great idea!  I'm in need of something like this.

On Sun, May 22, 2016 at 2:02 PM, Dhaval Kapil <[hidden email]> wrote:
Hello, everyone!

'luavm' is a version manager for Lua.

https://github.com/DhavalKapil/luavm

Recently, I was working in lua and needed to switch between different versions frequently. This caused me various issues, like reinstalling versions of lua, reinstalling luarocks to with the new lua versions, etc. I even messed up with my installation somehow. To help deal with these problems and being inspired by the usefulness of 'nvm'(Node Version Manager) and 'rvm'(Ruby Version Manager) I decided to develop 'luavm'.

Features:

1. luavm helps to install multiple versions of Lua, LuaJIT, and Luarocks.
2. It helps to switch between these versions easily. At a particular time, only one version is in use.
3. The developer directly uses the commands 'lua', 'luajit' and 'luarocks' without worrying about anything.
4. Consistency is maintained between Luarocks and Lua. i.e. changing lua version also changes the luarocks version without any glitches.

My main motive was to remove from the programmer, the burden of managing different versions.

You can learn more about luavm by going to the above-mentioned link.

It is still in its development stage, suggestions and improvements are most welcome!
I would be very grateful if people try it and report back any bugs.

Thanks!
--
Dhaval Kapil

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Daurnimator
In reply to this post by Dhaval Kapil


On 23 May 2016 07:03, "Dhaval Kapil" <[hidden email]> wrote:
>
> Hello, everyone!
>
> 'luavm' is a version manager for Lua.
>
> https://github.com/DhavalKapil/luavm
>
> Recently, I was working in lua and needed to switch between different versions frequently. This caused me various issues, like reinstalling versions of lua, reinstalling luarocks to with the new lua versions, etc. I even messed up with my installation somehow. To help deal with these problems and being inspired by the usefulness of 'nvm'(Node Version Manager) and 'rvm'(Ruby Version Manager) I decided to develop 'luavm'.
>
> Features:
>
> 1. luavm helps to install multiple versions of Lua, LuaJIT, and Luarocks.
> 2. It helps to switch between these versions easily. At a particular time, only one version is in use.
> 3. The developer directly uses the commands 'lua', 'luajit' and 'luarocks' without worrying about anything.
> 4. Consistency is maintained between Luarocks and Lua. i.e. changing lua version also changes the luarocks version without any glitches.
>
> My main motive was to remove from the programmer, the burden of managing different versions.
>
> You can learn more about luavm by going to the above-mentioned link.
>
> It is still in its development stage, suggestions and improvements are most welcome!
> I would be very grateful if people try it and report back any bugs.
>
> Thanks!
> --
> Dhaval Kapil
> dhavalkapil.com

Have you read http://leafo.net/guides/customizing-the-luarocks-tree.html

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Peter Aronoff
In reply to this post by Dhaval Kapil
Dhaval Kapil <[hidden email]> wrote:
> It is still in its development stage, suggestions and improvements are
> most welcome!

Looking at the GitHub page, I have one quick suggestion. The "Requirements"
section of your README assumes a Debian, or Debian-like, environment, but
lua is used on all sorts of machines. Perhaps try to make the README more
neutral.

> I would be very grateful if people try it and report back any bugs.

I look forward to trying this out. Thanks for making it available.

Best, Peter
--
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Dhaval Kapil
Yes I did go through that link. I am using a similar approach. I just tried to automate things and make the developer to focus more on his project rather than on lua/luarocks switching.

I have currently tested it on Debian but would soon extend support to other environments as well.

Thanks!

On Monday, May 23, 2016, Peter Aronoff <[hidden email]> wrote:
Dhaval Kapil <<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;me@dhavalkapil.com&#39;)">me@...> wrote:
> It is still in its development stage, suggestions and improvements are
> most welcome!

Looking at the GitHub page, I have one quick suggestion. The "Requirements"
section of your README assumes a Debian, or Debian-like, environment, but
lua is used on all sorts of machines. Perhaps try to make the README more
neutral.

> I would be very grateful if people try it and report back any bugs.

I look forward to trying this out. Thanks for making it available.

Best, Peter
--
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System



--
Dhaval Kapil

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Ulrich Schmidt
In reply to this post by Dhaval Kapil
Github page say:

curl
https://raw.githubusercontent.com/DhavalKapil/luavm/master/install.sh -o
install.sh && . ./install.sh

may be better =>

curl
https://raw.githubusercontent.com/DhavalKapil/luavm/master/install.sh -o
install.sh && chmod +x ./install.sh && . ./install.sh

Ulrich.

Am 22.05.2016 um 23:02 schrieb Dhaval Kapil:

> Hello, everyone!
>
> 'luavm' is a version manager for Lua.
>
> https://github.com/DhavalKapil/luavm
>
> Recently, I was working in lua and needed to switch between different
> versions frequently. This caused me various issues, like reinstalling
> versions of lua, reinstalling luarocks to with the new lua versions,
> etc. I even messed up with my installation somehow. To help deal with
> these problems and being inspired by the usefulness of 'nvm'(Node
> Version Manager) and 'rvm'(Ruby Version Manager) I decided to develop
> 'luavm'.
>
> Features:
>
> 1. luavm helps to install multiple versions of Lua, LuaJIT, and Luarocks.
> 2. It helps to switch between these versions easily. At a particular
> time, only one version is in use.
> 3. The developer directly uses the commands 'lua', 'luajit' and
> 'luarocks' without worrying about anything.
> 4. Consistency is maintained between Luarocks and Lua. i.e. changing lua
> version also changes the luarocks version without any glitches.
>
> My main motive was to remove from the programmer, the burden of managing
> different versions.
>
> You can learn more about luavm by going to the above-mentioned link.
>
> It is still in its development stage, suggestions and improvements are
> most welcome!
> I would be very grateful if people try it and report back any bugs.
>
> Thanks!
> --
> Dhaval Kapil
> dhavalkapil.com <https://dhavalkapil.com/>

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Vadim A. Misbakh-Soloviov
> may be better =>
>
> curl
> https://raw.githubusercontent.com/DhavalKapil/luavm/master/install.sh -o
> install.sh && chmod +x ./install.sh && . ./install.sh

There is sourcing, not executing. So, adding executing bit is unnecessarily
// Although, I anyway very dislike such `curl | sh` installers

--
wbr,
mva

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Peter van Dijk
In reply to this post by Dhaval Kapil
Hello,

On 22 May 2016, at 23:02, Dhaval Kapil wrote:

> 'luavm' is a version manager for Lua.
>
> https://github.com/DhavalKapil/luavm

I recently ran into https://github.com/mpeterv/hererocks which might
also be interesting to anyone facing these issues.

(I have not looked at either so I have no opinions on the matter).

Kind regards,
--
Peter van Dijk
PowerDNS.COM BV - https://www.powerdns.com/

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Hisham
In reply to this post by Dhaval Kapil
On 22 May 2016 at 18:02, Dhaval Kapil <[hidden email]> wrote:
> Hello, everyone!
>
> 'luavm' is a version manager for Lua.

This might be a silly remark, but... my first reaction is that the
name 'luavm' will cause confusion (especially in spoken
conversation!). LVM is also confusing (the Logical Volume Manager
comes to mind). Might I suggest luaenv? Or lenv, if that's too long?

And kudos for the tool! I see a lot of potential for wide adoption.

-- Hisham

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Etiene Dalcol

Seconded,  not to mention there are other tools already called Luavm too, like Luavm.js :)

Props for the tool!

On 24 May 2016 7:39 p.m., "Hisham" <[hidden email]> wrote:
On 22 May 2016 at 18:02, Dhaval Kapil <[hidden email]> wrote:
> Hello, everyone!
>
> 'luavm' is a version manager for Lua.

This might be a silly remark, but... my first reaction is that the
name 'luavm' will cause confusion (especially in spoken
conversation!). LVM is also confusing (the Logical Volume Manager
comes to mind). Might I suggest luaenv? Or lenv, if that's too long?

And kudos for the tool! I see a lot of potential for wide adoption.

-- Hisham

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Coda Highland
In reply to this post by Hisham
On Tue, May 24, 2016 at 10:38 AM, Hisham <[hidden email]> wrote:

> On 22 May 2016 at 18:02, Dhaval Kapil <[hidden email]> wrote:
>> Hello, everyone!
>>
>> 'luavm' is a version manager for Lua.
>
> This might be a silly remark, but... my first reaction is that the
> name 'luavm' will cause confusion (especially in spoken
> conversation!). LVM is also confusing (the Logical Volume Manager
> comes to mind). Might I suggest luaenv? Or lenv, if that's too long?
>
> And kudos for the tool! I see a lot of potential for wide adoption.
>
> -- Hisham
>

Other options I'll present for consideration include "luaver" and "luamgr".

/s/ Adam

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Dhaval Kapil
In reply to this post by Etiene Dalcol
Well, I too was confused regarding the name. I wanted it to end with 'vm' so as it's easier for people to recognize it as a 'version manager'. There is a huge number of people who have used 'rvm' and 'nvm'. Naturally I couldn't choose 'lvm' as it conflicted as mentioned above. Almost every machine has lvm already installed.

For example, I personally wasn't able to find anything when I search for 'Lua Version Manager'.
Now I see there are other implementation as well, which I couldn't find on account of their name.

So now I realize there will be some confusion either way.

Thanks for your suggestions, I'll think more over it!


On Wed, May 25, 2016 at 12:09 AM, Etiene Dalcol <[hidden email]> wrote:

Seconded,  not to mention there are other tools already called Luavm too, like Luavm.js :)

Props for the tool!

On 24 May 2016 7:39 p.m., "Hisham" <[hidden email]> wrote:
On 22 May 2016 at 18:02, Dhaval Kapil <[hidden email]> wrote:
> Hello, everyone!
>
> 'luavm' is a version manager for Lua.

This might be a silly remark, but... my first reaction is that the
name 'luavm' will cause confusion (especially in spoken
conversation!). LVM is also confusing (the Logical Volume Manager
comes to mind). Might I suggest luaenv? Or lenv, if that's too long?

And kudos for the tool! I see a lot of potential for wide adoption.

-- Hisham




--
Dhaval Kapil
Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Javier Guerra Giraldez
On 24 May 2016 at 20:26, Dhaval Kapil <[hidden email]> wrote:
> There is a huge number of people who have used 'rvm' and 'nvm'.


in your place, i'd avoid any relation with 'nvm' like that plage

--
Javier

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Michal Kottman
In reply to this post by Dhaval Kapil

On May 24, 2016 21:27, "Dhaval Kapil" <[hidden email]> wrote:
> Well, I too was confused regarding the name. I wanted it to end with 'vm' so as it's easier for people to recognize it as a 'version manager'.

I probably have a different background, but to me, 'VM' always meant 'virtual machine', and I initially though that your lib would expose the internals of Lua as a library or something like that. IMHO using 'luaenv' or 'lenv' would be a better idea, since the goal is to start in a 5.x Lua+LuaRocks "environment".

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Jay Mithani
On May 25, 2016, at 5:48 AM, Michal Kottman <[hidden email]> wrote:

On May 24, 2016 21:27, "Dhaval Kapil" <[hidden email]> wrote:
> Well, I too was confused regarding the name. I wanted it to end with 'vm' so as it's easier for people to recognize it as a 'version manager'.

I probably have a different background, but to me, 'VM' always meant 'virtual machine'

My thoughts exactly. I think that the acronym 'VM' is too overloaded to have a clear meaning.
Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Peter Melnichenko-2
In reply to this post by Dhaval Kapil
On Mon, May 23, 2016 at 12:02 AM, Dhaval Kapil <[hidden email]> wrote:
> Recently, I was working in lua and needed to switch between different
> versions frequently. This caused me various issues, like reinstalling
> versions of lua, reinstalling luarocks to with the new lua versions, etc. I
> even messed up with my installation somehow. To help deal with these
> problems and being inspired by the usefulness of 'nvm'(Node Version Manager)
> and 'rvm'(Ruby Version Manager) I decided to develop 'luavm'.

This looks great! Unfortunately it doesn't set LUA_PATH and LUA_CPATH
and it also doesn't add directory where LuaRocks puts scripts to PATH,
but that can be fixed by running 'eval `luarocks path --bin`' after switching to
a new environment.

hererocks (https://github.com/mpeterv/hererocks) was mentioned here
but it's not really a version manager, more of an installation script that
takes care of environment isolation. Personally I use it to install various
version combination into ~/lua51, ~/lj2, ~/lua53-nocompat, etc, then
add a default
like ~/lua53/bin to PATH in .bashrc and use other environments directly
when I need to, e.g. run ~/lua51/bin/lua or ~/lj2/bin/busted.

Perhaps luavm could use hererocks for build step to avoid having
to run 'eval `luarocks path --bin`' and to exploit some of its options,
like choosing compat flags, building without readline, etc.

--
Peter

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Roberto Ierusalimschy
In reply to this post by Jay Mithani
> > I probably have a different background, but to me, 'VM' always meant 'virtual machine'
> >
> My thoughts exactly. I think that the acronym 'VM' is too overloaded to have a clear meaning.

Not overloaded at all. VM *is* Virtual Machine. Period. :-)

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Peter Aronoff
In reply to this post by Peter Melnichenko-2
On Wednesday, May 25, 2016 at 04:03PM, Peter Melnichenko wrote:
> Perhaps luavm could use hererocks for build step to avoid having to run
> 'eval `luarocks path --bin`' and to exploit some of its options, like
> choosing compat flags, building without readline, etc.

I'm glad you brought this up. I wanted to suggest something similar, but
I wasn't quite sure how to put it.

During the years I wrote Ruby, I used and contributed to several
environment managing tools (rvm[1], rbenv[2], ry[3], rbfu[4], and
chruby[5]). Although not *everyone* agrees on the best approach, I think
it's not an accident that over time these tools became simpler and smaller.
In particular, after rvm, most Ruby version managers stopped bundling
installation and environment changing into one tool. (Most use either
ruby-build[6] or ruby-install[7] for the installation job.)

It might make good sense to use hererocks as a Lua install tool and then
only have luavm manage environment changing. There are a lot of potential
advantages to keeping tools smaller and more focused, both for users and
for the people maintaining them.

As for the name, I bet chlua isn't taken. ;)

Best, Peter

[1] https://github.com/rvm/rvm
[2] https://github.com/rbenv/rbenv
[3] https://github.com/jneen/ry
[4] https://github.com/hmans/rbfu
[5] https://github.com/postmodern/chruby
[6] https://github.com/rbenv/ruby-build
[7] https://github.com/postmodern/ruby-install

--
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Adrian Perez de Castro
In reply to this post by Peter Melnichenko-2
Quoting Peter Melnichenko (2016-05-25 15:03:58)

> On Mon, May 23, 2016 at 12:02 AM, Dhaval Kapil <[hidden email]> wrote:
> > Recently, I was working in lua and needed to switch between different
> > versions frequently. This caused me various issues, like reinstalling
> > versions of lua, reinstalling luarocks to with the new lua versions, etc. I
> > even messed up with my installation somehow. To help deal with these
> > problems and being inspired by the usefulness of 'nvm'(Node Version Manager)
> > and 'rvm'(Ruby Version Manager) I decided to develop 'luavm'.
>
> This looks great! Unfortunately it doesn't set LUA_PATH and LUA_CPATH
> and it also doesn't add directory where LuaRocks puts scripts to PATH,
> but that can be fixed by running 'eval `luarocks path --bin`' after switching to
> a new environment.
>
> hererocks (https://github.com/mpeterv/hererocks) was mentioned here
> but it's not really a version manager, more of an installation script that
> takes care of environment isolation. Personally I use it to install various
> version combination into ~/lua51, ~/lj2, ~/lua53-nocompat, etc, then
> add a default
> like ~/lua53/bin to PATH in .bashrc and use other environments directly
> when I need to, e.g. run ~/lua51/bin/lua or ~/lj2/bin/busted.
>
> Perhaps luavm could use hererocks for build step to avoid having
> to run 'eval `luarocks path --bin`' and to exploit some of its options,
> like choosing compat flags, building without readline, etc.
Something that I always wanted was something for Lua+LuaRocks which would be
the equivalent of virtualenv (for Python+Pip): using the Lua binaries and
library installed by the system package manager, and bootstrapping LuaRocks
into a separate directory, and then providing a way to “activate” one of
these separate directories (= environments).

A couple of months ago I decided to bite the bullet and implement RockZ [1],
which is a plugin for Zsh which allows to do things like:

  # Only needed once, for configuration

  % rockz profile default --lua=/usr/bin/lua \
                          --include=/usr/include \
                          --library=/usr/lib/liblua.so

  # Bootstraps a LuaRocks environment named “myproject” (into the
  # ~/.rockenvs/myproject directory) and activates it. LuaRocks will
  # install and manage packages inside the environment directory.

  % rockz new myproject
  % luarocks install busted
  % which lua luarocks
  /home/aperez/.rockenvs/myproject/bin/lua
  /home/aperez/.rockenvs/myproject/bin/luarocks
  % rockz deactivate  # Go back to the system-wide Lua+LuaRocks

  # Later on...

  % rockz activate    # Sets $PATH, $LUA_PATH, and $LUA_CPATH

Probably I should cut a release soon and send a proper announcement post to
the list... Also if there are enough people interested into a version that
works with Bash, it should be easy to port it (though I do not use Bash
myself much anymore, I could event try and help with it :P).

Cheers,

--
 ☛ Adrián

[1] https://github.com/aperezdc/rockz

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Introducing luavm - Lua Version Manager

Soni "They/Them" L.
In reply to this post by Roberto Ierusalimschy


On 25/05/16 10:04 AM, Roberto Ierusalimschy wrote:
>>> I probably have a different background, but to me, 'VM' always meant 'virtual machine'
>>>
>> My thoughts exactly. I think that the acronym 'VM' is too overloaded to have a clear meaning.
> Not overloaded at all. VM *is* Virtual Machine. Period. :-)
>
> -- Roberto
>
Lua Ver M, stylized LuaVerm, would be a better name.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.


123