Prev | Current Page 1022 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

If you ??™ ve ever tried extending a scripting language before, you might agree that it ??™ s not
always a very intuitive process. Of all the languages we ??™ ve ever had the pleasure of dealing with,
whether it was Python, Ruby, TCL, or Lua, none of them were considerably easy or clear. Neko,
however, is both pretty and simple, while providing powerful routines for managing data conversion
and execution between both languages.
If you examine both the C program code and the haXe class used in the previous example, you should
immediately be able to notice what is going on. In the C code, the DEFINE_PRIM macro serves the
purpose of exposing the passed function pointer to the Neko Virtual Machine outside of the compiled
library. The second parameter of this macro states the number of parameters that this function requires.
DEFINE_PRIM( FunctionPointer, intNumParams );
In the haXe class, you then have a static variable that accepts a pointer to this function, so that it might
be executed directly within the Neko compiled code.


Pages:
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034