Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


plz post ur comments here.

TOPIC: You have learnt all the important concepts related to programming in C++ in this course. C++ is used for System (Embedded Programming) at a large scale although there are other languages as well available for this purpose. Here you are required to give your 5 -7 strong arguments in the favor or against this statement that C++ is good for Embedded programming or not. A concise, coherent and to the point comment is preferred over lengthy comment having irrelevant details. Your comment must not be more than 5-7 lines. Comments, posted on regular Lesson's MDB or sent through email will NOT be considered. Any request about such an acceptance will not be catered. Best of Luck

Views: 211

Replies to This Discussion

No one have completed or compiled the GDB yet

 

 

 

An embedded system is a computer system designed
to perform one or a few dedicated functions
often with real-time computing constraints

is it true that we all were prefer to c++ & will give periority to c++ as compair to other languages because we dont know much about other languages.

what u say?

this info may b helpful !

 

"Programming languages for embedded systems" shows projects which use traditional and alternative high level programming languages available in desktop OSes to manipulate the hardware devices. This resource will showcase the possibilities of development combination with different interfaces, different operative systems, and different languages. Meanwhile some non-traditional programming skills are also addressed, including cross platform deployment, for instance, accessing the Windows DLL in a Linux application. It is quite useful when you have to use the commercial software components available in Windows from Linux application software.

See this

The C programming language is perhaps the most popular programming language for programming embedded systems.C remains a very popular language for micro-controller developers due to the code efficiency and reduced overhead and development time. C offers low-level control and is considered more readable than assembly. Many free C compilers are available for a wide variety of development platforms. The compilers are part of an IDEs with ICD support, breakpoints, single-stepping and an assembly window. The performance of C compilers has improved considerably in recent years, and they are claimed to be more or less as good as assembly, depending on who you ask. Most tools now offer options for customizing the compiler optimization. Additionally, using C increases portability, it is better then languages.


Advantages
1. Can portably make native executables for a large amount of systems that don't have any dependencies on a runtime.

2. Can natively use libraries written in C/C++ without a language translation layer (important for a large class of problems that only have C libraries)

3. Code usually runs faster (lots of caveats here)

4. Can be used to implement system pieces (Kernels, etc.)

5. Complete control over how memory and other resources are allocated and released

Disadvantages
1. There is no runtime checking.

2. Can't easily call libraries in other languages

3. Very complex code can get bogged down doing things that other languages take care of

4. Not good for implementing things like websites or scripting

5. Need to implement how resources are allocated and released

6. Very easy to make a mistake that causes crashes or security problems

7. The compiled code isn't portable
Just an Idea
CS 201 GDB solution by orial

C++ is not perfect

* · It does not natively support concurrency
* · Little problem tuning time-critical code, such as interrupt handlers
* · It does not provide a mechanism to deal with to interrupts etc.
* · Lack of good standard library for embedded systems. As STL simply sucks.
* · Its handling of array boundaries is poor
* · Typical C++ code tends to be a bit larger and slower
* · It has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers (I don't count masking and shifting as clear).
* · C++ over-flexibility, which makes the less experience shoot him in the foot.
* The added expense is rarely prohibitive (on the order of 10-15%).



By Sakina sabir

solution of GDB cs 201
Advantages
1. Can portably make native executables for a large amount of systems that don't have any dependencies on a runtime.

2. Can natively use libraries written in C/C++ without a language translation layer (important for a large class of problems that only have C libraries)

3. Code usually runs faster (lots of caveats here)

4. Can be used to implement system pieces (Kernels, etc.)

5. Complete control over how memory and other resources are allocated and released

Disadvantages
1.it does not natively support concurrency
2. it does not provide a mechanism to deal with to interrupts etc.
3. Very complex code can get bogged down doing things that other languages take care of


4. Need to implement how resources are allocated and released


5. it has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers (I don't count masking and shifting as clear).
tarik bhai and kanwal and black cat and all those who partispate in this disscution i say u thanks
1 Embedded C++ Is A True Subset Of C++
2 C++ is good embedded programming language because it provides features such as classes, templates, exception handling and class inheritance
3 The object-oriented features of C++ can generally simplify the source code and the development process
4 Operator overloading allows the programmer to develop new definitions of standard C/C++ operators

5 it is not good because some C++ features can dramatically increase the size of the application object code requiring additional target resources and impacting execution speed.
solution of GDB cs 201
Advantages
1. Can portably make native executables for a large amount of systems that don't have any dependencies on a runtime.

2. Can natively use libraries written in C/C++ without a language translation layer (important for a large class of problems that only have C libraries)

3. Code usually runs faster (lots of caveats here)

4. Can be used to implement system pieces (Kernels, etc.)

5. Complete control over how memory and other resources are allocated and released

Disadvantages
1.it does not natively support concurrency
2. it does not provide a mechanism to deal with to interrupts etc.
3. Very complex code can get bogged down doing things that other languages take care of


4. Need to implement how resources are allocated and released


5. it has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers (I don't count masking and shifting as clear).
I prefer assembler for embedded applications. It's very fast, very small, and you can do anything with it. The only drawback is that you need a lot of experience with assembler in order to program in it well. Assembly language written by an expert programmer in small applications will meet or beat any other programming language around.

Topic for discussion for C++ GDB

ALL THE IMPORTANT CONCEPTS RELATED TO PROGRAMMING IN C++ IN THIS COURSE. C++ IS USED FOR SYSTEM (EMBEDDED PROGRAMMING) AT A LARGE SCALE ALTHOUGH THERE ARE OTHER LANGUAGES AS WELL AVAILABLE FOR THIS PURPOSE. HERE YOU ARE REQUIRED TO GIVE YOUR 5 -7 STRONG ARGUMENTS IN THE FAVOR OR AGAINST THIS STATEMENT THAT C++ IS GOOD FOR EMBEDDED PROGRAMMING OR NOT. A CONCISE, COHERENT AND TO THE POINT COMMENT IS PREFERRED OVER LENGTHY COMMENT HAVING IRRELEVANT DETAILS. YOUR COMMENT MUST NOT BE MORE THAN 5-7 LINES

 

C++ is used for embedded programming, however it is normally a C-like subset of C++ being used. Two reasons for that may be mind set and code generation.

Application developers have a rich tool set available to them, they can step through code in debuggers and examine closely what is going on. Often an embedded programmer only has the most primitive of tools, they can only see their code run in the real environment. Thus embedded programmers need to understand the code just from reading the source, and so tend to be very conservative in the way they program.

In C there are few programming constructs that produce more than a couple of machine code instructions, you write A+B and the compiler generates code that loads A, loads B and does an add. In C++ there are constructs were the compiler calls upon large libraries or generates intricate code. Operations surrounding type conversion in C++ can produce astounding quantities of code, if you use dynamic_cast on a pointer to an object employing multiple inheritence within a template you can generate pages of machine code.

 

C++ (pronounced /ˌsiː plʌs ˈplʌs/ see plus plus) is a statically typedfree-formmulti-paradigm,compiled, general-purpose programming language. It is regarded as a "middle-level" language, as it comprises a combination of both high-level and low-level language features.[2] It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C language and originally named C with Classes. It was renamed C++ in 1983.[3]

C++ is one of the most popular programming languages ever created[4][5] and its application domains include systems software, application software, device drivers, embedded software, high-performance server and client applications, and entertainment software such as video games. Several groups provide both free and proprietary C++ compiler software, including theGNU ProjectMicrosoftIntel and Embarcadero Technologies. C++ has greatly influenced many other popular programming languages, most notably C# and Java.

C++ is also used for hardware design, where design is initially described in C++, then analyzed, architecturally constrained, and scheduled to create a register transfer level hardware description language via high-level synthesis.[citation needed]

The language began as enhancements to C, first adding classes, then virtual functionsoperator overloadingmultiple inheritancetemplates, and exception handling among other features. After years of development, the C++ programming language standard was ratified in 1998 as ISO/IEC 14882:1998. That standard is still current, but is amended by the 2003 technical corrigendum,

C++ inherits most of C's syntax. The following is Bjarne Stroustrup's version of the Hello world program which uses the C++ standard librarystream facility to write a message to standard output

 

#include <iostream>

 

int main()

{

   std::cout "Hello, world!\n";

}

 

Within functions that define a non-void return type, failure to return a value before control reaches the end of the function results in undefined behaviour (compilers typically provide the means to issue a diagnostic in such a case).[13] The sole exception to this rule is the mainfunction, which implicitly returns a value of zero

 

C++ is often considered to be a superset of C, but this is not strictly true.[23] Most C code can easily be made to compile correctly in C++, but there are a few differences that cause some valid C code to be invalid in C++, or to behave differently in C++.

One commonly encountered difference is that C allows implicit conversion from void* to other pointer types, but C++ does not. Another common portability issue is that C++ defines many new keywords, such as new and class, that may be used as identifiers (e.g. variable names) in a C program.

Some incompatibilities have been removed by the latest (C99) C standard, which now supports C++ features such as // comments and mixed declarations and code. On the other hand, C99 introduced a number of new features that C++ does not support, such as variable-length arrays, native complex-number types, designated initializers and compound literals. However, at least some of the new C99 features will likely be included in the next version of the C++ standard, C++0x:[25][26]

§                     C99 preprocessor(including variadic macros, wide/narrow literal concatenation, wider integer arithmetic)

§                     _Pragma()

§                     long long

§                     __func__

§                     Headers:

§                                 cstdbool (stdbool.h)

§                                 cstdint (stdint.h)

§                                 cinttypes (inttypes.h).

In order to intermix C and C++ code, any function declaration or definition that is to be called from/used both in C and C++ must be declared with C linkage by placing it within an extern "C" {/*...*/} block. Such a function may not rely on features depending on name mangling (i.e., function overloading).

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service