Main Page
From Java4c
(First substantiate text) |
|||
Line 6: | Line 6: | ||
* Using Java for program and test, and translate the sources to C. | * Using Java for program and test, and translate the sources to C. | ||
- | + | ===Why Java?=== | |
+ | Java is not only a language for internet applications. Java is a programming system for common usage. The first approach to develop Java in 1994 was: Creation of a portable language for embedded applications. Java is used in some embedded applications like mobil phones, routers. It is present with a ''JTRES'': ''Java Technology for Realtime Embedded Systems'' provided by companies like Sun/Oracle, Aicas, Aonix/Atego and others. | ||
- | + | The Java-syntax for expressions is similar like C. Java is strong declarative, like C. The differences to C are: | |
- | + | * ObjectOrientation | |
+ | * It is a Language of a new generation. The C-style of programming was born in 1970 with orientation to structured programming. Java was born in 1994. | ||
+ | * Java supports a better test of algorithms. If there are any errors for example in the addressing (indexing) of arrays, it is detected safely in runtime. The algorithms need not be tested step by step to prevent such errors. A paradigma ''compile 'n run'' can be used. The time for testing can be reduced drasticly without reducing the quality of software respectively more complex algorithms can be tested in the same time like simple algorithm in C or C++. | ||
- | + | Java uses dynamic data. The approach of dynamic data helps to handle with variegated data in many threads in large applications. For example the String-processing needs dynamic memory. But it is also possible to handle with static data (allocated on startup). For example, String processing using a StringBuilder-instance and the CharSequence-interface can execute without allocation of memory. Static data are proper to use for embedded systems often. | |
- | + | ||
- | + | ||
- | + | ||
- | == | + | ===Why not C++?=== |
- | + | C++ is ObjectOriented and a modern programming language too. It is downward-compatible with C. | |
- | + | ||
- | + | But the usual programming style in C++ divergates from the style in C. There are handled with dynamic memory in some basic classes, complex constructs using the template concept are usual. An ordinary C++-program can't be used for embedded programming often. | |
- | + | ||
- | + | The disadvantages of the C-language: Unsafe pointer arithmetic, arbitrary casts, unchecked array addressing are all present in C++ too. C++ doesn't help for testing such errors like C. | |
- | + | ||
- | + | ==The key author of this site== | |
+ | |||
+ | has experience in embedded programming since 1977, beginning with Assembler programming with the Z80-processor. I'm working for a company in germany in themes of embedded control. This site presents experiences independently of concretely job definitions. | ||
+ | |||
+ | ==The mission of this site== | ||
+ | |||
+ | Exchange of experiences. You can take place on discussion. You can complement the text of the pages with your experience and knowledge. | ||
+ | |||
+ | ==Guide through the site== | ||
+ | |||
+ | TODO | ||
+ | *Style of programming in C: ObjectOrientation, OSAL layer, re-using | ||
+ | *CRuntimeJavalike | ||
+ | *Java2C-translator | ||
+ | |||
+ | First page: [[os_types_def]]. |
Revision as of 07:15, 21 February 2011
Contents |
Java4C
Goals:
- Using Java-programming language for embedded software in cooperation with C (and C++-) software.
- Using a ObjectOriented style of programming also in C!
- Using Java-like basic routines inclusive operation-system-calls.
- Using Java for program and test, and translate the sources to C.
Why Java?
Java is not only a language for internet applications. Java is a programming system for common usage. The first approach to develop Java in 1994 was: Creation of a portable language for embedded applications. Java is used in some embedded applications like mobil phones, routers. It is present with a JTRES: Java Technology for Realtime Embedded Systems provided by companies like Sun/Oracle, Aicas, Aonix/Atego and others.
The Java-syntax for expressions is similar like C. Java is strong declarative, like C. The differences to C are:
- ObjectOrientation
- It is a Language of a new generation. The C-style of programming was born in 1970 with orientation to structured programming. Java was born in 1994.
- Java supports a better test of algorithms. If there are any errors for example in the addressing (indexing) of arrays, it is detected safely in runtime. The algorithms need not be tested step by step to prevent such errors. A paradigma compile 'n run can be used. The time for testing can be reduced drasticly without reducing the quality of software respectively more complex algorithms can be tested in the same time like simple algorithm in C or C++.
Java uses dynamic data. The approach of dynamic data helps to handle with variegated data in many threads in large applications. For example the String-processing needs dynamic memory. But it is also possible to handle with static data (allocated on startup). For example, String processing using a StringBuilder-instance and the CharSequence-interface can execute without allocation of memory. Static data are proper to use for embedded systems often.
Why not C++?
C++ is ObjectOriented and a modern programming language too. It is downward-compatible with C.
But the usual programming style in C++ divergates from the style in C. There are handled with dynamic memory in some basic classes, complex constructs using the template concept are usual. An ordinary C++-program can't be used for embedded programming often.
The disadvantages of the C-language: Unsafe pointer arithmetic, arbitrary casts, unchecked array addressing are all present in C++ too. C++ doesn't help for testing such errors like C.
The key author of this site
has experience in embedded programming since 1977, beginning with Assembler programming with the Z80-processor. I'm working for a company in germany in themes of embedded control. This site presents experiences independently of concretely job definitions.
The mission of this site
Exchange of experiences. You can take place on discussion. You can complement the text of the pages with your experience and knowledge.
Guide through the site
TODO
- Style of programming in C: ObjectOrientation, OSAL layer, re-using
- CRuntimeJavalike
- Java2C-translator
First page: os_types_def.