cfunction
src/core/asm.c on line 1045 , column 1
(asm assembly )
Returns a new function that is the compiled result of the assembly.
The syntax for the assembly can be found on the Janet website , and
should correspond to the return value of disasm. Will throw an
error on invalid assembly.
# see https://janet-lang.org/docs/abstract_machine.html
(def plus10
(asm
'{
:arity 1
:bytecode @[(ldi 1 10 ) # $1 = 10
(add 2 0 1 ) # $2 = $0 + $1
(ret 2 )]})) # return $2
(plus10 1 ) # -> 11