Nymphium / llix

llix is Lua interpreter written for the Information special seminar http://www.coins.tsukuba.ac.jp/syllabus/GB13312_GB13322.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

llix - Lightweight Lua Interpreter eXtended

/ˈliɹ.ɪks/

concept

llix is Lua interpreter, added the try-catch syntax.

try
	if tonumber(io.read()) < 5 then
		throw()
	end
catch
	io.stderr:write "Error\n"
end

type annotation

You can annotate type of variable:

-- in comment, `T@ <varname> :: <type>`
local num = 3 -- T@ num :: number

-- yes, you fail
local notstr = 0 -- T@ notstr :: string

only allowed to annotate monomorphic type and can't do about functions' return value.

delimited continuation

local t = {1, 2, 3, 4, 5}
local x = delim
    for i = 1, #t do
        if t[i] > 3 then
            continue t[i]
        end
    end
end

print(x) -- prints `4' !!!

usage

$ llix
llix - Lightweight Lua Interpreter eXtended (MoonScript version 0.4.0 on Lua 5.3)

> try
>> if tonumber(io.read()) < 5 then
>> throw()
>> end
>> print "foo"
>> catch
>> io.stderr:write "Error\n"
>> end
3
Error
>

installation

$ luarocks install --local llix

or

$ git clone https://github.com/Nymphium/llix
$ cd llix
$ luarocks install --local make llix-build-1.rockspec

requirement

  • Lua

TODO

$ grep -E '\b(TODO)|(XXX)\b' *

License

MIT License

About

llix is Lua interpreter written for the Information special seminar http://www.coins.tsukuba.ac.jp/syllabus/GB13312_GB13322.html

License:MIT License


Languages

Language:Lua 56.9%Language:MoonScript 42.5%Language:Makefile 0.6%