[ANN] mc^2

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

[ANN] mc^2

Mooffie
mc^2 is a fork of Midnight Commander with Lua support:

    http://www.typo.co.il/~mooffie/mc-lua/docs/html/

...but let's skip the verbiage and go directly to the screenshots:

    http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/SCREENSHOTS.md.html

Now, I assume most of you here aren't users of MC.

So I won't bore you with description of how Lua makes MC a better
file-manager. Instead, I'll just list some details that may interest
any developer who works on extending some application.

And, as you'll shortly see, you may find mc^2 useful even if you
aren't a user of MC!

So, some interesting details:

* Programmer Goodies

  - You can restart the Lua system from within MC.

  - Since MC has a built-in editor, you can edit Lua code right there
    and restart Lua. So it's somewhat like a live IDE:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/game.png

  - It comes with programmer utilities: regular expressions; global scope
    protected by default; good pretty printer for Lua tables; calculator
    where you can type Lua expressions; the editor can "lint" Lua code (and
    flag uses of global variables).

  - It installs a /usr/bin/mcscript executable letting you use all the
    goodies from "outside" MC:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/60-standalone.md.html

* User Interface programming (UI)

  - You can program a UI (user interface) very easily. The API is fun
    yet powerful. It has some DOM/JavaScript borrowings in it: you can
    attach functions to events like on_click, on_change, etc. The API
    uses "properties", so your code tends to be short and readable:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/40-user-interface.md.html

  - The UI has a "canvas" object letting you draw your own stuff. The
    system is so fast you can program arcade games. Pacman, Tetris,
    Digger, whatever:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/classes/ui.Canvas.html

    Need timers in your game? You've got them:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/modules/timer.html

  - This UI API is an ideal replacement for utilities like dialog(1).
    You can write complex frontends to command-line tools with ease:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/frontend-scanimage.png

  - Thanks to the aforementioned /usr/bin/mcscript, you can run your
    games/frontends from "outside" MC:

      http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/standalone-game.png

* Misc

  - You can compile it against Lua 5.1, 5.2, 5.3, or LuaJIT.

  - Extensive documentation.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Jorge Visca
On 15/10/15 13:13, Mooffie wrote:
> Now, I assume most of you here aren't users of MC.

NC >> XTree

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Leo Romanoff
In reply to this post by Mooffie
mc^2 looks really cool! Is there any chance you would provide pre-built binary for most popular Linux distros and for OS X?

Performing a build on a Linux system is not a big deal. But on OS X it is way more annoying, because most of the dependencies are not available out-of-the-box and installing them is not as easy as on Linux systems.

If providing pre-built binaries is not an option, could you provide more details about building mc^2 on OS X?

Thanks!

-Leo
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Nagaev Boris
In reply to this post by Mooffie
On Thu, Oct 15, 2015 at 7:13 PM, Mooffie <[hidden email]> wrote:

> mc^2 is a fork of Midnight Commander with Lua support:
>
>     http://www.typo.co.il/~mooffie/mc-lua/docs/html/
>
> ...but let's skip the verbiage and go directly to the screenshots:
>
>     http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/SCREENSHOTS.md.html
>
> Now, I assume most of you here aren't users of MC.
>
> So I won't bore you with description of how Lua makes MC a better
> file-manager. Instead, I'll just list some details that may interest
> any developer who works on extending some application.
>
> And, as you'll shortly see, you may find mc^2 useful even if you
> aren't a user of MC!
>
> So, some interesting details:
>
> * Programmer Goodies
>
>   - You can restart the Lua system from within MC.
>
>   - Since MC has a built-in editor, you can edit Lua code right there
>     and restart Lua. So it's somewhat like a live IDE:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/game.png
>
>   - It comes with programmer utilities: regular expressions; global scope
>     protected by default; good pretty printer for Lua tables; calculator
>     where you can type Lua expressions; the editor can "lint" Lua code (and
>     flag uses of global variables).
>
>   - It installs a /usr/bin/mcscript executable letting you use all the
>     goodies from "outside" MC:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/60-standalone.md.html
>
> * User Interface programming (UI)
>
>   - You can program a UI (user interface) very easily. The API is fun
>     yet powerful. It has some DOM/JavaScript borrowings in it: you can
>     attach functions to events like on_click, on_change, etc. The API
>     uses "properties", so your code tends to be short and readable:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/40-user-interface.md.html
>
>   - The UI has a "canvas" object letting you draw your own stuff. The
>     system is so fast you can program arcade games. Pacman, Tetris,
>     Digger, whatever:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/classes/ui.Canvas.html
>
>     Need timers in your game? You've got them:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/modules/timer.html
>
>   - This UI API is an ideal replacement for utilities like dialog(1).
>     You can write complex frontends to command-line tools with ease:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/frontend-scanimage.png
>
>   - Thanks to the aforementioned /usr/bin/mcscript, you can run your
>     games/frontends from "outside" MC:
>
>       http://www.typo.co.il/~mooffie/mc-lua/docs/html/images/screenshots/standalone-game.png
>
> * Misc
>
>   - You can compile it against Lua 5.1, 5.2, 5.3, or LuaJIT.
>
>   - Extensive documentation.
>


Hi,

can I install it using luarocks?


--


Best regards,
Boris Nagaev

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Mooffie
On 10/16/15, Nagaev Boris <[hidden email]> wrote:
> On Thu, Oct 15, 2015 at 7:13 PM, Mooffie <[hidden email]> wrote:
>> mc^2 is a fork of Midnight Commander with Lua support:
>
> can I install it using luarocks?

No, sorry.

mc has its own build system and it depends on software outside the Lua
ecosystem. Encapsulating all the required knowledge in a luarock would
place a lot of burden on me which I couldn't take.

Your question would have made a lot of sense if I provided the UI
subsystem as a Lua module that's independent of mc. Naturally luarocks
would be an excellent choice then. But this is not currently the case.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Mooffie
In reply to this post by Leo Romanoff
On 10/16/15, Leo Romanoff <[hidden email]> wrote:
> mc^2 looks really cool! Is there any chance you would provide
> pre-built binary for most popular Linux distros and for OS X?

No, sorry. I don't have resources for that.

> If providing pre-built binaries is not an option,
> could you provide more details about building mc^2 on OS X?

I'm not familiar with OS X, but any document explaining how to build
the plain vanilla mc will suit you. mc^2 changes nothing in the build
procedure (except for adding a switch to enable Lua, explained in the
"Installation" page on the site). If you manage to build mc but not
mc^2, drop me a line and I'll see if I can help.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Leo Romanoff


On Fri, Oct 16, 2015 at 7:31 AM, Mooffie <[hidden email]> wrote:
On 10/16/15, Leo Romanoff <[hidden email]> wrote:
> mc^2 looks really cool! Is there any chance you would provide
> pre-built binary for most popular Linux distros and for OS X?

No, sorry. I don't have resources for that.

I see.
 

> If providing pre-built binaries is not an option,
> could you provide more details about building mc^2 on OS X?

I'm not familiar with OS X, but any document explaining how to build
the plain vanilla mc will suit you. mc^2 changes nothing in the build
procedure (except for adding a switch to enable Lua, explained in the
"Installation" page on the site). If you manage to build mc but not
mc^2, drop me a line and I'll see if I can help.


I usually install mc on OS X using brew. I simply issue the "brew install mc" command and it installs it.
The Brew formula for mc can be found here: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/midnight-commander.rb

It basically tells brew to download a tar.gz archive with the source code from a given URL and then run "configure" with certain arguments to configure it and then "make install".  

The interesting thing is: The mentioned official source code archive at http://ftp.midnight-commander.org/mc-4.8.14.tar.xz contains a "configure" script already and it is good enough to be used on OS X. But your branch on github does not contain "configure" and trying to produce it with "autogen"  results in different kinds of errors (e.g. it complains about gettext, etc). So, I'm wondering if you could provide a "configure" script in your repo (may be along the lines of the configure script from the official tarball mentioned above), so that your branch of "mc" can be built the same way as the standard version.

Thanks,
  Leo
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Mooffie
On 10/19/15, Leo Romanoff <[hidden email]> wrote:
> On Fri, Oct 16, 2015 at 7:31 AM, Mooffie <[hidden email]> wrote:
> > I'm not familiar with OS X, but any document explaining how to build
> > the plain vanilla mc will suit you.
> [...]
> your branch on github does not contain "configure"

Repositories don't normally contain auto-generated files like
'configure' and a few others. Such files do get contained in something
called a "tarball", which are the tar.gz archives you've seen.

Good news: you can now download a tarball of mc^2.

I've updated the "Installation" document.[1] It now has an info-box at
"Step 3" with a link to the tarball.

[1] http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/80-installation.md.html

> I usually install mc on OS X using brew. [...]
> The Brew formula for mc can be found here:
> https://github.com/Homebrew/homebrew/blob/master/Library/Formula/midnight-commander.rb

Thanks for the pointer. Based on that script I think we're almost at
the finish line. All you need to do is add "--with-lua" to
'configure's invocation. It'd then detect Lua's existence by using the
'pkg-config' binary. If you encounter problems, let me know the output
of 'configure' and the output of:

pkg-config --list-all | grep lua

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Leo Romanoff
On Mon, Oct 19, 2015 at 1:48 AM, Mooffie <[hidden email]> wrote:
On 10/19/15, Leo Romanoff <[hidden email]> wrote:
> On Fri, Oct 16, 2015 at 7:31 AM, Mooffie <[hidden email]> wrote:
> > I'm not familiar with OS X, but any document explaining how to build
> > the plain vanilla mc will suit you.
> [...]
> your branch on github does not contain "configure"

Repositories don't normally contain auto-generated files like
'configure' and a few others. Such files do get contained in something
called a "tarball", which are the tar.gz archives you've seen.

Good news: you can now download a tarball of mc^2.

I've updated the "Installation" document.[1] It now has an info-box at
"Step 3" with a link to the tarball.


Thanks a lot! It helps.
 
[1] http://www.typo.co.il/~mooffie/mc-lua/docs/html/guide/80-installation.md.html

> I usually install mc on OS X using brew. [...]
> The Brew formula for mc can be found here:
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/midnight-commander.rb

Thanks for the pointer. Based on that script I think we're almost at
the finish line. All you need to do is add "--with-lua" to
'configure's invocation. It'd then detect Lua's existence by using the
'pkg-config' binary. If you encounter problems, let me know the output
of 'configure' and the output of:

pkg-config --list-all | grep lua

I was able to build MC^2 now using brew and providing LUA_LIBS and LUA_CFLAGS. I tried with lua5.2 installed by means of "brew install lua".  The built MC is able to start and seems to work in general. 

But there are some issues:
- I cannot use a sub-shell, when I use Ctrl-O. The panels disappear, but I do not see the shell prompt and cannot use it. Do you have any ideas why this could happen?

- Some key combinations do not work. But this is most likely an OSX issue.

BTW, are you planning to provide a dedicated way to ask questions and file issues for MC^2? Using this list for this purpose is probably not the best idea.

Thanks again,
  Leo
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] mc^2

Mooffie
On 10/19/15, Leo Romanoff <[hidden email]> wrote:
> I was able to build MC^2 now using brew and providing LUA_LIBS and LUA_CFLAGS.

Great.

> But there are some issues:
> - I cannot use a sub-shell, when I use Ctrl-O.

I'd start troubleshooting by googling "midnight commander subshell os x".

You may want to ask this on mc's mailing list. (It's best not to
mention "mc^2" because it's most likely irrelevant; mc^2 is just a
branch of mc-4.8.14, which is the latest version.)

Some issues you may want to check first:

- When you do "mc -V", do you see "With subshell support as default"?
- Do you see the full prompt inside mc, or just a single "$"?
- Does a Homebrew installed mc exhibit this problem? Download the
tarball they're using (mc-4.8.14.tar.xz) and compile it the same way
you compiled mc^2: does it exhibit the same subshell problem?
- If the answer to the question above is negative: does compiling mc^2
without "--with-lua" exhibit the subshell problem? (if it doesn't, I'd
like to know.)
- Are you using a compatible shell? A compatible terminal? (as per mc's FAQ)

> are you planning to provide a dedicated way to ask
> questions and file issues for MC^2?

Email me directly, or ask on mc's mailing list (I'm there). There are
only 1 known persons who are using mc^2, including myself, and now
there may be 2, so... there isn't yet a need to even start thinking
about some "dedicated way" ;-)