A Wren-compatible scripting language implementation in MoonBit
moon add wdgodghl/moonwren@0.8.0import "random" for Random
import "meta" for Meta
var random = Random.new(2026)
System.print(random.sample(["moon", "wren", "bit"]))
System.print(Meta.compileExpression("20 + 22").call())moon check
moon test
moon run cmd/main
moon run cmd/runtime_tools_demo
moon run cmd/benchmark --target native
./tools/build-web-demo.ps1
./tools/check-conformance.ps1
./tools/check-official-suite.ps1 -WrenRoot /path/to/wren-0.4.0moon run cmd/main -- --eval "var value = 40\nSystem.print(value + 2)"moon run cmd/main -- --eval "var count = 0\nvar next = Fn.new { count = count + 1 }\nSystem.print(next.call())\nSystem.print(next.call())"var makeCounter = Fn.new {
var count = 0
return Fn.new {
count = count + 1
return count
}
}
var counter = makeCounter.call()
System.print(counter.call()) // 1
System.print(counter.call()) // 2class Point {
construct new(x, y) {
_x = x
_y = y
}
move(dx, dy) {
_x = _x + dx
_y = _y + dy
}
sum { return _x + _y }
}
var point = Point.new(10, 20)
point.move(5, 7)
System.print(point.sum) // 42class NamedPoint is Point {
construct new(x, y) { super(x, y) }
sum {
return super.sum + 2
}
}
var point = NamedPoint.new(19, 21)
System.print(point.sum) // 42
System.print(point is Point) // truevar scores = {"Ada": 38, "Lin": 40}
scores["Ada"] = scores["Ada"] + 4
var values = [scores["Ada"], scores["Lin"]]
values.add(0)
var total = 0
for (value in values) total = total + value
System.print(total) // 82var selected = (1..20).where(Fn.new { |n| n % 2 == 0 })
selected = selected.map(Fn.new { |n| n * n }).skip(2).take(3)
System.print(selected.toList) // [36, 64, 100]var worker = Fiber.new { |request|
System.print(request)
var response = Fiber.yield("waiting")
return response
}
System.print(worker.call("start")) // waiting
System.print(worker.call("done")) // doneimport "math" for Calculator
System.print(Calculator.double(21))moon run cmd/main -- examples/modules/main.wrenmatch @moonwren.run("var answer = 6 * 7\nanswer\n") {
ProgramCompleted(value, output) => {
for line in output {
println(line)
}
println("result: \{value.to_text()}")
}
ProgramFailed(diagnostics, _) =>
for diagnostic in diagnostics {
println(diagnostic.render("example.wren"))
}
}let vm = Vm::new(VmLimits::standard(100000), loader, [], [])
ignore(vm.interpret(
"main",
"var count = 40\nvar next = Fn.new { count = count + 1 }\n",
))
match vm.capture("main", "next") {
VmHandleCreated(next) => {
ignore(vm.call(next, [])) // 41
ignore(vm.call(next, [])) // 42
}
VmHandleFailed(issue) => println(issue.message)
}
vm.close()let fiber = match vm.capture("main", "worker") {
VmHandleCreated(handle) => handle
VmHandleFailed(issue) => abort(issue.message)
}
let task = match vm.new_async_task(fiber) {
VmAsyncTaskCreated(task) => task
VmAsyncTaskCreateFailed(issue) => abort(issue.message)
}
match vm.start_async(task, None) {
VmAsyncYielded(request, _) =>
ignore(vm.resume_async(task, request, Value::string("host response")))
_ => ()
}moon run cmd/scheduler_demomatch compile_bytecode("var n = 6\n n * 7\n") {
BytecodeCompiled(program) => {
let profile = profile_bytecode(program, 10000)
let trace = trace_bytecode(program, 10000)
let listing = disassemble_bytecode(program)
let debugger = BytecodeTraceDebugger::new(trace, [1])
ignore(debugger.step())
ignore(debugger.continue_execution())
}
BytecodeCompileFailed(issues) => println(issues[0].message)
}let modules = [
ModuleSource::new("main", "import \"answer\" for value\nvalue\n"),
ModuleSource::new("answer", "var value = 42\n"),
]
let result = run_modules("main", modules, 100000)pub(all) enum BytecodeCompileResult {
BytecodeCompiled(BytecodeProgram)
BytecodeCompileFailed(Array[Diagnostic])
}pub(all) enum BytecodeDebugResult {
DebuggerPaused(BytecodeTraceEvent)
DebuggerFinished(BytecodeRunResult)
}pub(all) enum BytecodeOp {
PushConstant(Int)
LoadName(String)
DefineName(String)
StoreName(String)
Duplicate
Pop
EnterScope
ExitScope
UnaryOp(UnaryOperator)
BinaryOp(BinaryOperator)
BuildList(Int)
BuildMap(Int)
GetSubscript
SetSubscript
GetProperty(String)
SetProperty(String)
InvokeMethod(String, Int)
EvaluateSemantic(Expr)
ExecuteSemantic(Stmt)
Jump(Int)
JumpIfFalse(Int)
JumpIfFalseKeep(Int)
JumpIfTrueKeep(Int)
SetLast
ReturnValue
ReturnLast
} derive(Eq, Debug)pub(all) struct BytecodeProfile {
result : BytecodeRunResult
executed_instructions : Int
max_stack_depth : Int
loads : Int
stores : Int
branches : Int
arithmetic_operations : Int
calls : Int
semantic_fallbacks : Int
}pub(all) struct BytecodeProgram {
source_name : String
constants : Array[Value]
instructions : Array[BytecodeInstruction]
}fn BytecodeTraceDebugger::new(trace : BytecodeTrace, breakpoints : Array[Int]) -> BytecodeTraceDebuggerpub(all) struct BytecodeTraceEvent {
instruction_pointer : Int
step : Int
stack_depth : Int
instruction : BytecodeInstruction
}pub(all) struct CallFrame {
callable : String
source_name : String
span : SourceSpan
} derive(Eq, Debug)fn CompiledModuleMetadata::not_equal(x : CompiledModuleMetadata, y : CompiledModuleMetadata) -> Boolpub(all) struct DebugAdapterSession {
breakpoints : Array[DebugBreakpoint]
commands : Array[DebugCommand]
snapshots : Array[DebugSnapshot]
pause_on_entry : Bool
}fn DebugAdapterSession::set_breakpoints(self : DebugAdapterSession, source_name : String, lines : Array[Int]) -> Array[DebugBreakpoint]pub(all) struct DebugBreakpoint {
source_name : String
line : Int
}pub(all) enum DebugCommand {
DebugContinue
DebugStepInto
DebugStepOver
DebugStepOut
DebugTerminate
}pub(all) struct DebugSnapshot {
source_name : String
span : SourceSpan
call_depth : Int
variables : Array[DebugVariable]
}pub(all) enum DeploymentBundleResult {
DeploymentBundleReady(SignedDeploymentBundle)
DeploymentBundleFailed(String)
}pub(all) struct DeploymentManifest {
format_version : Int
wren_version : String
compiler_abi : String
entry_module : String
capabilities : Array[String]
compiled_modules : Array[CompiledModuleMetadata]
}pub(all) struct Diagnostic {
phase : DiagnosticPhase
code : DiagnosticCode
message : String
span : SourceSpan
source_name : String
frames : Array[CallFrame]
}fn Diagnostic::new(phase : DiagnosticPhase, code : DiagnosticCode, message : String, span : SourceSpan) -> Diagnosticpub(all) enum DiagnosticCode {
UnexpectedCharacter
UnterminatedString
UnterminatedComment
InvalidEscape
InvalidNumber
UnexpectedToken
ExpectedExpression
ExpectedToken
DuplicateVariable
DuplicateMethod
InvalidSuperclass
UndefinedVariable
UndefinedMethod
InvalidArity
InvalidOperand
InvalidIndex
IndexOutOfBounds
InvalidMapKey
ModuleNotFound
CircularImport
UndefinedExport
DivisionByZero
ExecutionLimit
CallStackLimit
ReturnOutsideFunction
BreakOutsideLoop
ContinueOutsideLoop
ForeignBindingMissing
ForeignClassBindingMissing
ForeignObjectAllocationFailed
ForeignCallFailed
InvalidFiberState
FiberAborted
DebugTerminated
UnsupportedFeature
} derive(Eq, Debug)pub(all) enum Expr {
Literal(Value, SourceSpan)
Variable(String, SourceSpan)
Assign(String, Expr, SourceSpan)
FieldGet(String, SourceSpan)
FieldAssign(String, Expr, SourceSpan)
StaticFieldGet(String, SourceSpan)
StaticFieldAssign(String, Expr, SourceSpan)
ListLiteral(Array[Expr], SourceSpan)
MapLiteral(Array[MapEntryExpr], SourceSpan)
SubscriptGet(Expr, Expr, SourceSpan)
SubscriptSet(Expr, Expr, Expr, SourceSpan)
PropertyGet(Expr, String, SourceSpan)
PropertySet(Expr, String, Expr, SourceSpan)
MethodCall(Expr, String, Array[Expr], SourceSpan)
SuperConstructorCall(Array[Expr], SourceSpan)
FunctionLiteral(Array[String], Array[Stmt], SourceSpan)
FiberCallResume(Int, Value, Value?, SourceSpan)
FiberSequenceResume(Int, Value, Value, Value, Int, String, Value, Int, SourceSpan)
Unary(UnaryOperator, Expr, SourceSpan)
Binary(Expr, BinaryOperator, Expr, SourceSpan)
Conditional(Expr, Expr, Expr, SourceSpan)
Grouping(Expr, SourceSpan)
} derive(Eq, Debug)pub(all) enum ExpressionParseResult {
ExpressionParsed(Expr)
ExpressionParseFailed(Array[Diagnostic])
}pub(all) enum ForeignAllocationResult {
ForeignAllocationSucceeded(Int)
ForeignAllocationFailed(String)
}pub struct ForeignClassBinding {
module_name : String
class_name : String
allocate : (Array[Value]) -> ForeignAllocationResult
finalize : (Int) -> Unit
}fn ForeignClassBinding::new(module_name : String, class_name : String, allocate : (Array[Value]) -> ForeignAllocationResult, finalize : (Int) -> Unit) -> ForeignClassBindingpub(all) enum ForeignContextResult {
ForeignContextReturned(ForeignOwnedValue)
ForeignContextAborted(String)
}pub struct ForeignMethodBinding {
module_name : String
class_name : String
is_static : Bool
signature : String
callback : (Value, Array[Value]) -> ForeignCallResult?
handle_callback : (Int, Array[Value]) -> ForeignCallResult?
context_callback : (ForeignCallContext) -> ForeignContextResult?
handle_context_callback : (Int, ForeignCallContext) -> ForeignContextResult?
}fn ForeignMethodBinding::new(module_name : String, class_name : String, is_static : Bool, signature : String, callback : (Value, Array[Value]) -> ForeignCallResult) -> ForeignMethodBindingfn ForeignMethodBinding::new_context(module_name : String, class_name : String, is_static : Bool, signature : String, callback : (ForeignCallContext) -> ForeignContextResult) -> ForeignMethodBindingfn ForeignMethodBinding::new_context_for_foreign_class(module_name : String, class_name : String, signature : String, callback : (Int, ForeignCallContext) -> ForeignContextResult) -> ForeignMethodBindingfn ForeignMethodBinding::new_for_foreign_class(module_name : String, class_name : String, signature : String, callback : (Int, Array[Value]) -> ForeignCallResult) -> ForeignMethodBindingfn ForeignOwnedMapEntry::new(key : ForeignOwnedValue, value : ForeignOwnedValue) -> ForeignOwnedMapEntrypub(all) enum ForeignOwnedValue {
ForeignNull
ForeignBool(Bool)
ForeignNumber(Double)
ForeignString(String)
ForeignBytes(Array[Int])
ForeignRange(Double, Double, Bool)
ForeignList(Array[ForeignOwnedValue])
ForeignMap(Array[ForeignOwnedMapEntry])
ForeignExisting(Value)
}pub(all) struct LanguageDocument {
source_name : String
source : String
tokens : Array[Token]
statements : Array[Stmt]
diagnostics : Array[Diagnostic]
symbols : Array[LanguageSymbol]
}fn LanguageDocument::rename(self : LanguageDocument, offset : Int, new_name : String) -> Array[LanguageTextEdit]?fn LanguageServer::open(self : LanguageServer, source_name : String, source : String) -> Array[Diagnostic]pub(all) struct LanguageSymbol {
name : String
kind : LanguageSymbolKind
span : SourceSpan
container : String?
} derive(Eq, Debug)pub(all) struct LanguageTextEdit {
source_name : String
span : SourceSpan
replacement : String
} derive(Eq, Debug)pub(all) struct MethodDecl {
name : String
parameters : Array[String]
body : Array[Stmt]
is_constructor : Bool
is_getter : Bool
is_static : Bool
is_foreign : Bool
attributes : Array[AttributeDecl]
span : SourceSpan
} derive(Eq, Debug)pub(all) enum ModuleArchiveResult {
ModuleArchiveDecoded(Array[VerifiedModule])
ModuleArchiveFailed(String)
}pub struct ObservedVm {
vm : Vm
history_limit : Int
history : Array[VmTelemetry]
observers : Array[(VmTelemetry) -> Unit]
next_operation_id : Int
}fn ObservedVm::call(self : ObservedVm, handle : VmHandle, arguments : Array[Value]) -> ProgramRunResultfn ObservedVm::capture(self : ObservedVm, module_name : String, variable : String) -> VmHandleResultfn ObservedVm::interpret(self : ObservedVm, source_name : String, source : String) -> ProgramRunResultfn ObservedVm::reload_modules(self : ObservedVm, replacements : Array[ModuleSource], preserve : Array[ReloadStateSelection]) -> ProgramRunResultpub(all) enum ProgramParseResult {
ProgramParsed(Array[Stmt])
ProgramParseFailed(Array[Diagnostic])
}pub(all) enum ProgramRunResult {
ProgramCompleted(Value, Array[String])
ProgramFailed(Array[Diagnostic], Array[String])
}fn ProgramRunResult::deliver(self : ProgramRunResult, write : (String) -> Unit, report : (Diagnostic) -> Unit) -> ProgramRunResultpub struct ReplSession {
history : String
prior_output_lines : Int
max_steps : Int
}pub struct ScheduledTaskEntry {
identifier : Int
task : VmAsyncTask
status : VmScheduledTaskStatus
request : VmAsyncRequest?
response : Value?
wake_at : Double
joined : Array[Int]
race : Bool
result : Value
result_root : VmHandle?
issues : Array[Diagnostic]
pending_output : Array[String]
}pub(all) enum SchedulerReplayDecodeResult {
SchedulerReplayDecoded(SchedulerReplayLog)
SchedulerReplayDecodeFailed(String)
}pub(all) enum SchedulerReplayEvent {
ReplayAdvance(Double)
ReplayDeliver(Int, ForeignOwnedValue)
ReplayCancel(Int)
ReplayObserve(String)
}pub(all) enum SchedulerReplayResult {
SchedulerReplayCompleted(Int)
SchedulerReplayDiverged(Int, String, String)
SchedulerReplayInvalid(String)
}pub(all) struct SignedDeploymentBundle {
manifest : DeploymentManifest
modules : Array[VerifiedModule]
payload_sha256 : String
key_id : String
signature : String
}pub(all) enum Stmt {
ExpressionStatement(Expr, SourceSpan)
VariableStatement(String, Expr?, SourceSpan)
BlockStatement(Array[Stmt], SourceSpan)
IfStatement(Expr, Stmt, Stmt?, SourceSpan)
WhileStatement(Expr, Stmt, SourceSpan)
ForStatement(String, Expr, Stmt, SourceSpan)
ReturnStatement(Expr?, SourceSpan)
BreakStatement(SourceSpan)
ContinueStatement(SourceSpan)
ImportStatement(String, Array[ImportBinding], SourceSpan)
ClassStatement(String, Expr?, Array[MethodDecl], Array[AttributeDecl], Bool, SourceSpan)
} derive(Eq, Debug)pub(all) enum TokenKind {
LeftParen
RightParen
LeftBrace
RightBrace
LeftBracket
RightBracket
Colon
Comma
Dot
DotDot
DotDotDot
Minus
Plus
Slash
Star
Percent
Pipe
PipePipe
Ampersand
AmpersandAmpersand
Caret
Tilde
Question
Hash
Bang
BangEqual
Equal
EqualEqual
Less
LessEqual
LessLess
Greater
GreaterEqual
GreaterGreater
Newline
Identifier
Field
StaticField
Number
StringLiteral
BreakKeyword
ClassKeyword
ConstructKeyword
ContinueKeyword
ElseKeyword
FalseKeyword
ForKeyword
ForeignKeyword
IfKeyword
ImportKeyword
AsKeyword
InKeyword
IsKeyword
NullKeyword
ReturnKeyword
StaticKeyword
SuperKeyword
ThisKeyword
TrueKeyword
VarKeyword
WhileKeyword
Eof
} derive(Eq, Debug)pub(all) enum Value {
NullValue
BoolValue(Bool)
NumberValue(Double)
StringValue(String)
RawStringValue(Array[Int])
RangeValue(Double, Double, Bool)
ListValue(Int)
MapValue(Int)
SequenceValue(Int)
FunctionValue(Int)
FiberValue(Int)
ClassValue(Int)
MetaClassValue(String)
ClassAttributesValue(Int, Int)
InstanceValue(Int)
SuperValue(Int, Int, String, Bool)
SuperClassValue(Int, Int)
CoreClassValue(CoreClass)
IteratorValue(Int)
MapEntryValue(Int)
SystemValue
} derive(Eq, Debug)pub(all) enum ValueConversionResult[T] {
ValueConverted(T)
ValueConversionFailed(String, String)
}pub(all) struct VerifiedModule {
name : String
source : String
checksum : String
}pub struct Vm {
identity : Int
context_identifier : Int
sources : Array[ModuleSource]
roots : Array[String]
handles : Array[VmHandleEntry]
generation : Int
closed : Bool
limits : VmLimits
fallback_loader : (String, String) -> ModuleLoadResult
foreign_methods : Array[ForeignMethodBinding]
foreign_classes : Array[ForeignClassBinding]
should_cancel : () -> Bool
automatic_gc : Bool
gc_minimum_objects : Int
gc_growth_percent : Int
next_gc_objects : Int
last_gc_stats : VmGcStats?
}fn Vm::attach_debugger(self : Vm, breakpoints : Array[DebugBreakpoint], pause_on_entry : Bool, hook : (DebugSnapshot) -> DebugCommand) -> Boolfn Vm::bind_method(self : Vm, receiver : VmHandle, method_name : String, arity : Int) -> VmMethodHandleResultfn Vm::new(limits : VmLimits, loader : (String, String) -> ModuleLoadResult, foreign_methods : Array[ForeignMethodBinding], foreign_classes : Array[ForeignClassBinding]) -> Vmfn Vm::new_cancellable(limits : VmLimits, loader : (String, String) -> ModuleLoadResult, foreign_methods : Array[ForeignMethodBinding], foreign_classes : Array[ForeignClassBinding], should_cancel : () -> Bool) -> Vmfn Vm::reload_module(self : Vm, module_name : String, source : String, preserve : Array[String]) -> ProgramRunResultfn Vm::reload_modules(self : Vm, replacements : Array[ModuleSource], preserve : Array[ReloadStateSelection]) -> ProgramRunResultfn Vm::reload_modules_with_migration(self : Vm, replacements : Array[ModuleSource], preserve : Array[ReloadStateSelection], migrate : (ReloadStateArchive) -> Result[String, String]) -> ProgramRunResultfn Vm::resume_async(self : Vm, task : VmAsyncTask, request : VmAsyncRequest, response : Value) -> VmAsyncRunResultpub struct VmAsyncRequest {
vm_identity : Int
generation : Int
task_handle : Int
sequence : Int
value : Value
}pub(all) enum VmAsyncRunResult {
VmAsyncYielded(VmAsyncRequest, Array[String])
VmAsyncCompleted(Value, Array[String])
VmAsyncFailed(Array[Diagnostic], Array[String])
}pub(all) enum VmAsyncTaskResult {
VmAsyncTaskCreated(VmAsyncTask)
VmAsyncTaskCreateFailed(Diagnostic)
}pub(all) struct VmGcPolicy {
minimum_objects : Int
growth_percent : Int
}pub(all) struct VmGcStats {
before_objects : Int
reachable_objects : Int
reclaimed_objects : Int
before_instances : Int
reachable_instances : Int
reclaimed_instances : Int
finalized_foreign_instances : Int
}pub struct VmHandle {
vm_identity : Int
identifier : Int
generation : Int
}pub(all) struct VmLimits {
max_steps : Int
max_call_depth : Int
max_output_characters : Int
max_modules : Int
max_objects : Int
max_source_characters : Int
}pub struct VmMethodHandle {
vm_identity : Int
generation : Int
receiver : VmHandle
method_name : String
arity : Int
}pub(all) enum VmMethodHandleResult {
VmMethodHandleCreated(VmMethodHandle)
VmMethodHandleFailed(Diagnostic)
}pub struct VmPool {
identity : Int
config : VmPoolConfig
factory : () -> Vm
entries : Array[VmPoolEntry]
closed : Bool
next_token : Int
created : Int
recycled : Int
acquisitions : Int
rejections : Int
}fn[T] VmPool::with_vm(self : VmPool, lease : VmPoolLease, operation : (Vm) -> T) -> VmPoolUseResult[T]pub(all) struct VmPoolConfig {
size : Int
max_uses_per_vm : Int
max_leases_per_tenant : Int
reset_on_release : Bool
}fn VmPoolConfig::new(size : Int, max_uses_per_vm : Int, max_leases_per_tenant : Int, reset_on_release : Bool) -> VmPoolConfigpub struct VmPoolLease {
pool_identity : Int
entry_index : Int
token : Int
tenant : String
}pub(all) struct VmPoolStats {
capacity : Int
active : Int
created : Int
recycled : Int
acquisitions : Int
rejections : Int
}pub struct VmScheduler {
vm : Vm
entries : Array[ScheduledTaskEntry]
now_milliseconds : Double
max_tasks : Int
closed : Bool
}fn VmScheduler::deliver_owned(self : VmScheduler, task_identifier : Int, response : ForeignOwnedValue) -> Boolfn VmScheduler::snapshot_request(self : VmScheduler, request : VmAsyncRequest) -> ForeignOwnedValue?pub(all) enum VmSchedulerEvent {
VmSchedulerIdle
VmSchedulerExternalRequest(Int, VmAsyncRequest, Array[String])
VmSchedulerTaskCompleted(Int, Value, Array[String])
VmSchedulerTaskFailed(Int, Array[Diagnostic], Array[String])
}pub struct VmSchedulerRecorder {
scheduler : VmScheduler
workload_digest : String
events : Array[SchedulerReplayEvent]
}fn VmSchedulerRecorder::deliver(self : VmSchedulerRecorder, task_identifier : Int, response : ForeignOwnedValue) -> Boolfn VmSchedulerRecorder::new(scheduler : VmScheduler, workload_digest : String) -> VmSchedulerRecorderpub(all) struct VmTelemetry {
operation_id : Int
operation : String
source_name : String
succeeded : Bool
diagnostic_count : Int
steps : Int
duration_milliseconds : Double
output_lines : Int
output_characters : Int
loaded_modules : Int
allocated_objects : Int
live_fibers : Int
foreign_calls : Int
peak_call_depth : Int
last_gc_reclaimed_objects : Int
}fn build_signed_deployment_bundle(entry_module : String, modules : Array[VerifiedModule], capabilities : Array[String], compiler_abi : String, key_id : String, signer : (String) -> String) -> DeploymentBundleResultfn deployment_bundle_loader(bundle : SignedDeploymentBundle) -> ((String, String) -> ModuleLoadResult)fn module_checksum(source : String) -> Stringfn replay_scheduler_log(scheduler : VmScheduler, log : SchedulerReplayLog, expected_workload_digest : String) -> SchedulerReplayResultfn run_bytecode_with_bindings(program : BytecodeProgram, max_steps : Int, loader : (String, String) -> ModuleLoadResult, foreign_methods : Array[ForeignMethodBinding], foreign_classes : Array[ForeignClassBinding]) -> BytecodeRunResultfn run_bytecode_with_loader(program : BytecodeProgram, max_steps : Int, loader : (String, String) -> ModuleLoadResult) -> BytecodeRunResultfn run_modules(entry_name : String, modules : Array[ModuleSource], max_steps : Int) -> ProgramRunResultfn run_with_foreign_bindings(source_name : String, source : String, max_steps : Int, loader : (String, String) -> ModuleLoadResult, foreign_methods : Array[ForeignMethodBinding], foreign_classes : Array[ForeignClassBinding]) -> ProgramRunResultfn run_with_foreign_methods(source_name : String, source : String, max_steps : Int, loader : (String, String) -> ModuleLoadResult, foreign_methods : Array[ForeignMethodBinding]) -> ProgramRunResultfn run_with_loader(source_name : String, source : String, max_steps : Int, loader : (String, String) -> ModuleLoadResult) -> ProgramRunResultfn sha256_hex(text : String) -> Stringfn verified_module_loader(modules : Array[VerifiedModule]) -> ((String, String) -> ModuleLoadResult)fn verify_signed_deployment_bundle(bundle : SignedDeploymentBundle, verifier : (String, String, String) -> Bool) -> DeploymentBundleResultInstall
Download zipA Wren-compatible scripting language implementation in MoonBit