Hi everyone! I have been trying to understand how Fift interpreter and compiler work since yesterday.
I don't understand how active words work.
Doc says "New active words are defined similarly to new ordinary words, but using “::”
instead of “:”. For instance, { bl word 1 ’ type } :: say"
1 2 say hello + .
will print “hello3 ok”, while
Could anyone tell me how it works step by step?
I understand it like the folllowing:
Interpreter push 1 2 to the stack, after that it finds "say" word, it's active and state = 0, then it executes immediately -> "1" Object{0x60000324dcc0}. The stack stores 1 2 "1" Object{0x60000324dcc0}. Next "hello" and I expect that it throws an exception, but it doesn't happen, it adds 1 to 2 instead. And before Addition it adds "hello" and removes "1".
How does it work? Help me please
Jun 17, 2022, 6:45 AM
I have a question - why do you invest time in learning Fift? From my experience so far, Fift always felt much too low level to deal with. Compilation of FunC goes through Fift but then directly to bytecode, so I don't need Fift there. And all the deployments and tests and interactions with the contracts are much easier for me in JavaScript.. It's like if I didn't know Fift ever existed it wouldn't hurt me one bit
Jun 29, 2022, 9:33 AM