remove some docstrings to save per actor memory

This commit is contained in:
2025-06-03 23:58:44 -05:00
parent c887bcf7b9
commit ef86dd3ecf
11 changed files with 13 additions and 1407 deletions

View File

@@ -1,6 +1,6 @@
(function engine() {
globalThis.cell = prosperon
cell.DOC = cell.hidden.DOCSYM
cell.DOC = Symbol()
var ACTORDATA = cell.hidden.ACTORSYM
ACTORDATA = '__ACTORDATA__' // TODO: implement the actual actorsym
var SYSYM = '__SYSTEM__'
@@ -103,6 +103,7 @@ function disrupt(err)
os.on(disrupt)
var js = use_embed('js')
var io = use_embed('io')
if (!io.exists('.cell')) {
@@ -236,6 +237,9 @@ globalThis.use = function use(file, ...args) {
return ret
}
globalThis.json = use('json')
var time = use('time')
var st_now = time.number()
var shop = use('shop')
var config = shop.load_config()
@@ -251,10 +255,8 @@ config.system.__proto__ = default_config
ENETSERVICE = config.system.net_service
REPLYTIMEOUT = config.system.reply_timeout
globalThis.json = use('json')
globalThis.text = use('text')
var time = use('time')
// Load actor-specific configuration
function load_actor_config(program) {
@@ -333,7 +335,6 @@ stone.p = function(object)
*/
var util = use('util')
var math = use('math')
var crypto = use('crypto')
var HEADER = Symbol()
@@ -647,8 +648,6 @@ function turn(msg)
load_actor_config(cell.args.program)
log.console(`actor ${cell.args.program} is ${cell.args.main}`)
actor_mod.register_actor(cell.id, turn, cell.args.main, config.system.ar_timer)
if (config.system.actor_memory)
@@ -773,9 +772,6 @@ function enet_check()
// Finally, run the program
actor_mod.setname(cell.args.program)
// Load actor-specific configuration before running
var prog = null
var progPath = cell.args.program
@@ -790,7 +786,6 @@ if (io.exists(progPath + ACTOR_EXT) && !io.is_directory(progPath + ACTOR_EXT)) {
if (!prog)
throw new Error(cell.args.program + " not found.");
var progDir = io.realdir(prog) + "/" + prog.substring(0, prog.lastIndexOf('/'))
@@ -803,7 +798,7 @@ var prog_script = `(function ${cell.args.program.name()}_start($_, arg) { var ar
var val = js.eval(cell.args.program, prog_script)($_, cell.args.arg)
if (val)
throw new Error('Program must not return anything');
send_messages()
})()