Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
?
EE Times-Asia > Embedded
?
?
Embedded??

Exploring various embedded programming languages

Posted: 25 Sep 2014 ?? ?Print Version ?Bookmark and Share

Keywords:C? embedded applications? object oriented programming? Java? JavaScript?

Note how the object (or variable, if you like) "out" is declared in a very conventional way and used naturally with familiar operators. The writer of this "main()" function does not need access to the source code of the functions in the "woport" class.

Of course, C++ has its downsides. Without care, the language can exert a greater load on resources than might be anticipated. Modern tools help up avoid this problem and aid in the development of optimum code. Historically, many "embedded" toolkits did not sufficiently address the resource utilisation needs of the embedded developers. As a result, many bad experiences tarnished the language's reputation in many quarters. This probably explains why, though popular, the migration from C to C++ has been slower than anticipated.

Java
Java was developed by James Gosling at Sun Microsystems (now part of Oracle Corp.) and released in 1995. Gosling's original concept was the creation of a robust language that could be used to write portable embedded applications. Over the years, Java has found considerable success as a means of running a program (an "applet") in a browser. This enabled developers to run sophisticated applications, hosted on web pages, that would run on any browser on any platform.

More recently, Java has been used in ways more attuned to its original concept of facilitating the incorporation of post-deployment applications ("apps") into embedded devices. This is common practice with the Android operating system.

Java has conventionally been implemented using an interpreter. A Java compiler converts the source code into "bytecodes," which are a very compact representation of the logic. The interpreterthe Java virtual machinereads and executes the bytecodes. Modern Java implementations may also offer conventional compilation or just-in-time (JIT) compilation as alternatives.

Java is an object oriented language with syntax based on C, borrowing functionality and further syntax from a number of other languages (like C++) that added OO capabilities to C. Unlike C++, Java is a true OO language, as opposed to a procedural language with OO capabilities.

There are no pointers in Java; this reduces programming errors. Multi-threading is intrinsic in the language, and dynamic memory allocation is well developed with sophisticated garbage collection.

An example of some Java code:

Java is only really applicable to 32bit or 64bit devices. The runtime system needs a reasonable amount of CPU power. However, with 32bit microcontrollers becoming extremely cheap, Java's reach is extending.

Java was not originally intended for real-time applications. However, real-time and safety-critical specifications have been developed in recent years.

Java is very commonly taught in schools and colleges, because it provides a good basis for sound programming practice. This has resulted in a very large programming community, the availability of numerous libraries, and a wide choice of developer tools.

JavaScript
JavaScript was developed at Netscape in 1995. Its name is confusing, because it has no real connection with Java. The selection of nomenclature was a marketing matter.

The language has a C-based syntax, but it also has a number of features that are different from other C derivative languages. Typing is dynamica value has a type, but a variable does not. It is an object oriented language; objects are associative arrays (and vice versa). Instead of classes, JavaScript is coded in terms of prototypes. There are numerous libraries available, many of which deal with browser and user interface issues.

Programming in JavaScript can be very productivemuch is achievable with limited knowledge. This makes the language attractive to nonprogrammers and also explains the plethora of bad JavaScript code.

?First Page?Previous Page 1???2???3???4?Next Page?Last Page



Article Comments - Exploring various embedded programmi...
Comments:??
*? You can enter [0] more charecters.
*Verify code:
?
?
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

?
?
Back to Top