I'm working on a project that basically shall result in something like "source-to-source compiler" for javascript. Actually this is just the question if it shall result in some kind of compiler. Here's what I want to do:
I write Webapps in a generic way that shall be transformed into mobile device specific apps. So basically it's just like:
|Generic call| ====transformed to====> Device Specific Call
So I've got a set of generic calls I define (e.g. Foo.locateByGPS
) that shall be transformed into code of the device specific native calls. So the order is the following:
Write app: javascript mixed with own defined generic code
Choose target device and give this app to the "compiler" that creates a hybrid app (native parts with web parts).
- Run it on the mobile device.
Beneath the generic code all the rest is standard javascript code that's running on all devices (respectively all browser/webviews on these devices).
Do I build a (source-to-source) compiler for this transformation?
I'm new to this topic, so I'm very thankful for some hints.