First commit. Not even working prototype yet.

This commit is contained in:
Wahlolly
2025-04-02 19:39:36 +03:00
parent dd3e9e0d6d
commit 4adc959549
7 changed files with 226 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
local loadfile = ...
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
_G._OSVERSION = "Halyde 0.1.0"
function _G.import(module, ...)
local args = table.pack(...)
local modulepath
if module:find("^/") then
if filesystem.exists(module) then
modulepath = module
end
elseif filesystem.exists("/halyde/lib/"..module..".lua") then
modulepath = "/halyde/lib/"..module..".lua"
end
assert(modulepath, "module not found\npossible locations:\n/halyde/lib/"..module..".lua")
local handle = filesystem.open(modulepath)
local data = ""
local tmpdata = ""
repeat
tmpdata = handle:read(math.huge or math.maxinteger)
data = data .. (tmpdata or "")
until not tmpdata
assert(load(data, "="..modulepath))(table.unpack(args))
end
--local handle = assert(filesystem.open("/bazinga.txt", "w"))
--assert(handle:write("Bazinga!"))
--handle:close()
import("/halyde/core/cormgr.lua")
+30
View File
@@ -0,0 +1,30 @@
_G.cormgr = {}
_G.cormgr.corList = {}
function _G.cormgr.loadCoroutine(path)
local cor = coroutine.create(function()
import(path)
end)
table.insert(_G.cormgr.corList, cor)
coroutine.yield()
end
function handleError(errormsg)
-- nothing for now
assert(false, errormsg)
end
_G.cormgr.loadCoroutine("/halyde/core/loader.lua")
while true do
for i = 1, #_G.cormgr.corList do
local result, errormsg = coroutine.resume(_G.cormgr.corList[i])
if coroutine.status(_G.cormgr.corList[i]) == "dead" then
table.remove(_G.cormgr.corList, i)
if not result then
handleError(errormsg)
end
end
computer.pullSignal(1)
end
end
+8
View File
@@ -0,0 +1,8 @@
import("termlib")
print("wait...")
print("IT WORKS???")
print("abab")
print("abc\ndef")
print("abc\tdef")
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")