Quote:
Originally Posted by Peter Johnson
What a great idea and great work putting it all together! Since you're using SWIG, given the work you've done so far, it will make life easier for people who want to try adding other scripting languages in the future (Python anyone?).
|
I would love to see Python working on the cRIO! I am a hard-core Python user and advocate, and that's what we first tried, but we ran into some troubles with that. Not to say that Python is impossible to get working or shouldn't be done, but let me give you a little history of the FIRSTLua project.
Before settling on Lua, one of our first attempts was getting the Python 3 interpreter working. However, Python rather heavily depends on having Unicode strings, which vxWorks doesn't provide. Along with that and a multitude of other compiler and linker errors to sort out, we decided we didn't have the development time to get it done. It's certainly possible to get Python working (and I'd love to see it), but after evaluating the performance characteristics and necessary development time, we settled on Lua.
We also found that Lua gives some flexibility that Python doesn't offer (though it pains me to admit it). Lua's core library is small, so it gives the team the option to pick what they need. Also, Lua's handling of modules is more favorable when trying to implement live code reloading (it can be done in Python, but it would be less straightforward). All of that aside, Lua is also designed to work on a smaller footprint than Python. The bulk of the code size when fully built is the WPILib wrapper (~20K lines of generated code), not Lua.
None of this is to say teams shouldn't try to get Python working. I would love that.

I just would like to warn everybody of some of the difficulties we ran into while trying to do it.