Implement EndorObject runtime operations and managed lifetimes without language types
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 14m4s
Verify databases and deploy Aster VM / verify-and-deploy (push) Successful in 14m4s
This commit is contained in:
@@ -27,22 +27,22 @@ async fn run() -> Result<(), Box<dyn Error>> {
|
||||
{
|
||||
[] | ["bootstrap"] => {
|
||||
let mut vm = Vm::new()?;
|
||||
let root = vm.bootstrap();
|
||||
let class = vm.create_class("Example", root)?;
|
||||
let first = vm.create_instance(class)?;
|
||||
let second = vm.create_instance(class)?;
|
||||
vm.set_field(first, "message", Value::Text("Hello from Aster VM".into()))?;
|
||||
let first = vm.new_object()?;
|
||||
let second = vm.new_object()?;
|
||||
vm.set_attr(
|
||||
first,
|
||||
"message",
|
||||
Value::Text("Hello from EndorObject".into()),
|
||||
)?;
|
||||
println!("runtime=EndorObject type_system=disabled");
|
||||
println!(
|
||||
"root={} parent={:?}",
|
||||
vm.class(root)?.name(),
|
||||
vm.class(root)?.parent()
|
||||
);
|
||||
println!(
|
||||
"class={} instances_distinct={} heap_objects={}",
|
||||
vm.class(class)?.name(),
|
||||
"objects_distinct={} heap_objects={}",
|
||||
first != second,
|
||||
vm.object_count()
|
||||
);
|
||||
vm.release(first)?;
|
||||
vm.release(second)?;
|
||||
println!("released heap_objects={}", vm.object_count());
|
||||
println!("bootstrap is independent of host storage");
|
||||
}
|
||||
["help"] | ["--help"] | ["-h"] => println!("{USAGE}"),
|
||||
|
||||
Reference in New Issue
Block a user