Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
buzz_vm [2016/04/13 05:06]
ilpincy
buzz_vm [2016/04/13 22:28] (current)
ilpincy
Line 6: Line 6:
 **Information flow.** The sensor data and the incoming messages are collected through the robot C API. It is the task of the designer who integrates the BVM with a specific robot to map sensor values to Buzz primitives (e.g., through tables and variables) and to pass incoming messages to the BVM input queue. Once this is done, the other components of the BVM crunch the data and produce an output. The output can be exported in two possible ways: through variables or through function calls. Again, it is the task of the designer to decide whether it makes more sense that a certain robot feature is mapped to a Buzz variable or to a function call. For more information see [[buzz_c_cpp|Integration with C/C++]]. **Information flow.** The sensor data and the incoming messages are collected through the robot C API. It is the task of the designer who integrates the BVM with a specific robot to map sensor values to Buzz primitives (e.g., through tables and variables) and to pass incoming messages to the BVM input queue. Once this is done, the other components of the BVM crunch the data and produce an output. The output can be exported in two possible ways: through variables or through function calls. Again, it is the task of the designer to decide whether it makes more sense that a certain robot feature is mapped to a Buzz variable or to a function call. For more information see [[buzz_c_cpp|Integration with C/C++]].
  
-**The stacks.** The BVM is a [[https://​en.wikipedia.org/​wiki/​Stack_machine|stack-based machine]]. This means that the computation proceeds by manipulating a stack. Each [[buzz_assembler|operation]] either adds elements to the stack, or removes them, or substitutes them with different ones. Internally, Buzz actually manages a //stack of stacks//. Each stack corresponds to a function call. Upon calling a function, a dedicated stack is pushed and the function is executed; upon exiting from a function, the corresponding stack is popped and the execution proceeds with the caller code. The reason why multiple stacks are used is that the BVM uses [[https://​en.wikipedia.org/​wiki/​Closure_(computer_programming)|closures]] to support functions as first-class language objectsSwarm management is also achieved through dedicated stacks.+**The stacks.** The BVM is a [[https://​en.wikipedia.org/​wiki/​Stack_machine|stack-based machine]]. This means that the computation proceeds by manipulating a stack. Each [[buzz_assembler|operation]] either adds elements to the stack, or removes them, or substitutes them with different ones. Internally, Buzz actually manages a //stack of stacks//. Each stack corresponds to a function call. Upon calling a function, a dedicated stack is pushed and the function is executed; upon exiting from a function, the corresponding stack is popped and the execution proceeds with the caller code. The reason why multiple stacks are used is twofold: //(i)// The BVM uses [[https://​en.wikipedia.org/​wiki/​Closure_(computer_programming)|closures]] to support functions as first-class language objects; and //​(ii)// ​Swarm management is achieved through dedicated stacks.