lua: Lua, an embeddable scripting language

[ foreign, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

This package provides bindings and types to bridge Haskell and Lua.

The full Lua interpreter version 5.4.7 is included. Alternatively, a system-wide Lua installation can be linked instead.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
system-lua

Use the system-wide Lua instead of the bundled copy.

Disabled
apicheck

Compile Lua with -DLUA_USE_APICHECK.

Disabled
lua_32bits

Compile Lua with -DLUA_32BITS

Disabled
allow-unsafe-gc

Allow optimizations which make Lua's garbage collection potentially unsafe; enabling this should be safe if there are no callbacks into Haskell during Lua garbage collection cycles. The flag should be *disabled* if Lua objects can have Haskell finalizers, i.e., __gc metamethods that call Haskell function.

Enabled
export-dynamic

Add all symbols to dynamic symbol table; disabling this will make it possible to create fully static binaries, but renders loading of dynamic C libraries impossible.

Enabled
pkg-config

Use pkg-config to discover library and include paths. Setting this flag implies `system-lua`.

Disabled
cross-compile

Avoids constructs that would prevent cross-compilation. The Lua version constants may become inaccurate when this flag is enabled.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0, 2.0.0, 2.0.0.1, 2.0.1, 2.0.2, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1, 2.3.2, 2.3.3
Change log CHANGELOG.md
Dependencies base (>=4.11 && <5) [details]
Tested with ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.2, ghc ==9.2.8, ghc ==9.4.8, ghc ==9.6.5, ghc ==9.8.2, ghc ==9.10.1
License MIT
Copyright © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan; © 2017-2024 Albert Krewinkel
Author Albert Krewinkel
Maintainer Albert Krewinkel <tarleb@hslua.org>
Category Foreign
Home page https://hslua.org/
Bug tracker https://github.com/hslua/hslua/issues
Source repo head: git clone https://github.com/hslua/hslua.git(lua)
Uploaded by tarleb at 2024-08-31T20:02:16Z
Distributions Arch:2.3.3, Fedora:2.3.1, LTSHaskell:2.3.3, NixOS:2.3.3, Stackage:2.3.3, openSUSE:2.3.3
Reverse Dependencies 6 direct, 194 indirect [details]
Downloads 11148 total (287 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for lua-2.3.3

[back to package description]

lua

Build status AppVeyor Status Hackage

The lua package provides a Lua interpreter as well as bindings, wrappers and types to combine Haskell and Lua.

Overview

Lua is a small, well-designed, embeddable scripting language. It has become the de-facto default to make programs extensible and is widely used everywhere from servers over games and desktop applications up to security software and embedded devices. This package provides Haskell bindings to Lua, enable coders to embed the language into their programs, making them scriptable.

This package ships with the official Lua interpreter, version 5.4.7. Cabal flags allow to compile against a system-wide Lua installation instead, if desired.

Build flags

The following cabal build flags are supported:

  • system-lua: Use the locally installed Lua version instead of the version shipped as part of this package.

  • pkg-config: Use pkg-config to discover library and include paths. Setting this flag implies system-lua.

  • allow-unsafe-gc: Allow optimizations which make Lua's garbage collection potentially unsafe; enabling this should be safe if there are no callbacks into Haskell during Lua garbage collection cycles. The flag should be disabled if Lua objects can have Haskell finalizers, i.e., __gc metamethods that call Haskell function.

    The flag is enabled per default, as Haskell functions are rarely used in finalizers. It can help to disable the flag if there are issues related to Lua's garbage collection.

  • apicheck: Compile Lua with its API checks enabled.

  • lua_32bits: Compile Lua for a 32-bits system (e.g., i386, PowerPC G4).

  • export-dynamic: Add all symbols to dynamic symbol table; disabling this will make it possible to create fully static binaries, but renders loading of dynamic C libraries impossible.

Example: using a different Lua version

To use a system-wide installed Lua when linking lua as a dependency, build/install your package using --constraint="lua +system-lua". For example, you can install Pandoc with hslua that uses system-wide Lua like this:

cabal install pandoc --constraint="lua +system-lua"

or with stack:

stack install pandoc --flag=lua:system-lua