Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Dec 2014, 12:26
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Programing Languages
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
larryrl

Joined: 07 Oct 2010
Posts: 9

PostPosted: Thu 07 Oct 2010, 17:28    Post subject:  Programing Languages
Subject description: Frustrating
 

Why is it almost every programming language for linux must be compiled using a c++ compiler?
Back to top
View user's profile Send private message 
Mzg

Joined: 04 Oct 2010
Posts: 23

PostPosted: Thu 07 Oct 2010, 18:38    Post subject:  

Um, only C++ can be compiled with a C++ compiler...
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Fri 08 Oct 2010, 04:05    Post subject:  

No, that's not what he means.
e.g. Python itself (not code written in the Python language) is written in C and compiled with ./configure; make; make install

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Mzg

Joined: 04 Oct 2010
Posts: 23

PostPosted: Fri 08 Oct 2010, 11:03    Post subject:  

That makes sense. I.e. the interpreters/compilers must be compiled, not the programming language.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: Fri 08 Oct 2010, 21:43    Post subject:  

Larry,
How else would you expect to build them?

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
gary


Joined: 21 Dec 2007
Posts: 87
Location: Cartersville, GA

PostPosted: Sat 09 Oct 2010, 11:42    Post subject:  

Isn't C++ just a pre-processor for C anyway? That is, the pre-processor accepts C++ and rewrites it as C source, which is then further pre-processed into assembly source, then ultimately assembled into binary for the target CPU. Many "compilers" allow you to stop and examine the code generated at each stage. Using the pre-process technique, it seems to me nearly any language could be designed who's output would be C source code.
_________________
Hasten Slowly!
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Fri 15 Oct 2010, 03:13    Post subject:  

Compiled languages need a compiler to compile them, and interpreted languages need an interpreter to interpret them. Those programs have to come from somewhere. Once you have a compiler for the language, you can of course write a new compiler for the language using the language itself. But before you reach that point you have a chicken and egg scenario. The simplest solution is to first write a compiler for the language in a different language that is already set up. The typical choice is C because it's pretty much the most common language you're going to find on nearly any platform. You write a compiler for your language using C, then you write another compiler for the language, this time using the language itself, and compile it using the compiler that was written in C. Now you are free from needing C, on this platform. However, if you want to make the language availible on another platform (like Mac or Windows, or an ARM processor, etc.) you'd have to either bring back the C version of the compiler so that it can be recompiled natively on the destination platform, or else implement a cross-compiler so that you can compile a compiler ahead of time.

If any of that is confusing, sorry. I should have gone to sleep a while ago.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0564s ][ Queries: 12 (0.0099s) ][ GZIP on ]