A unit is made up of an electronic integrated circuit, a MEMS device, and an active optical device, electrically coupled to the electronic integrated circuit and located between the electronic integrated circuit and the MEMS device. In one embodiment of the invention, the compiler determines an initial object capacity based upon the use of a particular consumption method against an object created in the source code. The mathematical library and graphics functions are modified and optimized by using a variable-length fixed-point representation and a normalized homogenous coordinate system for vector operations.