From 38d6b4d4e8f76373044c21d896ac95ad4f671858 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Mon, 8 Dec 2025 17:39:17 -0600 Subject: [PATCH] turn into a cell package --- scripts/add.ce => add.ce | 0 {scripts => archive}/miniz.c | 0 scripts/build.ce => build.ce | 0 scripts/build.cm => build.cm | 0 scripts/cellfs.cm => cellfs.cm | 0 scripts/clean.ce => clean.ce | 0 scripts/config.ce => config.ce | 0 scripts/crypto.c => crypto.c | 0 {scripts => debug}/debug.c | 0 {scripts => debug}/js.c | 0 scripts/engine.cm => engine.cm | 0 scripts/fd.c => fd.c | 0 scripts/fd.cm => fd.cm | 0 scripts/fd_playdate.c => fd_playdate.c | 0 scripts/fit.c => fit.c | 0 scripts/help.ce => help.ce | 0 help/cellstructure.md | 38 +++++++++++++++++++++++++- scripts/install.ce => install.ce | 0 {scripts => internal}/json.c | 0 {scripts => internal}/kim.c | 0 {scripts => internal}/nota.c | 0 {scripts => internal}/os.c | 0 {scripts => internal}/os_emscripten.c | 0 {scripts => internal}/os_playdate.c | 0 {scripts => internal}/text.c | 0 {scripts => internal}/text.cm | 0 {scripts => internal}/time.c | 0 {scripts => internal}/time.cm | 0 {scripts => internal}/time_playdate.c | 0 scripts/link.ce => link.ce | 0 scripts/list.ce => list.ce | 0 scripts/ls.ce => ls.ce | 0 {scripts => net}/enet.c | 0 {scripts => net}/enet_playdate.c | 0 {scripts => net}/http.c | 0 {scripts => net}/http_playdate.c | 0 {scripts => net}/socket.c | 0 {scripts => net}/socket_playdate.c | 0 scripts/parseq.cm => parseq.cm | 0 scripts/qop.c => qop.c | 0 scripts/qopconv.ce => qopconv.ce | 0 scripts/remove.ce => remove.ce | 0 scripts/replace.ce => replace.ce | 0 scripts/shop.cm => shop.cm | 7 +++++ scripts/test.ce => test.ce | 0 scripts/toml.cm => toml.cm | 0 scripts/update.ce => update.ce | 0 scripts/upgrade.ce => upgrade.ce | 0 scripts/utf8.c => utf8.c | 0 scripts/version.ce => version.ce | 0 scripts/why.ce => why.ce | 0 scripts/wildstar.c => wildstar.c | 0 52 files changed, 44 insertions(+), 1 deletion(-) rename scripts/add.ce => add.ce (100%) rename {scripts => archive}/miniz.c (100%) rename scripts/build.ce => build.ce (100%) rename scripts/build.cm => build.cm (100%) rename scripts/cellfs.cm => cellfs.cm (100%) rename scripts/clean.ce => clean.ce (100%) rename scripts/config.ce => config.ce (100%) rename scripts/crypto.c => crypto.c (100%) rename {scripts => debug}/debug.c (100%) rename {scripts => debug}/js.c (100%) rename scripts/engine.cm => engine.cm (100%) rename scripts/fd.c => fd.c (100%) rename scripts/fd.cm => fd.cm (100%) rename scripts/fd_playdate.c => fd_playdate.c (100%) rename scripts/fit.c => fit.c (100%) rename scripts/help.ce => help.ce (100%) rename scripts/install.ce => install.ce (100%) rename {scripts => internal}/json.c (100%) rename {scripts => internal}/kim.c (100%) rename {scripts => internal}/nota.c (100%) rename {scripts => internal}/os.c (100%) rename {scripts => internal}/os_emscripten.c (100%) rename {scripts => internal}/os_playdate.c (100%) rename {scripts => internal}/text.c (100%) rename {scripts => internal}/text.cm (100%) rename {scripts => internal}/time.c (100%) rename {scripts => internal}/time.cm (100%) rename {scripts => internal}/time_playdate.c (100%) rename scripts/link.ce => link.ce (100%) rename scripts/list.ce => list.ce (100%) rename scripts/ls.ce => ls.ce (100%) rename {scripts => net}/enet.c (100%) rename {scripts => net}/enet_playdate.c (100%) rename {scripts => net}/http.c (100%) rename {scripts => net}/http_playdate.c (100%) rename {scripts => net}/socket.c (100%) rename {scripts => net}/socket_playdate.c (100%) rename scripts/parseq.cm => parseq.cm (100%) rename scripts/qop.c => qop.c (100%) rename scripts/qopconv.ce => qopconv.ce (100%) rename scripts/remove.ce => remove.ce (100%) rename scripts/replace.ce => replace.ce (100%) rename scripts/shop.cm => shop.cm (99%) rename scripts/test.ce => test.ce (100%) rename scripts/toml.cm => toml.cm (100%) rename scripts/update.ce => update.ce (100%) rename scripts/upgrade.ce => upgrade.ce (100%) rename scripts/utf8.c => utf8.c (100%) rename scripts/version.ce => version.ce (100%) rename scripts/why.ce => why.ce (100%) rename scripts/wildstar.c => wildstar.c (100%) diff --git a/scripts/add.ce b/add.ce similarity index 100% rename from scripts/add.ce rename to add.ce diff --git a/scripts/miniz.c b/archive/miniz.c similarity index 100% rename from scripts/miniz.c rename to archive/miniz.c diff --git a/scripts/build.ce b/build.ce similarity index 100% rename from scripts/build.ce rename to build.ce diff --git a/scripts/build.cm b/build.cm similarity index 100% rename from scripts/build.cm rename to build.cm diff --git a/scripts/cellfs.cm b/cellfs.cm similarity index 100% rename from scripts/cellfs.cm rename to cellfs.cm diff --git a/scripts/clean.ce b/clean.ce similarity index 100% rename from scripts/clean.ce rename to clean.ce diff --git a/scripts/config.ce b/config.ce similarity index 100% rename from scripts/config.ce rename to config.ce diff --git a/scripts/crypto.c b/crypto.c similarity index 100% rename from scripts/crypto.c rename to crypto.c diff --git a/scripts/debug.c b/debug/debug.c similarity index 100% rename from scripts/debug.c rename to debug/debug.c diff --git a/scripts/js.c b/debug/js.c similarity index 100% rename from scripts/js.c rename to debug/js.c diff --git a/scripts/engine.cm b/engine.cm similarity index 100% rename from scripts/engine.cm rename to engine.cm diff --git a/scripts/fd.c b/fd.c similarity index 100% rename from scripts/fd.c rename to fd.c diff --git a/scripts/fd.cm b/fd.cm similarity index 100% rename from scripts/fd.cm rename to fd.cm diff --git a/scripts/fd_playdate.c b/fd_playdate.c similarity index 100% rename from scripts/fd_playdate.c rename to fd_playdate.c diff --git a/scripts/fit.c b/fit.c similarity index 100% rename from scripts/fit.c rename to fit.c diff --git a/scripts/help.ce b/help.ce similarity index 100% rename from scripts/help.ce rename to help.ce diff --git a/help/cellstructure.md b/help/cellstructure.md index b56aa514..7e45d7b7 100644 --- a/help/cellstructure.md +++ b/help/cellstructure.md @@ -25,4 +25,40 @@ the "cell upgrade" command is a command to upgrade the cell version in a shop. cell update - update all packages in the shop, and builds their code for local use cell install - install a package cell remove - remove a package -cell build - build the package in the current directory into a cell executable \ No newline at end of file +cell build - build the package in the current directory into a cell executable +cell version - the version of cell being used + +## building +cell builds itself from source on your compuer! + +all source for every single part of a cell program are located in the cell shop. + +the cell shop looks like this: +.cell + packages + gitea.pockle.world/john/cell <--- this is the root cell + gitea.pockle.world/john/prosperon + cell.toml <--- the manifest of the package + mod1.cm + mod2.cm + actor1.ce + addon.c <--- a C file for compiling into the cell executable + etc + gitea.pockle.world/john/accio + /Users/john/work/prosperon + ... + link.toml - temporary links for this cell shop + lock.toml - manifest of installed packages + cache + + build - content addressed hash + fajfola214o12 + 90823tjoag + ... + +## getting a module or actor +When a module is requested, from a within package .. + +1) cell looks within package for a folder and loads , if present +2) cell looks for a package with a top level +3) cell looks in the core for \ No newline at end of file diff --git a/scripts/install.ce b/install.ce similarity index 100% rename from scripts/install.ce rename to install.ce diff --git a/scripts/json.c b/internal/json.c similarity index 100% rename from scripts/json.c rename to internal/json.c diff --git a/scripts/kim.c b/internal/kim.c similarity index 100% rename from scripts/kim.c rename to internal/kim.c diff --git a/scripts/nota.c b/internal/nota.c similarity index 100% rename from scripts/nota.c rename to internal/nota.c diff --git a/scripts/os.c b/internal/os.c similarity index 100% rename from scripts/os.c rename to internal/os.c diff --git a/scripts/os_emscripten.c b/internal/os_emscripten.c similarity index 100% rename from scripts/os_emscripten.c rename to internal/os_emscripten.c diff --git a/scripts/os_playdate.c b/internal/os_playdate.c similarity index 100% rename from scripts/os_playdate.c rename to internal/os_playdate.c diff --git a/scripts/text.c b/internal/text.c similarity index 100% rename from scripts/text.c rename to internal/text.c diff --git a/scripts/text.cm b/internal/text.cm similarity index 100% rename from scripts/text.cm rename to internal/text.cm diff --git a/scripts/time.c b/internal/time.c similarity index 100% rename from scripts/time.c rename to internal/time.c diff --git a/scripts/time.cm b/internal/time.cm similarity index 100% rename from scripts/time.cm rename to internal/time.cm diff --git a/scripts/time_playdate.c b/internal/time_playdate.c similarity index 100% rename from scripts/time_playdate.c rename to internal/time_playdate.c diff --git a/scripts/link.ce b/link.ce similarity index 100% rename from scripts/link.ce rename to link.ce diff --git a/scripts/list.ce b/list.ce similarity index 100% rename from scripts/list.ce rename to list.ce diff --git a/scripts/ls.ce b/ls.ce similarity index 100% rename from scripts/ls.ce rename to ls.ce diff --git a/scripts/enet.c b/net/enet.c similarity index 100% rename from scripts/enet.c rename to net/enet.c diff --git a/scripts/enet_playdate.c b/net/enet_playdate.c similarity index 100% rename from scripts/enet_playdate.c rename to net/enet_playdate.c diff --git a/scripts/http.c b/net/http.c similarity index 100% rename from scripts/http.c rename to net/http.c diff --git a/scripts/http_playdate.c b/net/http_playdate.c similarity index 100% rename from scripts/http_playdate.c rename to net/http_playdate.c diff --git a/scripts/socket.c b/net/socket.c similarity index 100% rename from scripts/socket.c rename to net/socket.c diff --git a/scripts/socket_playdate.c b/net/socket_playdate.c similarity index 100% rename from scripts/socket_playdate.c rename to net/socket_playdate.c diff --git a/scripts/parseq.cm b/parseq.cm similarity index 100% rename from scripts/parseq.cm rename to parseq.cm diff --git a/scripts/qop.c b/qop.c similarity index 100% rename from scripts/qop.c rename to qop.c diff --git a/scripts/qopconv.ce b/qopconv.ce similarity index 100% rename from scripts/qopconv.ce rename to qopconv.ce diff --git a/scripts/remove.ce b/remove.ce similarity index 100% rename from scripts/remove.ce rename to remove.ce diff --git a/scripts/replace.ce b/replace.ce similarity index 100% rename from scripts/replace.ce rename to replace.ce diff --git a/scripts/shop.cm b/shop.cm similarity index 99% rename from scripts/shop.cm rename to shop.cm index 64ebabb1..9aa15d67 100644 --- a/scripts/shop.cm +++ b/shop.cm @@ -10,6 +10,13 @@ var utf8 = use('utf8') var blob = use('blob') var build_utils = use('build') +function content_hash(content) +{ + return text(crypto.blake2(utf8.encode(content)), 'h') +} + +log.console(content_hash("hello")) + // a package string is what is used to import a module, like prosperon/sprite // in prosperon/sprite, sprite is the module, and prosperon is the package (usually, an alias) // a canonical package name relates prosperon to its source, like gitea.pockle.world/john/prosperon diff --git a/scripts/test.ce b/test.ce similarity index 100% rename from scripts/test.ce rename to test.ce diff --git a/scripts/toml.cm b/toml.cm similarity index 100% rename from scripts/toml.cm rename to toml.cm diff --git a/scripts/update.ce b/update.ce similarity index 100% rename from scripts/update.ce rename to update.ce diff --git a/scripts/upgrade.ce b/upgrade.ce similarity index 100% rename from scripts/upgrade.ce rename to upgrade.ce diff --git a/scripts/utf8.c b/utf8.c similarity index 100% rename from scripts/utf8.c rename to utf8.c diff --git a/scripts/version.ce b/version.ce similarity index 100% rename from scripts/version.ce rename to version.ce diff --git a/scripts/why.ce b/why.ce similarity index 100% rename from scripts/why.ce rename to why.ce diff --git a/scripts/wildstar.c b/wildstar.c similarity index 100% rename from scripts/wildstar.c rename to wildstar.c