Releases: hslua/hslua
HsLua 2.3.1
Compatibility updates.
HsLua 2.0.1
Released 2021-11-04.
-
Updated lower bounds of hslua packages:
- hslua >= 2.0.0.2,
- hslua-marshalling >= 2.0.1, and
- hslua-objectorientation >= 2.0.1.
This fixes a number of smaller issues; see the respective
package changelogs for details.
HsLua 2.0.0
hslua-2.0.0
Released 2021-10-21.
-
Moved module hierarchy from Foreign.Lua to HsLua.
-
Error handling has been reworked completely. The type of
exceptions used and handled by HsLua is now exposed to the type
system. The typeLuamakes use of a default error type. Custom
error handling can be implemented by using theLuaEtype with
an exception type that is an instance of classLuaError. -
Renamed stack index helpers to
nth,nthTop,nthBottom,
top. The following have been removed:stackTop,
nthFromTop,nthFromBottom. -
Extracted raw Lua bindings into new package lua. This means
that all cabal flags have been moved to package lua as well.
Version lua-1.0.0 contained theForeign.Lua.Rawhierarchy as
present in hslua-1.3.0. See that package's changelog for
info on the additional modifications since then. -
The module Foreign.Lua.Raw.Error was merged into the
HsLua.Core.Error module. -
The functions
getglobalandgettablenow return the Lua
Typeof the pushed value. -
Extracted new packages:
- hslua-core: the package contains all modules from the
Core sub-hierarchy.
- hslua-classes: typclasses Peekable and Pushable for
pushing and pulling, as well as function calling.
- tasty-hslua: makes testing helpers available for reuse.
- hslua-core: the package contains all modules from the
-
Moved run functions from Util to Core.Run.
-
Moved module Utf8 from the base level into Core.
-
Refactored code to expose Haskell functions to Lua:
-
Removed functions
newCFunction,freeCFunction. Use
pushHaskellFunctioninstead, it takes care of garbage
collection. -
Renamed typeclass
ToHaskellFunctiontoExposable,
functioncallFunctoinvoke. All these have been moved
to hslua-classes. -
The type PreCFunction is now defined in package lua;
HaskellFunction is defined in hslua-core. -
Changed
pushHaskellFunctionto only accept HaskellFunction
arguments, move it to hslua-core. -
Removed helper functions
addfunctionandaddfieldfrom
Module. Use documented functions and fields instead.
-
-
Added support for a "since" tag on documented functions; allows
to mark the library version when a function was introduced in
its present form.
HsLua v1.3.0
Released 2020-10-16.
-
Upgrade included Lua version to new bug-fix release 5.3.6. See
the upstream documentation https://www.lua.org/bugs.html#5.3.5
for the bugs which have been fixed. -
Stop exporting
c_loaded_tableandc_prelad_tablefrom module
Foreign.Lua.Raw.Auxiliary. Both values are defined only if the
flagHARDCODE_REG_KEYSis disabled, leading to compilation
errors when the flag is enabled. -
Add new function
peekStringyto Peek module. It allows to peek
a value of anyIsStringtype from an UTF-8 encoded string. -
Various improvements to the continuous integration setup,
including cleanup of the config files, version bumps to the
ghc/cabal versions used for testing, and running the linter in a
dedicated GitHub Action.
HsLua v1.2.0
Released 2020-08-15
-
New module
Foreign.Lua.Call: the module offers an alternative
method of exposing Haskell functions to Lua. The focus is on
maintainability: types and marshaling methods are made explicit;
the possibility of adding documentation and parameter names
improves error messages and allows for automatic documentation
extraction.Work on this module is ongoing; the interface is likely to
change. Suggestions and feedback are welcome. -
New types
Module,Field, and new functionsregisterModule,
preloadModule,pushModule, andrenderexported from
Foreign.Lua.Module: this builds on the newCallmodule and
allows the creation of documented modules as well as automatic
generation of Markdown-formatted module documentation. -
Export new items
nthandtopfrom Foreign.Lua.Core and
Foreign.Lua. They are short-hands fornthFromTopand
stackTop. -
Performance improvements: Calling of Lua functions and creation
of Haskell data wrapping userdata has been sped up by about 10%.
This is mostly due to using of previously missed optimization
opportunities. -
All foreign imports have been moved to into the new
Foreign.Lua.Rawmodule. This module will replace the current
Foreign.Lua.Coremodule in the future and will be distributed
as a separate package (likely starting with the 2.0 release);
the remaining parts of the currentCoremodule will be
promoted one level in the module hierarchy.The
Rawmodule can be used whenever the full power of HsLua is
not needed. -
Error-signaling of API wrapper functions has been changed:
instead of returning special integer values, functions now take
an additional pointer argument, which is set to the status
result of the computation.The
Failabletype in Core.Error is no longer needed and has
been removed. -
CI builds now include GHC 8.8 and GHC 8.10, ensuring that all
GHC 8.* versions are supported.
HsLua 1.1.2
Released 2020-06-27
-
Revert signature of function
pushListto it's proper 1.1.0
value. This fixes a mistake which caused the 1.1.1 release
to be in violation of the PVP versioning policy. -
Module Foreign.Lua.Peek: add function
pushKeyValuePairs(Alex
Loomis).
HsLua 1.1.1
Released 2020-06-02
WARNING: This version does not conform to the PVP versioning
policy, due to a unintended signature change of function
pushList. It is recommended to use 1.1.2 instead of this version.
-
New module Foreign.Lua.Push: provides functions which marshal
and push Haskell values onto Lua's stack.Most functions in Foreign.Lua.Types.Pushable are now defined
using functions from this module. -
New module Foreign.Lua.Peek: provides functions which unmarshal
and retrieve Haskell values from Lua's stack. Contrary topeek
from Foreign.Lua.Types.Peekable, the peeker functions in this
module will never throw errors, but use anEithertype to
signal retrieval failure.The error type
PeekErrorshould not be considered final and
will likely be subject to change in later versions. -
Module Foreign.Lua.Utf8: never throw errors when decoding UTF-8
strings. Invalid UTF-8 input bytes no longer cause exceptions,
but are replaced with the Unicode replacement character U+FFFD. -
Fixed missing and faulty Haddock documentation.
-
Fixed a bug which caused unnecessary use of strings to represent
floating point numbers under certain configurations.
HsLua 1.1.0
Released 2020-03-25.
WARNING: The changes in this release are experimental. It is
recommended to skip this release unless the newly introduced
features are required.
-
Allow custom error handling: conversion of Lua errors to
Haskell exceptions and back is made configurable. Users can
define their own exception/error handling strategies, even
opening up the option to pass arbitrary exceptions through Lua.-
New types exported from
Foreign.Lua.Types:ErrorConversion: defines the ways in which exceptions
and errors are handled and converted.LuaEnvironment: environment in which Lua computations
are evaluated. Contains the Lua interpreter state and
the error conversion strategy.
-
The environment of the
Luatype is changed from a plain
LuaStateto the above mentionedLuaEnvironment. -
New functions
run'is exported fromForeign.Lua.Util
andForeign.Lua: it is analogous torun, but allows to
run computations with a custom error conversion strategy. -
New function
runWithConverterexported from
Foreign.Lua.Core.TypesandForeign.Lua.Core; like
run', but takes a custom state. -
New function
unsafeRunWithexported from
Foreign.Lua.Core.TypesandForeign.Lua.Core; runs a
computation without proper error handling. -
New function
errorConversionexported from
Foreign.Lua.Core.TypesandForeign.Lua.Core: extract
the error conversion strategy from the Lua type. -
New function
throwErrorAsExceptionexported from
Foreign.Lua.Core.ErrorandForeign.Lua.Core: throws a
Lua error as Haskell exception, using the current error
conversion strategy.
-
-
Function
runWithis moved from moduleForeign.Lua.Coreto
Foreign.Lua.Util. -
The module
Foreign.Lua.Utf8is now exported.
HsLua 1.0.3.2
Released 2019-08-21.
-
Added flag to use hardcoded values for registry keys: The names
of the registry keys used to store package information are
available as CPP values from file lauxlib.h since Lua 5.3.4;
compiling HsLua against older Lua versions was not possible, as
those values were expected to exist.The respective values are now hardcoded into HsLua, and a new
flaghardcode-reg-keyis introduced, which will cause the use
of these hardcoded values instead of those defined in
lauxlib.h. Using this flag makes it possible to compile hslua
against all Lua 5.3.* versions. -
Added missing C files for benchmarking to list of
extra-source-files.
HsLua 1.0.3.1
Released 2019-05-08.
- Prevent filenames being treated as strings in debug messages.
Lua'sloadbuffertakes asourcedescription as an argument,
which is used for debug messages. Theloadfilefunction now
adds a special prefix (@) tosource, thus marking it as a
filename.