Language Independence

Topics

  1. Language Independence of FlexBot Behaviors
  2. Why Are Does Language Independent Bot Control Work?
  3. How Can Bot Control Be Implemented in Other Languages?
  4. Has This Ever Actually Been Done Before?

Language Independence of FlexBot Behaviors

Control of the FlexBot is not limited to the C/C++ language and interface. In fact, the bot may be controlled using any programming language that can be compiled into a standard Windows DLL.


Why Are Does Language Independent Bot Control Work?

Windows DLL's can be programmed in any language (of course, the compiler must be able to build a DLL). When calling a function that resides in a DLL, the caller simply uses the Pascal calling convention to call any functions that have been exported by the DLL. Because the FlexBot black box loads behaviors as DLL's and only uses standard data types such as integers, floats, and booleans, it is not dependent on the behavior code being written in the same programming language.


How Can Bot Control Be Implemented in Other Languages?

There are only two requirements to have a working behavior DLL: 1. DLL must export a void "think function" defined as Think(). Called each think cycle, this function should do all of the work for the think cycle (access the sensors and decide what to do). 2. DLL must export a "get" function for each of the actuators. These need only to be accessor functions for actuator variables that were set earlier (although this is a recommendation rather than a rule - the user could do work here if they wanted to). More explicitly, the list of actuator functions that must be exported is:


Has This Ever Actually Been Done Before?

No, although there should not really be any significant barriers to doing so as long as you understand how to build DLL's from your desired language. A Visual Basic example should be trivial, although it would rely on a custom linker that allows Visual Basic to be compiled to a standard DLL (rather than the non-standard ActiveX DLL linker that ships with the Microsoft Visual Basic 6.0 package).