Code Monkey home page Code Monkey logo

llix's Introduction

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

llix's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.