ARM processors are very popular in embedded systems and mobile devices due to their power efficiency and performance. As a result, there are many programming languages used to develop software for ARM-based systems. The choice of language depends on factors like performance, code size, ease of development, availability of compilers/toolchains, etc. Here is an overview of the most common programming languages used for ARM processor application development.
The C programming language is the most popular choice for ARM programming due to its efficiency, low-level control and wide availability of compilers. The majority of ARM-targeted toolchains include highly optimized C compilers. C is commonly used in operating systems, drivers, kernels and other performance-critical applications. It provides great control over memory, hardware peripherals and finer optimizations. However, C requires more development effort and its low-level nature can make code complex and error-prone.
C++ improves upon C by adding object-oriented programming, templates and other high-level features. This makes it well suited for large and complex applications. The performance of optimized C++ code can match that of C. C++ is commonly used for application frameworks, multimedia programs, games engines etc. The downside is increased code size due to extra abstractions. Also, advanced C++ features may not be supported on all embedded compilers.
Assembly language provides the best performance since code can be completely tailored to the ARM architecture. Critical routines like cryptographic algorithms, DSP/matrix operations and protocol stacks are often hand-optimized in assembly. However, it requires expert knowledge of the hardware and is not portable. Mixing assembly with C/C++ is a common practice to get both high-performance and productivity.
Ada is an object-oriented language designed for safety-critical embedded systems. It enforces strong typing, modularity and error handling which makes it suitable for medical, automotive and aerospace applications. The Ada concurrency model also maps well to multicore ARM processors. It offers reliability and maintainability though at the cost of some runtime performance. GNAT is a widely used open-source Ada compiler.
Rust is a relatively new systems programming language that has gained popularity in the embedded space. It guarantees memory safety without garbage collection through its ownership and borrowing model. Rust has a steep learning curve but brings the benefits of low-level control without the bugs of C/C++. It generates efficient ARM code and works without a standard library. Rust support on ARM is improving with initiatives like the embedded-wg group.
Java is a popular language for enterprise ARM applications due to its “write once, run anywhere” nature. However, Java code requires a memory-intensive virtual machine which may not be ideal for memory-constrained devices. There are efforts to minimize the Java runtime though projects like Java Micro Edition (ME). The Android SDK is also based on a custom Java runtime optimized for ARM. In general, Java is best suited for ARM boards with considerable memory and processing capabilities.
Python is an interpreted scripting language increasingly used in the embedded space. It enables rapid development and short learning curve. Python is used in areas like IoT, machine learning and computer vision on ARM. While execution speed is slower, it can interface well with optimized C libraries. MicroPython and CircuitPython are popular Python variants designed to run efficiently on microcontrollers. Python works best when performance is not the primary factor.
Swift is a general-purpose language developed by Apple for iOS and MacOS application development. But recently it has been ported to Linux ARM systems as well. Swift combines modern features like type safety, concurrency support and fast compilation. Performance-wise it can be comparable to optimized C/C++ code. The syntax takes cues from Python for accessibility. Swift support on ARM is still emerging but it holds promise for use in mobile and embedded contexts.
Go is a compiled language from Google that focuses on efficiency, concurrency and networking capabilities. It generates static binaries which are ideal for embedded use. Go’s lightweight concurrency model maps efficiently to ARM multicore chips. The increasing adoption of Go in server backends makes it a potential candidate for ARM-based networking and cloud hardware. While not yet mainstream, Go has the potential to complement or replace C in certain application domains.
Lisp is the second-oldest high-level programming language and pioneered key concepts like dynamic typing, garbage collection, and self-hosting compilers. In embedded systems, dialects like Embedded Common Lisp (ECL) and MicroLisp can work without an operating system. Lisp enables an interactive style of development with its REPL environment. Use of Lisp in ARM programming is still limited but its clean semantics make it an interesting option for domain-specific languages and AI applications.
Functional programming languages like OCaml, F#, Haskell, Erlang etc. are rarely used for low-level ARM programming currently. But their immutability, expressiveness and concurrency support make them worth considering. For example, OCaml can generate compact ARM binaries. As ARM chips become more mainstream, functional languages may play a bigger role in areas like networking, cloud infrastructure and concurrent programming.
MATLAB and Simulink
MATLAB and the associated Simulink toolbox are widely used for designing digital signal processing, control systems, image processing and communications applications on ARM. MATLAB code can be automatically converted to C and deployed on ARM chips. Domain-specific languages like MATLAB provide a higher abstraction for ARM programming in fields like embedded vision, motor control, smart sensors, etc. This improves productivity for complex DSP and mathematical applications.
LabVIEW is a visual dataflow language commonly used with ARM SoCs in instrumentation, measurement and control systems. Its intuitive GUI interface helps interface with sensors, displays, data acquisition systems etc. NI provides ARM compilers for generating efficient LabVIEW executables. Debugging and analysis is also simplified through built-in tools. Using LabVIEW reduces development time in areas like Internet of Things, robotics, industrial automation, etc. involving ARM chips.
There are many other general-purpose and domain-specific languages like BASIC, Pascal, Haskell, R, Fortran, CUDA, etc. with ARM support. Enterprise languages like C# and Visual Basic can be used for server-class ARM boards running Windows/Linux. Objective-C sees use in iOS apps. Tcl, Perl and Python are popular for test automation and build scripts. openCL and RenderScript run on mobile GPUs. The large ARM ecosystem ensures availability of compilers for most mainstream languages.
ARM’s flexibility has led to the use of many programming languages in various domains. For low-level firmware and OS code, C and assembly are dominant. For applications, higher-level languages like C++, Java, Python and Swift are popular options. There is growing interest in using languages like Rust, Go and Functional languages for ARM. The trend towards more diversified applications involving ARM means more languages will be adopted based on their strengths.