Why does the chip control the language to choose

I asked a question before what language should I learn for embedded development. Most embedded engineers stated that c and C ++ are mandatory, but also noted that it depends on the chip.

Can someone clarify? Is this a compiler question or what? Chips have their own compilers (e.g. c compiler or C ++ compiler), and why should you use a language that the compiler knows? Is it impossible to encode and compile it elsewhere and then write it to the chip directly in its compiled state? (I think I heard a friend say something about this)

I am not sure how this works, since I don’t know many embedded systems or how they work. This is probably the easy answer for those of you who know.

+3
source share
8 answers

This is "chip dependent" in three ways:

  • Some very limited architectures are not suitable for C ++, or at least C ++ provides constructs that are not suitable for such architectures, and therefore does not have advantages for C. Most 8-bit devices fall into this category, but not all ; For example, I saw useful C ++ code implemented in MegaAVR.

  • Some devices are not supported by the C ++ compiler. For example, the Microchip dsPIC / PIC24 compiler has only C (third-party tools may have C ++ support).

  • The chip architecture is designed specifically for a specific language; for example, INMOS Transputers invariably ran OCCAM.

C, ++, - , Forth, Ada, Pascal , C ; C, . , , , , .

, ?

- - . , , , IDE, .. .

, , , .

:

+3

, , ++. , . , (, , ). , . GCC ( ). / , . , (-) "" , . , , .

+5

, , C, ++ . , , , .

"- ", , /. , , "-".

+2

: . / gcc; .

+2

"" . C/++ , , , .

(PLC). "" ". . .

, , , - , BASIC-. , .

+1

. .

. , , , , .

, , , . , , , - . , , , .

, , , , , gcc.

, , , . , , , , , - .

, , . , .

Gcc, , ( , / ). , , . , , gcc- , . - 32 , gcc, - , .

llvm - gcc, , , , , /, , . , llvm, , . msp430 , , . - , - llvm. -, -. llvm, , .

, , , , ( , , ). , , Windows, linux , . , , , - , , , , , .

, , , , . , , , , , , .

? . C, ++, , . C - ( ). , C, , . , , , , .. , , .

, . api library (n embedded) linux ( / ). , , 256 1024 ( , ) ? - ? "" api (rtos, linux, wince ..), , C, , ++ ( C), , .

+1

C/++ - . , , , CPU/Microcontroller. , .

, , . , .

, . FPGA - , , . FPGA , Verilog VHDL. "" () "".

- , ASIC. . C/++ pic- Microchip, .

FPGA, , C/++/pic, , FPGA CPU/Microcontroller .

0

8- . , , ; , main() , , , , , , .. , :

  • , - ; .
  • , "" , , (, , "foo" "", "bar" "boz", ).
  • , .
  • , , .

C, , , , (, , - ). , , ++ C, , , ++ , .

0

Source: https://habr.com/ru/post/1755166/


All Articles