Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

HOW compiler works


  • Please log in to reply
5 replies to this topic

#1 ayush

ayush

  • Members
  • 19 posts
  • OFFLINE
  •  
  • Local time:12:48 AM

Posted 29 November 2010 - 08:01 PM

we all do prog. in a high level language such as c++, C#....each have their own compiler...but how do these compilers compile something written in ABCD to 0 & 1..... and in what these compilers are made? and if we go further in depth then do compilers also need compilers?

from compilers 1 more question arises... that if c is said to be mother language.... and other languages are based on it... then on what C is based...or ultimately which is the first high level language?

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:18 PM

Posted 29 November 2010 - 09:51 PM

or ultimately which is the first high level language?

That depends on how you define 'high level'. I would argue that since binary is the language of computers, then assembly would be the first higher level language.

that if c is said to be mother language

Says who?

but how do these compilers compile something written in ABCD to 0 & 1

Every single character can be represented by a series of binary numbers. the compiler reads in the code and then converts it. Basically.

Maybe you should start your research here:
http://en.wikipedia.org/wiki/Programming_language

#3 Minh Triet Pham Tran

Minh Triet Pham Tran

  • Members
  • 110 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:18 PM

Posted 07 January 2012 - 05:12 PM

You should buy and read the Dragon book :) :
Amazon.com: Compilers: Principles, Techniques, and Tools (9780201100884): Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman: Books
http://www.amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/0201100886

Edited by Minh Triet Pham Tran, 07 January 2012 - 05:13 PM.

If you think technology can solve your security problems, then you don't understand the problems and you don't understand the technology. Bruce Schneier

#4 A Future Pilot

A Future Pilot

  • Members
  • 78 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:TN, USA
  • Local time:02:18 PM

Posted 28 February 2012 - 10:59 PM

In short the compiler checks your system to see what type it is. It then converts the source code into the assembly language for your processor's architecture. That assembly code is then converted directly to binary and the computer reads it.

(Converting from high-level language to assembly isn't direct. It's more of a "If he wrote THIS, then we can do the same thing in assembly by using THIS THAT and THE OTHER. The conversion from assembly to binary, however, is directly 1-to-1, every command in assembly is converted to a particular binary number.)

#5 James Litten

James Litten

    Ԁǝǝ˥q


  • BC Advisor
  • 1,945 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:New Jersey
  • Local time:02:18 PM

Posted 29 February 2012 - 02:14 AM

we all do prog. in a high level language such as c++, C#....each have their own compiler...but how do these compilers compile something written in ABCD to 0 & 1..... and in what these compilers are made? and if we go further in depth then do compilers also need compilers?

from compilers 1 more question arises... that if c is said to be mother language.... and other languages are based on it... then on what C is based...or ultimately which is the first high level language?


The most incredible book to put it all in an easy to understand format is The Elements of Computing Systems ISBN 026214087X

It will make you a better programmer in a very natural way no matter what level you are at.

James

#6 Didier Stevens

Didier Stevens

  • BC Advisor
  • 2,639 posts
  • ONLINE
  •  
  • Gender:Male
  • Local time:09:18 PM

Posted 03 March 2012 - 12:24 PM

from compilers 1 more question arises... that if c is said to be mother language.... and other languages are based on it... then on what C is based...or ultimately which is the first high level language?


C is not the mother language. C was developed in the early 70's, and is based on the B programming language.

Early programming languages like COBOL, FORTRAN and Lisp were developed in the late 50's.

BASIC was developed in the early 60's.

Didier Stevens
http://blog.DidierStevens.com
http://DidierStevensLabs.com

SANS ISC Handler
Microsoft MVP 2011-2016 Consumer Security, Windows Insider MVP 2016-2018
MVP_Horizontal_BlueOnly.png

 

If you send me messages, per Bleeping Computer's Forum policy, I will not engage in a conversation, but try to answer your question in the relevant forum post. If you don't want this, don't send me messages.

 

Stevens' law: "As an online security discussion grows longer, the probability of a reference to BadUSB approaches 1.0"





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users