7 Replies - 2704 Views - Last Post: 21 April 2010 - 10:02 AM

#1 rmccarter721  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 139
  • Joined: 10-September 07

Original/Base Programming Language?

Posted 19 April 2010 - 01:55 PM

What is the language that programming languages, such as C++ etc. compliers are written in? This is just something I have been curious about.

What is counted as the "Base" Programming language?
Is This A Good Question/Topic? 0
  • +

Replies To: Original/Base Programming Language?

#2 MrWobbles  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 31
  • View blog
  • Posts: 328
  • Joined: 11-April 08

Re: Original/Base Programming Language?

Posted 19 April 2010 - 03:10 PM

010011000110111101110111011001010111001101110100001000000110110001100101011
101100110010101101100001000000110100101110011001000000110001001101001011011
100110000101110010011110010010110000100000011101000110100001100101011011100
010000001001000011001010111100000101100001000000111010001101000011001010110
111000100000011000010111001101110011011001010110110101100010011011000111100
100101100001000000111011101101000011010010110001101101000001000000110110001
100001011011100110011101110101011000010110011101100101011100110010000001101
100011010010110101101100101001000000100001100100000011000010111001001100101
001000000110001001110101011010010110110001110100001000000110111101101110001
01110

Translate here

This post has been edited by MrWobbles: 19 April 2010 - 03:13 PM

Was This Post Helpful? 0
  • +
  • -

#3 Scorpiion  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 117
  • Joined: 23-April 09

Re: Original/Base Programming Language?

Posted 19 April 2010 - 03:52 PM

Talking about languages that would be assembly language, which is translated into opcode which are in binary code which are then stored in a hex file like this for example: (intel hex, examplecode from wikipedia)

:10010000214601360121470136007EFE09D2190140
:100110002146017EB7C20001FF5F16002148011988
:10012000194E79234623965778239EDA3F01B2CAA7
:100130003F0156702B5E712B722B732146013421C7
:00000001FF



A processor work like this, it has a number of different things it can do, different instructions. For example a simple processor might have these instructions, "IN" "OUT" "ADD" among others. These are represented in the memory as opcodes (and the processor read one opcode at the time), the idea is simple and is based on that some bits are to identify what instruction it is and some bits to store data.

Okey, so a simple assembler program could be like this: (This is AVR assembler, an RISC microcontroller but the concept is the same for all cpu's)

IN temp1,pina       ; This opcode would store specific code for "IN" instruction, a place to put it, and a place to read from
ADD temp1,temp2     ; This opcode would store specific code for "ADD" instruction, and an address to the two registers temp1 and temp2
OUT portb,temp1     ; This opcode would store specific code for "OUT" instruction, a place to put it, and a place to read from



This is a quite simple addition and it uses binary numbers to do so, but of course that is only a way of representing a number so in a higher level language you don't see that but the computer always use binary numbers. To get loops and if statements for example you can use instructions to compare two numbers and then brash/jump if they are equal etc. With the assembly language of a processor (different for different CPUs, x86 for example an instruction set so all x86 have the same opcodes) you can then write a compiler.

So to sum up, the "base language" is opcode, that is each instruction record that the processor reads from memory. To program this in a simpler way you have assembly language where each opcode has a instruction like "ADD", that makes it easier to write software. Next step is to write a C compiler for example, it would from the beginning be written in assembler, then once you have an compiler you can rewrite the compiler in C and compile it again with your first compiler... And then you have a compiler in C!

Hope this was helpful! You can ask more if you want to or search some of the words above on google/wikipedia for more info.. :)

EDIT: For high level languages people don't want to reinvent the wheel all the time so those compilers or interpreters of are often written in C for example.

This post has been edited by Scorpiion: 19 April 2010 - 03:57 PM

Was This Post Helpful? 1
  • +
  • -

#4 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Original/Base Programming Language?

Posted 19 April 2010 - 07:23 PM

Lot's of C++ compilers are written in C++ or C.
Was This Post Helpful? 0
  • +
  • -

#5 rmccarter721  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • Posts: 139
  • Joined: 10-September 07

Re: Original/Base Programming Language?

Posted 19 April 2010 - 11:59 PM

okays, Cheers
Was This Post Helpful? 0
  • +
  • -

#6 programble  Icon User is offline

  • (cons :dic :head)

Reputation: 49
  • View blog
  • Posts: 1,315
  • Joined: 21-February 09

Re: Original/Base Programming Language?

Posted 20 April 2010 - 01:27 PM

View PostMrWobbles, on 19 April 2010 - 04:10 PM, said:

010011000110111101110111011001010111001101110100001000000110110001100101011
101100110010101101100001000000110100101110011001000000110001001101001011011
100110000101110010011110010010110000100000011101000110100001100101011011100
010000001001000011001010111100000101100001000000111010001101000011001010110
111000100000011000010111001101110011011001010110110101100010011011000111100
100101100001000000111011101101000011010010110001101101000001000000110110001
100001011011100110011101110101011000010110011101100101011100110010000001101
100011010010110101101100101001000000100001100100000011000010111001001100101
001000000110001001110101011010010110110001110100001000000110111101101110001
01110

Translate here


Wrong, hexadecimal is on the exact same level as binary, it is just a different representation, with base-16 instead of base-2.
Was This Post Helpful? 0
  • +
  • -

#7 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 521
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: Original/Base Programming Language?

Posted 20 April 2010 - 02:51 PM

View PostRaynes, on 19 April 2010 - 08:23 PM, said:

Lot's of C++ compilers are written in C++ or C.


Response is useless, yet totally, 100%, correct.

I'd facepalm if you weren't right.
Was This Post Helpful? 0
  • +
  • -

#8 MrWobbles  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 31
  • View blog
  • Posts: 328
  • Joined: 11-April 08

Re: Original/Base Programming Language?

Posted 21 April 2010 - 10:02 AM

View Postprogramble, on 20 April 2010 - 12:27 PM, said:

Wrong, hexadecimal is on the exact same level as binary, it is just a different representation, with base-16 instead of base-2.


Well if thats all I got wrong then I am surprised - I took that class like 3 years ago...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1