473,394 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

definitions of compiler, standard library, standard template library, etc. (c++)

6
i'm getting a little confused with some terminology. it's hard to get all of these questions answered through google.

please correct me if i make any mistakes in my assumptions when asking the following questions:

i understand that there are many different compilers for c++. among them is the gnu c++ compiler, part of the gnu compiler collection (gcc). from my understanding, a compiler has a set of rules for syntax and semantics which will allow it to translate c++ code into machine-level code.

first set of questions: who makes these rules for syntax and semantics? i imagine the 'author' of the language has something to do with at the beginning... where/when does the ISO come into play? What exactly is a standard? Is it a list of specs on paper, or an actual deliverable compiler?

some compilers say they come with some libraries for the languages they compile. for example, the gnu c++ compiler comes with libstdc++. what exactly is libstdc++? on their site, they claim it's an ongoing project to implement the standard c++ library. why hasn't this already been implemented? are the people working on this project following the ISO standard (does this imply the ISO standard is a set of rules written on paper?)?

along with different compilers for c++, there are also different implementations of the standard c++ library? what does STL have to do with the standard c++ library? it seems they have some thing in common, and some things not. what are the most compilers/standard librarys today?
Sep 24 '09 #1
3 1875
Banfa
9,065 Expert Mod 8TB
rules for syntax and semantics

This is the standard. Normally what happens is that someone decides to create a language and then if it becomes popular lots of people copy it and put in non-standard features. Then every decides it would be nice if the language was standardised and the ISO get involved and produce a standard for the language. The standard is a document (normally a pdf available on CD or in electronic form) that specifies the language syntax, semantics and behaviour.

For example C++ has the following time line

pre 1983 Bjarne Stroustrup produces C with Classes a C++ precursor
1983 - 1985 Bjarne Stroustrup creates the first C++
1990 ISO organisation gets involved in creating a standard C++
1998 The first ISO C++ stardard is released.

The libraries are part of the standard, the standard defines the function prototypes and what the result of the functions should be. The implementers are free to implement the library in any way they choose as long as they follow what is defined in the standard.

Implementing the standard library is an on-going project because there is a new C++ standard due out soon. Additionally any implementation is free to add extensions.

The STL is the standard C++ library, however also available for C++ programmers is the standard C library although there are very few things in the standard C library that are not in the standard C++ library (the time based functions spring to mind).
Sep 24 '09 #2
khoda
6
Thanks for the reply, Banfa. I'm still a little confused.

I understand that compiler writers can use a plethora of different optimization techniques. It seems that some compilers even have built-in functions (which seems to be distinct from the libraries they offer). Am I right in saying that each of these compilers will take any C++ file (with proper syntax and semantics) and compile it into a a binary file for some machine? Are their different types of compilers for different types of end-users? The GNU C++ compiler seems to be fairly popular, what are the other popular ones?

There also seems to be different attempts to implement the standard C++ library. You mentioned that STL is the standard C++ library. What is libstdc++? Is that a different implementation? Which implementations of the standard c++ library are most popular?
Sep 24 '09 #3
Banfa
9,065 Expert Mod 8TB
There are not different compiler implementations for different type of end users.

Any standard conforming C++ compiler will compile any error free standard conforming C++ source file into the object for its target platform.

gcc/g++ is a popular compiler, on the Windows platform Microsoft Visual C++ is also popular.

libstdc++ is GNUs implementation of the C++ standard library. Anyone who produces a C++ compiler is likely to have produced a standard library to accompany their compiler. The only exception to this that I have seen is in the embedded programming world where some embedded platforms do not support all the functions of the standard library, for instance they have no stdin, stdout and stderr or they have no filing system.

Generally people just use the standard library implementation that comes with their compiler.
Sep 24 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
9
by: John Doe | last post by:
Hi all, Regarding those cyclic dependencies of classes (like cases in which class A refers to class B and class B to class A): can they ALL be resolved by forward defining classes, and by...
55
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
36
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same...
4
by: noone | last post by:
Hi. I've got a fella working for me who is trying to convince me to change our coding standards to using separate .h and .cc files for definitions and implementations. I know this is a...
14
by: aaragon | last post by:
Hi everyone, I've been writing some code and so far I have all the code written in the .h files in order to avoid the linker errors. I'm using templates. I wanted to move the implementations to...
15
by: Jess | last post by:
Hello, Sometimes declarations are all what we need when we define/declare classes (or functions?), but sometimes we need definitions. I learned that if we define a class (B) that has an object...
1
by: jason.cipriani | last post by:
Here is an example with 3 files, containing a template structure and also a template function. The header A.h declares a template structure A with a default (i.e. for any template parameter),...
16
by: PeterAPIIT | last post by:
Hello all C++ expert programmer, i have wrote partial general allocator for my container. After reading standard C++ library and code guru article, i have several questions. 1. Why...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.