module/main

module args


Summary

Import and run MODULE's main function with ARGS

Bytecode

Probably only interesting to you if you want to understand more about the Nujel VM or care very much about performance.

(    0 ($get/val 'module/load))
(    2 ($get/val 'module))
(    4 ($get/val 'current-closure))
(    6 ($apply 0))
(    8 ($apply 2))
(   10 ($det/val 'mod))
(   12 ($drop))
(   13 ($get/val 'mod))
(   15 ($jf* 7))
(   18 ($push/nil))
(   19 ($jmp* 20))
(   22 ($get/val 'throw))
(   24 ($get/val 'list))
(   26 ($push/val Module not found))
(   28 ($get/val 'module))
(   30 ($push/nil))
(   31 ($get/val 'current-lambda))
(   33 ($apply 0))
(   35 ($apply 4))
(   37 ($apply 1))
(   39 ($drop))
(   40 ($get/val 'resolve))
(   42 ($push/val 'exports))
(   44 ($get/val 'mod))
(   46 ($apply 2))
(   48 ($det/val 'exports))
(   50 ($drop))
(   51 ($get/val 'exports))
(   53 ($jf* 7))
(   56 ($push/nil))
(   57 ($jmp* 20))
(   60 ($get/val 'throw))
(   62 ($get/val 'list))
(   64 ($push/val Invalid module, can't resolve exports))
(   66 ($get/val 'module))
(   68 ($push/nil))
(   69 ($get/val 'current-lambda))
(   71 ($apply 0))
(   73 ($apply 4))
(   75 ($apply 1))
(   77 ($drop))
(   78 ($get/val 'tree/ref))
(   80 ($get/val 'exports))
(   82 ($push/val :main))
(   84 ($apply 2))
(   86 ($det/val 'main))
(   88 ($drop))
(   89 ($get/val 'main))
(   91 ($jf* 7))
(   94 ($push/nil))
(   95 ($jmp* 20))
(   98 ($get/val 'throw))
(  100 ($get/val 'list))
(  102 ($push/val There is no symbol exported as main))
(  104 ($get/val 'module))
(  106 ($push/nil))
(  107 ($get/val 'current-lambda))
(  109 ($apply 0))
(  111 ($apply 4))
(  113 ($apply 1))
(  115 ($drop))
(  116 ($get/val 'procedure?))
(  118 ($get/val 'main))
(  120 ($apply 1))
(  122 ($jf* 7))
(  125 ($push/nil))
(  126 ($jmp* 20))
(  129 ($get/val 'throw))
(  131 ($get/val 'list))
(  133 ($push/val main is not a callable value))
(  135 ($get/val 'module))
(  137 ($push/nil))
(  138 ($get/val 'current-lambda))
(  140 ($apply 0))
(  142 ($apply 4))
(  144 ($apply 1))
(  146 ($drop))
(  147 ($get/val 'main))
(  149 ($get/val 'args))
(  151 ($apply 1))
(  153 ($ret))