On Fri, Jun 1, 2012 at 12:29 PM, Vishal <vsapr...@gmail.com> wrote: > On Fri, Jun 1, 2012 at 11:32 AM, Anand Balachandran Pillai < > abpil...@gmail.com> wrote: > > > On Thu, May 31, 2012 at 11:40 AM, Vishal <vsapr...@gmail.com> wrote: > > > > > Hello, > > > > > > Does anybody know of any effort that can covert a relatively static > > version > > > of python code into assembly for use with microcontrollers ? > > > > > > > Just wondering what is the need for this ? If you are coding in Python > > in the first place do you really want to go down all the way to assembly > > code output ? In that case I think you should start off with C rather > > than Python. > > > > >> Very good question. Here's the situation. In one of our products, we > create the control app in Python, but then need to control physical > outputs/inputs of analog and digital nature. We need to use a > microcontroller board for this. The microcontroller still needs lot of > software, an RTOS, and number of tasks (serial, ADC, PWM etc etc). All this > software needs to be written in the preferred dialect of C and using the > preferred compiler of the vendor (MPLAB for Microchip's PIC controllers > etc). It would be great if we could simply write in Python and then have > this converted to the preferred microcontroller's assembly either as direct > binary files or creating a C file with the assembly code inside asm() calls > and then passing this C file to the MPLAB compiler. > > Life can go on even without this hack...but this hack would make life > easier and more productive. >
Python is too heavyweight to port it to a microcontroller. May be you should give a try to something like lua. http://www.lua.org/ Lua is a lightweight, embeddable programming language. I don't any experience with it, but I've seem people using it in as embedded scripting language. For example lighttpd has a hook to run lua scripts. Anand _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers