Last active
June 1, 2021 04:42
-
-
Save sogaiu/552a338d868ea77193cb208abc6990b3 to your computer and use it in GitHub Desktop.
comparing janet things
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repl> (def a {:a 1}) | |
{:a 1} | |
repl> (disasm (compile '(a :a))) | |
{ :arity 0 | |
:bytecode @[(ldc 0 0) (push 0) (ldc 1 1) (call 0 1) (ret 0)] | |
:constants @[:a {:a 1}] | |
:defs @[] | |
:environments @[] | |
:max-arity 2147483647 | |
:min-arity 0 | |
:name "_thunk" | |
:slotcount 2 | |
:vararg false} | |
repl> (disasm (compile '(get a :a))) | |
{ :arity 0 | |
:bytecode @[(ldc 1 0) (ldc 2 1) (get 0 1 2) (ret 0)] | |
:constants @[{:a 1} :a] | |
:defs @[] | |
:environments @[] | |
:max-arity 2147483647 | |
:min-arity 0 | |
:name "_thunk" | |
:slotcount 3 | |
:vararg false} | |
repl> (disasm (compile '(in a :a))) | |
{ :arity 0 | |
:bytecode @[(ldc 1 0) (ldc 2 1) (in 0 1 2) (ret 0)] | |
:constants @[{:a 1} :a] | |
:defs @[] | |
:environments @[] | |
:max-arity 2147483647 | |
:min-arity 0 | |
:name "_thunk" | |
:slotcount 3 | |
:vararg false} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment