Why are C, C++, and LISP so prevalent in embedded devices and robots?

后端 未结 16 633
后悔当初
后悔当初 2021-01-31 10:57

It seems that the software language skills most sought for embedded devices and robots are C, C++, and LISP. Why haven\'t more recent languages made inroads into these applicat

16条回答
  •  臣服心动
    2021-01-31 11:22

    • As others have pointed out already, C and C++ are used because they are low-level. Another reason for C's popularity is that just about every architecture gets a C compiler targeted for it. This is good enough for a lot of people, so extra effort isn't often put into other languages. This is sort of like saying C is popular because C is popular, but hey, that's how things work.

    • LISP variants are popular in robotics in part because LISP variants have historically been popular in AI research. AI is a major focus in robotics, so a lot of stuff gets carried over from that field.

    • LISP has been around for a long time -- 1958 according to Wikipedia. It has more history than most other high-level languages, and this has two significant implications: 1) LISP is more firmly established (in the areas it is commonly used) than other high-level languages and 2) LISP interpreters have already been made to run on all manner of resource-limited hardware (see the next bullet point).

    • Interpreters are easier to implement for LISP variants than for many other high-level languages, and they can be made reasonably efficient. Scheme, for example, is a really easy language to parse, both conceptually and in CPU exertion.

    To see why other languages do not have a strong foothold in embedded programming, just take the converse of the reasons that C, C++, and LISP do have a strong foothold.

    • They are not already popular in this field, so effort is not put into supporting them.

    • They were not used by previous generations, so newbies are not taught to use them.

    • They don't have much history (in this field). They represent the unknown. The unknown is scary (and hard).

    • They are taxing on limited hardware.

    NOTE: When I talk about limited hardware, this is what I mean: a lot of embedded work still involves systems with between 256 bytes and 32 kiB of RAM. A smart phone that has 128 MiB of RAM is not a limited system.

提交回复
热议问题