Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ The project uses Hedgehog for property-based testing:
edit `compiler-nix-name` / `easy-ps.purs-*` in `flake.nix`.
2. PureScript package sets live in `test/ps/packages.dhall` as
`upstream-ps // upstream-lua`. The right operand wins: `upstream-lua`
(releases of `Unisay/purescript-lua-package-sets`) overrides core
(releases of `purescript-lua/purescript-lua-package-sets`) overrides core
packages with Lua forks that ship `.lua` FFI files.
3. After changing package sets or `purs`: `cd test/ps && spago build -u
'-g corefn'`, then `cabal test all`. Drop the `sha256:` annotations
Expand All @@ -311,7 +311,7 @@ The project uses Hedgehog for property-based testing:

- **`unit` must not be `nil`**: Lua tables cannot hold `nil` values, so
`Array Unit` silently collapses to an empty table if the prelude defines
`unit = nil`. Requires `Unisay/purescript-lua-prelude` ≥ v7.2.0, where
`unit = nil`. Requires `purescript-lua/purescript-lua-prelude` ≥ v7.2.0, where
`unit = {}`. If eval goldens for unit arrays start printing `0`, a
package set downgraded the prelude — do not accept such goldens.
- A generated-Lua change that only passes `luacheck` is not verified:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Purescript Backend for Lua

[![Purescript Lua CI](https://github.com/Unisay/purescript-lua/actions/workflows/ci.yaml/badge.svg)](https://github.com/Unisay/purescript-lua/actions/workflows/ci.yaml)
[![Purescript Lua CI](https://github.com/purescript-lua/purescript-lua/actions/workflows/ci.yaml/badge.svg)](https://github.com/purescript-lua/purescript-lua/actions/workflows/ci.yaml)

🔋 Status: (2024-04-20) the project is in the "_ready to be experimented with_" state (read: it likely contains bugs but is already usable).

💡 If you have an idea on how to use Purescript to Lua compilation please contribute it here:
https://github.com/Unisay/purescript-lua/discussions/categories/ideas
https://github.com/purescript-lua/purescript-lua/discussions/categories/ideas

## Features

- [x] Lua code bundling: emits either a Lua module (a file that returns a table with functions) or an application (a file that executes itself).
- [x] FFI with Lua.
- [x] Dead Code Elimination (DCE).
- [x] Code inlining.
- [x] [Package Set](https://github.com/Unisay/purescript-lua-package-sets) for PureScript/Lua libs.
- [x] [Package Set](https://github.com/purescript-lua/purescript-lua-package-sets) for PureScript/Lua libs.
- [x] All core libs added to the package set.

## Quick Start
Expand Down Expand Up @@ -56,23 +56,23 @@ Assuming that `pslua` executable is already available on your PATH
### Using nix with flakes

```
nix run 'github:Unisay/purescript-lua' -- --help
nix run 'github:purescript-lua/purescript-lua' -- --help
```

## Installation

If you're on a x86 64bit Linux system then you can download a pre-built executable from the [releases](https://github.com/Unisay/purescript-lua/releases) page:
If you're on a x86 64bit Linux system then you can download a pre-built executable from the [releases](https://github.com/purescript-lua/purescript-lua/releases) page:

```
wget -c https://github.com/Unisay/purescript-lua/releases/download/0.1.1-alpha/pslua-linux_x86_64.tar.gz -O - | tar -xz
wget -c https://github.com/purescript-lua/purescript-lua/releases/download/0.1.1-alpha/pslua-linux_x86_64.tar.gz -O - | tar -xz
```

alternatively,

### Using nix with flakes

```
nix profile install 'github:Unisay/purescript-lua'
nix profile install 'github:purescript-lua/purescript-lua'
```

will make `pslua` executable available for use.
Expand Down
2 changes: 1 addition & 1 deletion test/ps/golden/Golden/StringCodePoints/Test.purs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Exercises Data.String.CodePoints end to end on the released package set
-- (Unisay/purescript-lua-strings v6.2.0). The test string mixes UTF-8 widths
-- (purescript-lua/purescript-lua-strings v6.2.0). The test string mixes UTF-8 widths
-- 1..4: 'a' (1 byte), 'é' (2), 'Я' (2, Cyrillic), '𝐀' (4, astral), 'z' (1).
-- Output is all Ints/Bools via fromEnum so the golden stays ASCII and does
-- not depend on how strings are shown.
Expand Down
2 changes: 1 addition & 1 deletion test/ps/packages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let upstream-ps =
sha256:e48c9b283ca89ec994453459fb74c4b5b5a9432349f83a2e104f39dd869a0f6e

let upstream-lua =
https://github.com/Unisay/purescript-lua-package-sets/releases/download/psc-0.15.15-20260613-2/packages.dhall
https://github.com/purescript-lua/purescript-lua-package-sets/releases/download/psc-0.15.15-20260613-2/packages.dhall
sha256:b006e1fd8aa8cd290faf65852f37f62ad3bf5fe97fa3a7c30c97ff7ddfa49807

in upstream-ps // upstream-lua
Loading