run with mcode

This commit is contained in:
2026-02-12 16:14:46 -06:00
parent 0ba2783b48
commit 1efb0b1bc9
24 changed files with 738012 additions and 50 deletions

View File

@@ -76,14 +76,22 @@ function use_core(path) {
arrfor(array(core_extras), function(k) { env[k] = core_extras[k] })
if (sym) env.native = sym
// Check for pre-compiled .mach file first
var mach_path = core_path + '/' + path + '.mach'
// Check for pre-compiled .cm.mach file first
var mach_path = core_path + '/' + path + '.cm.mach'
if (fd.is_file(mach_path)) {
result = mach_load(fd.slurp(mach_path), env)
use_cache[cache_key] = result
return result
}
// Check for .cm.mcode JSON IR
var mcode_path = core_path + '/' + path + '.cm.mcode'
if (fd.is_file(mcode_path)) {
result = mach_eval_mcode('core:' + path, text(fd.slurp(mcode_path)), env)
use_cache[cache_key] = result
return result
}
// Fall back to source .cm file — compile at runtime
var file_path = core_path + '/' + path + MOD_EXT
if (fd.is_file(file_path)) {