While programming languages can not be compared, specially when they are diverse in basic nature like Python vs C/C++ or Lua with them yet the question of comparison arises. Investing time behind anything should have a goal. While MicroPython, CircuitPython variations of Python has been discussed on this website and the problems of Arduino “langugage” discussed, place of C/C++ in the world of Microcontrollers requires discussion. Assembly langugage was the first human understandable langugage used for the microcontrollers. C is practically improvement of that assembly langugage. C++ has kind-of-abstraction on C for easier work. Arduino “langugage” actually a sub-standard C++ variation. C and C++ has differences however they can be thought as a single group.
Which One Among CircuitPython, C/C++ and Lua for the Microcontrollers?
Python and PHP are closer cousins. PHP really for the goal “get-shit-done-quickly”, despite the fact it has good documentation, easiest deployment as web scripting language. C++ is a statically strongly-typed compiled multiparadigm language whereas Python is a dynamically strongly-typed interpreted multiparadigm language.
If the need is to build some application quickly, use Python but if the need is to run the application to run quickly at cheaper rate, use C++. C is the father/mother of microcontroller world after assembly langugage and ruling the earth since the 70s.
---
PHP, Python needs hardware functions on microcontroller to work in dynamic way. PHP, Python no way closest to what one should first (and last) learn for the microcontroller.
Python no way closest to “weak langugage”. Full Python has some specific areas which it becomes cost effective with lot of resources including libraries. Data analytics is one of such area. Python is heavily used langugage in different areas. Compiled languages like C/C++ usually run a bit faster while the interpreted languages, on the other hand, can evaluate themselves dynamically. So C/C++ is better for loop
functions i.e. repeated run of same logic.
From the above discussion it is probably clear that Python, PHP, Ruby etc langugage has special use-cases.
Strongly typed means, as example a string containing only digits cannot transform into a number without performing some explicit operation. Type(abhishek) = 7 will return integer (int) while abhishek = 7.99 would return floating point number (float), while abhishek = “name is abhishek” would return string (str). For those reasons we can not easily echo, print using C, C++. We are pushed towards the basic. To avoid repeatedly doing basic we develop libraries. C does not count style of indentation, so is C++, or C++ variants like Arduino “langugage”.
Again, C is compiled while Python is interpreted. That mean we upload some 10111010...
like code from our written C files and that runs and runs. While Python is excellent for some ready to do works like data analysis, machine learning. Python (and also Perl, Ruby, PHP) forces to use microprocessor.
We want to say that Python makes many thing easier which definitely bad for learning. It is actually easier to use full Python and Raspberry Pi and use some webservice like Watson Visual Recognition. The same work is quite complex even via Arduino’s langugage (as one have to write some C++ snippets for unique works). Complex works good for the brain.
Is it Means CircuitPython is Bad?
No. The use-cases are different. Python in any form is good for easy prototyping particularly when Graphics involved, data science involved. CircuitPython is a fork of MicroPython and targeted to be compliant with CPython. CircuitPython, MicroPython helps more learning real Python. Those who already mastered C, C++, Python using any langugage enough good for them.
Python in any form invites wastage of resources if work is too easy. It is fact that Adafruit like open source hardware companies hugely worked to make Python easily usable in microprocessor for the learner segment and that way actually exceptional which decreased the cost of hardware, complexities of software setup. Furthermore the cost of the 32-bit microcontrollers are decreasing. C, C++ are definitely recommended for fool-proof production grade work whenever possible. CircuitPython definitely better than using a Raspberry Pi for simple works. CircuitPython, MicroPython are good see real time changes while coding, understanding the scope of Python.
What is About Lua?
Lua is still a lesser used langugage. It has abstraction of C. Lua appears like new langugage but it is quite old, since the early 90s Lua actually had users. Lua used mostly for configuration language, scripting in web software. Lua is faster than Python but has lesser resources.
Conclusion
C, C++ are powerful langugage, forces to learn the basic, runs with minimal resource, uploaded in compiled form, faster to run. CircuitPython and variations of Python has not much new things to learn, easy for some types of prototyping and has specific use-cases. Lua is for the advanced users who already know C, C++, Python, Perl and may be Ruby.
Tagged With lua vs c on interrupts , esp32 streaming arduino vs python vs lua , lua vs c , which microcontroller can be used with lua , lua vs python in microcontrollers , lua vs python , lua vs arduino , compare strings circuitpython , circuitpython speed vs arduino , c vs lua