1. In an electronic device implementing a host simulation environment with a native language, a computer-implemented method comprising: preparing, using the electronic device, a simulation of a dynamic system in the simulation environment, the simulation environment representing a plurality of components of the dynamic system with a plurality of simulation elements; providing, using the electronic device: at least one simulation element in the simulation, the simulation element representing a component of the dynamic system associated with native code written in the native language, and at least one co-simulation element in the simulation, the co-simulation element representing a component of the dynamic system associated with foreign code written in a non-native language, the co-simulation element interfacing the simulation environment to at least one of a foreign simulator and compiler, the at least one of a foreign simulator and foreign compiler suitable for operating on code written in the non-native language; generating, using the electronic device, an application by programmatically generating code associated with the at least one simulation element and the at least one co-simulation element, without a user of the host simulation environment having to hand code for the component of the dynamic system associated with the foreign code; and storing the application in a storage device.