User@raspberrypi:~/ast-vm $ x-console ast-vm-3000 conf-cwd `pwd`
[+] Console ast-vm-3000 configured to workspace: /home/user/ast-vm
user@raspberrypi:~/ast-vm $ x-console ast-vm-3000 conf-start node gateway.js
[+] Console ast-vm-3000 startup command configured: node gateway.js
user@raspberrypi:~/ast-vm $ x-console ast-vm-3000 start
[+] Console ast-vm-3000 created and executed via Event-Driven
wrapper in /home/user/ast-vm
user@raspberrypi:~/ast-vm $ x-console ast-vm-3000 tail
user@raspberrypi:~/ast-vm $ /tmp/x_console_start_ast-vm-3000.sh
{"level":30,"time":1790908256992,"pid":3395043,"hostname"
:"raspberrypi","msg":"Server listening at http://127.0.0.1:3000"}
HAUKI-X86 Edge Gateway listening on http://localhost:3000
{"level":30,"time":1790908256993,"pid":3395043,"hostname":"raspberry
pi","msg":"Server list
ening at http://192.168.111.63:3000"}
{"level":30,"time":1790908256993,"pid":3395043,"hostname":"raspberry
pi","msg":"Server list
ening at http://10.30.220.1:3000"}
user@raspberrypi:~/ast-vm $ x-console ast-vm-3000 tail
user@raspberrypi:~/ast-vm $ /tmp/x_console_start_ast-vm-3000.sh
{"level":30,"time":1790908256992,"pid":3395043,"hostname":"raspberry
pi","msg":"Server list
ening at http://127.0.0.1:3000"}
HAUKI-X86 Edge Gateway listening on http://localhost:3000
{"level":30,"time":1790908256993,"pid":3395043,"hostname":"raspberrypi","msg":"
Server listening at http://192.168.111.63:3000"}
{"level":30,"time":1790908256993,"pid":3395043,"hostname":"raspberrypi","msg":"
Server listening at http://10.30.220.1:3000"}
user@raspberrypi:~/ast-vm $ {
> curl -X POST http://localhost:3000/execute
\
-H "Content-Type: application/json" \
-d '[
"let", [
["my_struct", ["record", "status", ["str", "processing"],
"data", ["array"]]]
],
["do",
["try",
["for", "i", 1, 10,
["do",
["set-idx", "my_struct", "data", ["cons", "i", ["get",
"my_struct", "data"]]],
["if", ["=", "i", 5],
["throw", ["str", "Database Crash!"]],
null
]
]
],
"err",
["set-idx", "my_struct", "status", "err"]
],
"my_struct"
]
]'
> }
{"status":"success","result":{"data":[5,4,3,2,1],"status":"Database
Crash!"}}user@raspberrypi:~/ast-vm $
Bytecode disassembler would be very good I think to analyze and learn and see
if optimizations can ever be done later