mirror of
https://github.com/janet-lang/janet
synced 2024-11-14 20:54:48 +00:00
d84cc5342e
Remove caching from strings, tuples, and structs. Keyword style strings removed, now are just symbols. The compiler can decide to treat symbols with a leading ':' differently for mostly the same effect. This was done because as strings are no longer interned, symbols are cheaper to look up and check for equality.
26 lines
369 B
Plaintext
26 lines
369 B
Plaintext
{
|
|
bork 'boop
|
|
bytecode [
|
|
(load-integer 0 15)
|
|
(load-integer 1 0)
|
|
(load-constant 3 lookup)
|
|
|
|
:label
|
|
(equals 2 1 0)
|
|
(jump-if 2 :done)
|
|
(push 0)
|
|
(add-immediate 0 0 -1)
|
|
(syscall 2 0)
|
|
(get 2 3 0)
|
|
(push 2)
|
|
(syscall 2 0)
|
|
(jump :label)
|
|
|
|
:done
|
|
(return-nil)
|
|
]
|
|
constants [
|
|
(def lookup "0123456789abcdef")
|
|
]
|
|
}
|