##########################################################
# Lua
-RUN apt-get -y install lua5.2 liblua5.2-dev lua-rex-pcre luarocks
-RUN luarocks install linenoise
-RUN luarocks install luasocket
+RUN apt-get -y install gcc wget unzip libpcre3-dev
+
+RUN \
+curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz && \
+tar -zxf lua-5.3.5.tar.gz && \
+cd lua-5.3.5 && \
+make linux test && \
+make install
+
+RUN \
+wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz && \
+tar zxpf luarocks-3.3.1.tar.gz && \
+cd luarocks-3.3.1 && \
+./configure && \
+make && \
+make install
# luarocks .cache directory is relative to HOME
ENV HOME /mal
local reader = require('reader')
local printer = require('printer')
local readline = require('readline')
--- local socket = require('socket')
local Nil, List, HashMap, _pr_str = types.Nil, types.List, types.HashMap, printer._pr_str
['-'] = function(a,b) return a-b end,
['*'] = function(a,b) return a*b end,
['/'] = function(a,b) return math.floor(a/b) end,
- ['time-ms'] = function() return math.floor(os.clock()*1000) end,
+ ['time-ms'] = function() return math.floor(os.clock()*1000000) end,
list = function(...) return List:new(table.pack(...)) end,
['list?'] = function(a) return types._list_Q(a) end,