Status: (2023-07-05) the project is in the "ready to be experimented with" state (read: it likely contains bugs but is already usable).
- Lua code bundling: emits either a Lua module or "App".
- FFI with Lua.
- Dead Code Elimination (DCE).
- Code inlining.
- Package Set for PureScript/Lua libs.
- All core libs added to the package set.
For the moment the best way to start is to use nix to intall pslua.
Here is an example project.
If you use Spago to build your PureScript project, then you can configure pslua as a custom backend like this:
spago.dhall
Assuming that pslua executable is already available on your PATH
{ name = "acme-project"
, dependencies = [ "effect", "prelude" ]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs" ]
, backend =
''
pslua \
--foreign-path . \
--ps-output output \
--lua-output-file dist/acme.lua \
--entry Acme.Main
''
}nix run 'github:Unisay/purescript-lua' -- --help
nix profile install 'github:Unisay/purescript-lua'
will make pslua executable available for use.