[HN Gopher] LuaX - Lua interpreter, REPL, and useful packages
       ___________________________________________________________________
        
       LuaX - Lua interpreter, REPL, and useful packages
        
       Author : adius
       Score  : 50 points
       Date   : 2024-05-26 11:37 UTC (11 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | EligibleDecoy wrote:
       | So this lets you essentially run Lua standalone, and then compile
       | those scripts into executables. Seems like a mix of Cython and
       | bash. In going to give it a try, it might fill a niche of some
       | dev tool scripts I make for the team.
        
         | AstroJetson wrote:
         | Look at what Justine Tunny did with Redbean.
         | 
         | https://justine.lol/redbean2/
         | 
         | Lua plus lots of "Unix" support in a exe/zip that runs on 6
         | different OS setups.
        
       | synergy20 wrote:
       | luac can compile lua code,how different is luaX?
        
         | JonChesterfield wrote:
         | This is probably compiling to bytecode (like luac) and bundling
         | the result with the lua interpreter as an executable. Doing the
         | latter by hand involves writing a very small C program that
         | passes a static char array to the lua entry point - I think
         | this is nicely packaging that process.
         | 
         | It might be compiling to native code instead but the readme
         | doesn't look like it.
        
           | incanus77 wrote:
           | Janet puts together "executables" like this as well, which is
           | a pretty slick setup.
        
             | synergy20 wrote:
             | Janet has nothing to do with Lua though, am I missing
             | something
        
       | apitman wrote:
       | > The script bootstrap.sh installs ninja, zig and compiles LuaX
       | 
       | I think we're going to see more build instructions like this as
       | time goes on. Zig installs are simple, self-contained, don't
       | require root to install, and automatically handle C/C++ cross-
       | compilation like magic. I suspect long term these benefits will
       | put Zig in a position to become the best build tool for C/C++
       | projects. If you're already using it for your compiler, you might
       | as well use it to write your build scripts.
        
         | samatman wrote:
         | And if you're already using zig cc to compile your C project,
         | you might as well write the next module in Zig. I know of no
         | other language which makes it quite so easy to produce
         | C-compatible object code. Some of that is the design of the
         | language itself, but a great portion of it is providing native
         | C and C++ compilation, with a good build system and an
         | excellent cross-compilation experience.
         | 
         | Projects which rely heavily on this feature are a bit nervous
         | about the plans to break the LLVM dependency, but using the Zig
         | toolchain this way is too important to the goals of the
         | language to screw that part up.
        
         | benatkin wrote:
         | If you want it to interact well with a couple of _really_
         | popular languages there 's this:
         | 
         | https://github.com/mlua-rs/mlua
         | 
         | Rust and through Deno, JavaScript.
         | 
         | It also supports Luau which has sandboxing. https://luau-
         | lang.org/sandbox
        
       | BugsJustFindMe wrote:
       | > _Lua interpreter and REPL based on Lua 5.4_
       | 
       | Lua already is this. I don't understand.
       | 
       | > _augmented with some useful packages_
       | 
       | How is this better than using LuaRocks?
        
         | benatkin wrote:
         | > How is this better than using LuaRocks?
         | 
         | Batteries included. If everything you need is included, you can
         | pass around scripts to other users / computers without having
         | to install anything
        
       | saddat wrote:
       | Dumb question: really compiled code , non plain readable anymore
       | ?
        
       ___________________________________________________________________
       (page generated 2024-05-26 23:02 UTC)