Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python or Lua - Realtime application

Tags:

python

lua

I have started using Python in a real-time application (serial communication with to gps modules at once), but have found out recently about Lua. Which language would be more suited to the application?

My definition of real-time in this context is the fastest possible time to receive, process and output the data. (Feedback system)

like image 709
avitex Avatar asked Dec 12 '22 14:12

avitex


2 Answers

Both are fine languages. Neither should take you years to learn. An easy way to make the decision is to look at what modules are out there already.

For example, you mentioned that your application is related to GPS. Take a look at what libraries are already written to hook Python and Lua into your particular GPS hardware. Maybe someone's already done most of the hard work for you. If not, then go down a step. If you're talking to your GPS over an I2C link, look at I2C libraries in both languages. See which ones are more popular and better maintained.

That said, garbage collected languages have historically had problems with meeting real time requirements. Depending on yours, you may need to go with a lower level language. You should also ensure that whatever system you're running on will support your programming environment. I've worked with systems where Python would have been great but it doesn't fit in 5K of code space.

like image 176
nmichaels Avatar answered Feb 27 '23 11:02

nmichaels


Take a look at eLua and see if it meets your needs.

like image 26
Doug Currie Avatar answered Feb 27 '23 11:02

Doug Currie