lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am happy to announce release 2.0 of typecheck.

The main purpose of this release is to replace configuration using a shared `_DEBUG` global variable with a dependency on the `std._debug` module: much more hygienic and interoperable, but breaking backwards compatibility (hence the major version number bump for a small change).

Typecheck's home page is at http://gvvaughan.github.io/typecheck

A Luaish run-time gradual type checking system, for argument and return types at function boundaries with simple annotations that can be disabled in production code. Its API and type mismatch errors are modelled on the core Lua C-language `argcheck ()` API.

- _Luaish_: Type check failures show error messages in the same format as Lua itself; - _run time_: Without changing any library code, the application can decide at run time whether to enable type checking as it loads the library; - _gradual_: Type checks can be introduced to the functions in your code gradually, to as few or as many as seem useful; - _type checking_: function argument types and return types are checked against the specification, and raise an error on mismatch.

This is a light-weight library for Lua 5.1 (including LuaJIT), 5.2 and 5.3 written in pure Lua.

This code started life as the function argument and return type checking system I wrote for lua-stdlib. I’m in the process of slimming down lua-stdlib in preparation for the next release though, part of which means that you can now use typecheck without requiring the installation of all of stdlib.

## Noteworthy changes in release 2.0 (2018-01-15) [stable]

### Incompatible changes

- Use `std._debug` hints to enable or disable runtime type checking instead of shared global `_DEBUG` symbol.

Install it with LuaRocks, using:

``` bash
    luarocks install typecheck 1.1
```