ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Python versus C for Embedded Development

    News
    python python 3 c and c++ programming embedded opensource.com
    4
    9
    2.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mlnewsM
      mlnews
      last edited by

      Is Python a good alternative to C and C++ for programming embedded systems?

      1 Reply Last reply Reply Quote 1
      • travisdh1T
        travisdh1
        last edited by

        Interpreted language for embedded? Most embedded processors can't even run it!

        scottalanmillerS 1 Reply Last reply Reply Quote 1
        • thwrT
          thwr
          last edited by thwr

          How much I live such undifferentiated statements... It all depends on the use case. Just quick-scanned the article, but what are we talking about here? Linux on a multi-core ARM? Sure, use Python.

          Single-threaded uC's? I would love to see your project manager laughing hard at you because you need to add alot of flash just to hold the interpreter. On the other hand, it is possible (if not done already) to implement some compiler for Python to generate native "binaries". But is that really the field where Python plays? Shifting bits, working with arrays, talking to bus systems? What about predictability? There are lots of well known and field-tested compilers that will do their job in a predictable way. A Python compiler may need years to even come close to such a result.

          IMHO: Stay with C. I've worked with a lot of different embedded stuff during the last 20 years: 8bit uC's, PICs running BASIC (e.g. compiled from BASIC) up to JavaCard smartcards. At the end of the day, it's just syntax. But Python? Thanks, no.

          1 Reply Last reply Reply Quote 2
          • scottalanmillerS
            scottalanmiller @travisdh1
            last edited by

            @travisdh1 said in Python versus C for Embedded Development:

            Interpreted language for embedded? Most embedded processors can't even run it!

            What embedded processor can't run Python?

            travisdh1T 1 Reply Last reply Reply Quote 0
            • travisdh1T
              travisdh1 @scottalanmiller
              last edited by

              @scottalanmiller said in Python versus C for Embedded Development:

              @travisdh1 said in Python versus C for Embedded Development:

              Interpreted language for embedded? Most embedded processors can't even run it!

              What embedded processor can't run Python?

              Atmega328 (ie Arduino) and PIC off the top of my head.

              scottalanmillerS 1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @travisdh1
                last edited by

                @travisdh1 said in Python versus C for Embedded Development:

                @scottalanmiller said in Python versus C for Embedded Development:

                @travisdh1 said in Python versus C for Embedded Development:

                Interpreted language for embedded? Most embedded processors can't even run it!

                What embedded processor can't run Python?

                Atmega328 (ie Arduino) and PIC off the top of my head.

                PyMite doesn't run there? I thought that it did.

                https://code.google.com/archive/p/python-on-a-chip/

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  It does...

                  http://playground.arduino.cc/CommonTopics/PyMite

                  travisdh1T 1 Reply Last reply Reply Quote 0
                  • travisdh1T
                    travisdh1 @scottalanmiller
                    last edited by

                    @scottalanmiller said in Python versus C for Embedded Development:

                    It does...

                    http://playground.arduino.cc/CommonTopics/PyMite

                    Really? Cool!

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @travisdh1
                      last edited by

                      @travisdh1 said in Python versus C for Embedded Development:

                      @scottalanmiller said in Python versus C for Embedded Development:

                      It does...

                      http://playground.arduino.cc/CommonTopics/PyMite

                      Really? Cool!

                      Haven't used it myself. But it is out there and specially designed for this use case. Can call C libraries directly too.

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post