Easiest way to compile a lua script (*.exe)...? - compilation

I just made a small program and I'd like to share it with my friends and family.
Which is the best, the fastest and the easiest way to compile a Lua script?
I'm working on Windows, so I would need a *.exe.
Thanks in advance.

If you want to turn your Lua script into a .exe, try srlua.

Related

Remote Debugging Hosted Lua

I am using Lua 5.3, hosting it in a C++ application. The C++ application provides various functions to a running Lua script. I would like to allow users to debug their Lua, while it is running in my application. I believe this is possible, but I can not find any recent information on doing this, only for older versions of Lua and this does not seem to work.
Can anyone please help me to get debugging a Lua script running under my application up and running? Any help would be greatly appreciated.
Thank you!
The easiest way that I know of is to use ZeroBrane's remote debugging capabilities. Their document explains it pretty nicely, but for the sake of self-containment:
Set your embedded Lua's path/cpath to zerobrane's stuff, or copy the mobdebug.lua file to your sources.
Add require('mobdebug').start() to the beginning of your code
You should be able to debug now. After you start your program, breakpoints set in the Lua sources should get hit.
This approach works best if you use ZB to edit your Lua files, which implies using a different editor for the C++ part. I found this to work reasonably well in practice, though.

What's the best way to write cross platform scripts, like bash in unix?

TL;DR: Whats the most optimal way to write portable general-purpose automation scripts for Windows, Mac and Linux?
Longer version:
I work with different platforms and often write shell scripts to automate things (run programs and other scripts, manipulate files and directories, etc).
The problem is that sh/bash substitutes on Windows are tricky, complex, often incompatible or lack some native unix tools. And cygwin scares a regular user, in case when I share some of my scripts with the others.
I find that .bat is very limited and ugly. And I didn't use Powershell a lot, but it looks a bit overcomplicated to me (or should I just give it another try?).
What would you recommend to do in such case? Have you had similar challenges, how did you solve them?
I would advice you use some configuration manager as Ansible, Puppet or Chef. Since their sole purpose is to automate things, and some of them are cross platform. Google each one I mentioned, scripts are generally easy to write in them and they will work on all the platforms, but you will need to install the manager itself on each platform, which can be achieved with init.sh or with a simple powershell script.

Is there a less compiler that works on windows and has an interactive mode?

I really like the sass -i command, it lets me compile bits of sass and see the result without having to run the whole file. Is there a less compiler out there that has this same functionality? I'm on win7.
Use WinLess
WinLess is a Windows GUI for LESS.js. WinLess is a must-have for the webdeveloper who uses Windows. Its has online as well.
Online LESS Compiler
good luck!
It sounds like you're looking for a "Fiddle for C/C++".
There's always codepad:
http://codepad.org/
Or IdeaOne:
http://ideone.com/

How do I deliver (distribute) a Perl application?

I wrote a program in Perl, and now I want to send it to buddy. I don't want him having any kind of bother with launching it.
How do I make some package which he can just click and have all things ready to launch?
PS. I can ask him to download ActivePerl and install it beforehand.
PPS. I don't need to hide .pl sources from him. I need though automatic download and install of all required CPAN modules.
Also, what if in future I will need to scale it for production delivery? Meaning, it will be not a buddy on the receiving side, but Mr. Client?
I have used pp with great success. It can package a Perl interpreter and used modules all together into an executable file.
Then again there is always B::C which provides a perlcc utility, but I haven't had as much luck with that.
For easy distribution to windows clients, its hard to beat PerlApp, Par::Packer (aka pp), or Cava Packager.
Although I like Joel's suggestion best I'd want to point out another solution for you. As it seems you're targeting Windows you could also use the portable version of Strawberry Perl. Install the modules you need, add your script/application to it, setup a simple batch script to launch it with the portable environment and you're set.
The biggest downside compared to the pp (PAR::Packer) solution is that the size of your application will be rather big as pp only includes that what is necessary.
You might be looking for IndigoStar's perl2exe:
Perl2Exe is a command line program for converting Perl scripts to executable files. This allows you to create stand alone programs in Perl that do not require the Perl interpreter. You can ship the executable files without having to ship your Perl source code. Perl2Exe can generate executables for Windows and Unix target hosts.
Of course, the easiest way would be if your clients could run perl.
Yoy may wish to try Cava Packager. It can produce executables from Perl code on Windows, Linux and Mac OS X. It takes an alternative approach to PerlApp, pp and perl2exe. You should probably try them all and decide which you like best.
Note: As indicated by my name, I am affiliated with Cava Packager.
Par::Packer will do the job for you, without any fuss and is completely free. As long as you have installed the correct dependencies, you simply (on a windows machine) open a command prompt, CD into the directory where your perl source (e.g. 'samplefile.pl') resides and type: pp -o sampleprogram.exe samplefile.pl. After a minute or so, 'samplefile.exe' is compiled, and you can send it to your friend to run
Perl2Exe is a proprietary solution, and although it is good, is not free
Good luck!

Is there a program to enumerate windows?

I'm having problems with a third-party program which is using FindWindow() to find if another process is started.
Where can I find an already-compiled program which enumerate windows (using EnumWindow()) so that I can quickly find what's going wrong ?
Have you tried Spy++?
Or if you need a free alternative, try Winspy++, Minispy or Winspector

Resources