diff --git a/impls/lua/Dockerfile b/impls/lua/Dockerfile index e93a1d0e..1fc29ea9 100644 --- a/impls/lua/Dockerfile +++ b/impls/lua/Dockerfile @@ -22,9 +22,22 @@ WORKDIR /mal ########################################################## # 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 diff --git a/impls/lua/core.lua b/impls/lua/core.lua index 2da9c501..1d8a07fc 100644 --- a/impls/lua/core.lua +++ b/impls/lua/core.lua @@ -3,7 +3,6 @@ local types = require('types') 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 @@ -278,7 +277,7 @@ M.ns = { ['-'] = 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,