Jump to content

How is a programming language made?

Jeroen1322

Hi guys!

 

I was wondering how a programming language is made because it can't just "apear" out of nowhere.

 

The base of everything is binary code but how is that made?

 

 

Thanks! 

[CPU: AMD FX-6100 @3.3GHz ] [MoBo: Asrock 970 Extreme4] [GPU: Gigabyte 770 OC ] [RAM: 8GB] [sSD: 64gb for OS] [PSU: 550Watt Be Quiet!] [HDD: 1TB] [CPU cooler: Be Quiet! Shadow Rock Pro Sr1]  -Did i solve your question/problem? Please click 'Marked Solved'-

Link to comment
Share on other sites

Link to post
Share on other sites

Dahm that is a lot of text! I'll be sure to read it later today, thanks! 

[CPU: AMD FX-6100 @3.3GHz ] [MoBo: Asrock 970 Extreme4] [GPU: Gigabyte 770 OC ] [RAM: 8GB] [sSD: 64gb for OS] [PSU: 550Watt Be Quiet!] [HDD: 1TB] [CPU cooler: Be Quiet! Shadow Rock Pro Sr1]  -Did i solve your question/problem? Please click 'Marked Solved'-

Link to comment
Share on other sites

Link to post
Share on other sites

You don't even want to know...

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

Dahm that is a lot of text! I'll be sure to read it later today, thanks! 

wait ignore the link above

 

first check out this PDF

http://www.cs.toronto.edu/~gpenn/csc324/lecture2.pdf

 

then read this

http://www.quora.com/Computer-Programming/How-are-programming-languages-made

 

this is the important part

 

Modern day languages are all typically written in C, like Python for example, and then are compiled down and eventually make their way to machine language.

Pretty much every language is written in a lower-level language than the language itself.  The one exception might be C.  A lot of C compilers are actually written in C.  (The original C compiler was obviously not, otherwise there'd be no way to compile it to assembly.)

Compilers are written to convert everything you see in Assembly or C into Machine Language.. or in some cases, vice-versa.  Compilers are basically the key to higher level languages, because everything high up is broken down into the lower level languages below it.

Computers read 0's and 1's.. the first real "language" is technically machine language.

If your grave doesn't say "rest in peace" on it You are automatically drafted into the skeleton war.

Link to comment
Share on other sites

Link to post
Share on other sites

Through the power of the almighty gabeN.

Grammar nazis are people too!
Treat your local grammar nazi nicely and he might teach you a thing or two. (Note that I'm Belgian and not a native English speaker.)
Chivalry isn't dead!

Link to comment
Share on other sites

Link to post
Share on other sites

wait ignore the link above

 

first check out this PDF

http://www.cs.toronto.edu/~gpenn/csc324/lecture2.pdf

 

then read this

http://www.quora.com/Computer-Programming/How-are-programming-languages-made

 

this is the important part

Glad i didn't read the first text :P But thanks mate! :D 

[CPU: AMD FX-6100 @3.3GHz ] [MoBo: Asrock 970 Extreme4] [GPU: Gigabyte 770 OC ] [RAM: 8GB] [sSD: 64gb for OS] [PSU: 550Watt Be Quiet!] [HDD: 1TB] [CPU cooler: Be Quiet! Shadow Rock Pro Sr1]  -Did i solve your question/problem? Please click 'Marked Solved'-

Link to comment
Share on other sites

Link to post
Share on other sites

Depends on the language.

 

For a compiled language, a compiler is the main component. It takes written source code and converts it into machine code (binary) for the CPU to understand it. The conversion process is critical, to get the right behaviour out of source code. 

 

For an interpreted language, you need an interpreter, which is usually written in a compiled language like C (good example would be python). I'm not too familiar with how an interpreter works, but I assume it parses the source code, and depending on what it reads, it executes the equivalent set of machine code to achieve the desired behaviour. 

 

That's the short version. 

Interested in Linux, SteamOS and Open-source applications? Go here

Gaming Rig - CPU: i5 3570k @ Stock | GPU: EVGA Geforce 560Ti 448 Core Classified Ultra | RAM: Mushkin Enhanced Blackline 8GB DDR3 1600 | SSD: Crucial M4 128GB | HDD: 3TB Seagate Barracuda, 1TB WD Caviar Black, 1TB Seagate Barracuda | Case: Antec Lanboy Air | KB: Corsair Vengeance K70 Cherry MX Blue | Mouse: Corsair Vengeance M95 | Headset: Steelseries Siberia V2

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Slightly off topic, but I learned machine code last semester. So basically we learned how to program using just binary. D:

Link to comment
Share on other sites

Link to post
Share on other sites

Hi guys!

 

I was wondering how a programming language is made because it can't just "apear" out of nowhere.

 

The base of everything is binary code but how is that made?

 

 

Thanks! 

 

Leaving out a lot of detail and grossly simplifying:

 

A programming language is designed. It can be designed by one or two people, like C and C++; or it can be designed by a large group of people like Ada. Generally the designers have a particular set of goals for the language. Algol for example was intended as a provably correct language. C on the other hand was developed to make programming telephone switches easier. As language theory developed, so to did the development of language design.

 

The first programs on stored program computers were actually entered using toggle switches to set bit patterns. Then the bit patterns were punched out on paper tape. pretty soon acronyms for the bit patterns (instructions) were used and a program called an assembler translated the text into actual machine code (bit patterns). Then macros & sub routines came along. And finally the first formal languages started to appear. They were translated into machine code by something called a compiler. Although some early examples actually compiled into assembly language which was then translated into machine code.

 

Today programming languages can be processed by compilers into machine code or they may be "interpreted". Interpreted languages are translated into an intermediate form and/or executed on the fly by the interpreter; or the intermediate form is stored and then executed by a "run-time". These languages are never reduced to machine code. Examples of interpreted languages are Java and Python. There are examples of compilers for some languages that are generally interpreted.

 

The history of C++ is a good example of how languages evolve. Initially C++ was a set of extensions to C. A translator was written that took C++ source and translated it into C source code. This code was then converted into machine code by a C compiler. Eventually a compiler was written that translated C++ source directly into machine code. This compiler was written in C++.

 

There are tools that given a formal language definition and some other stuff can be used to create a compiler.

80+ ratings certify electrical efficiency. Not quality.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×