Open Jan69 opened 1 year ago
and of course, on windows, and mac, compiling stuff might be a bit troublesome anyway, since LuaRocks really wants to use gcc, I had to specifically download gcc for windows, to get it to compile correctly, because the clang I had didn't support dynamic linking for god-knows-why
For this use case I would probably advise to setup Candran properly on your development computer, and compile your Candran files to regular Lua files when you want to run them in an environment without Candran, just like you would compile your program before running it for any compiled language. At least that's what I've been doing for my projects when I want to ship them without any native module for portability reasons. With a Makefile or some script that re-compile every candran file in my project directory for convenience.
But of course, if the pure-Lua implementations of lpeg
work, I don't see a reason not use them as a fall-back to make setup easier. It's a bit of a shame that they don't support lpeglabel
though, that will make syntax error messages a lot more cryptic, but oh well.
It will probably require a fair amount of work to adapt the current code to that though, and I won't have much free time right now I'm afraid (if you have the courage and the time for a PR, all the lpeg
stuff is in parser.lua :) otherwise I'll probably get to it in a couple weeks).
ok, alhough using effectively lpeg 0.12 would be a big downgrade, I'm happy you're at least considering eventually dealing with it, I'm not really that good with lua yet, myself...also, as the file comments,
This module implements a parser for Lua 5.3 with LPeg,and generates an Abstract Syntax Tree that is similar to the one generated by Metalua.
so why not use Metalua itself as fallback? (or the koneki project's archive)
lpeglabel
requires compilation, and support for native modules, while there are several alternative lua implementations, such as gopher-lua, which don't support compiled native modulesalthough I don't know of any pure-lua
lpeglabel
implementations, there are a couple of lua-basedlpeg
implementations, though, such as LuLPeg(emulates LPeg v0.12) and LPegLJ(LPeg v1.0, but for LuaJIT 2.x, so doesn't really count)my use-case would be with Algernon web server, which embeds
gopher-lua
, so I don't need to also have a separate copy of "normal lua" to use candran with