Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 25th, 2003, 02:19 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
how prog langs are written

i don't get it.

php and such have functions that are recognizable only because there's a program written in another language that knows what they mean. but how are languages like C++ written?

does it all come down to 1 and 0? but why does the computer do the things it does what triggers it to respond to those 1 and 0.

i just would like to know the basic idea. if there's a link or 5 minutes of your time to give

thanks

Reply With Quote
  #2  
Old March 25th, 2003, 02:28 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Your correct, php and all parsed programs function because there is a program behind it that understands it.

This isn't far from the truth about what compiled programs are. The are (in very basic terms) just parsed programs also, just they are only parsed once and then turned into something executable (binary form) by another program. This program is commonly known as a compiler or interpreter.

As complex as any language can be, it is still just text until it goes through its compiler.

Reply With Quote
  #3  
Old March 25th, 2003, 02:41 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
ohh,

how are the compilers written. say for C++.

Is there like a hierarchy of languages? and what are they?

Reply With Quote
  #4  
Old March 25th, 2003, 02:46 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Now that is a whole different bucket of worms there my friend.
That is something that I will leave up to the better qualified to explain.

Reply With Quote
  #5  
Old March 25th, 2003, 04:52 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,440 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 50 m 56 sec
Reputation Power: 797
Normally, compilers are written in another language (usually C) until they reach the break-even point. This is the point, where the compiler of the language can by implemented in itself. From then on, the native language is used to implement its own compiler. For example, the first C++ compilers were written in C, and then the later refinements were written in C++ (sort of like a chicken and egg principle). For some compiled languages (e.g. Visual Basic ) and scripting languages (PHP, perl, python etc.), there is no break-even point and so C is used to write the whole compiler.

On the IBM PC, there was originally a C interpreter (written in assembler) called Tiny-C by Scott Gutherie. It only implemented a subset of the C language. Then a guy named Ron Cain used Tiny C to write a C compiler called Small-C, which he published in Dr. Dobbs Journal. Then Jim Hendrix (not Jimi!) added more features to the Small-C compiler using it to compile itself, to make it a complete C compiler.

Soon, other people used this C compiler to bootstrap their own C compilers and before long, we had Aztec C, Lattice C, Wizard C, Whitesmiths C, Mix C, Datalight C etc. I believe Lattice C was one of the first commercial C compilers for the IBM PC and was used to implement a lot of languages (including bootstrapping some of the other C compilers).
Datalight C later called themself Zortech and released a C++ compiler called Zortech C++ (later called Symantec C++)
Lattice C was bought up by Microsoft, who sold it as their own compiler
Wizard C was an incredibly fast compiler and Borland bought them out, integrated an IDE on to the compiler and then sold it as Turbo-C.

Reply With Quote
  #6  
Old March 25th, 2003, 05:50 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
you mentioned assembler, is that what 1 and 0 are ? is it what makes the hardware do the things you want, and where the software and hardware get the closest?

i just don't understand how something virtual can control or be kept on something that's physical matter. and then be displayed.

Reply With Quote
  #7  
Old March 25th, 2003, 06:09 PM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
No, assembler is not 1s and 0s. Assembler is VERY close to machine code (the code that the processor can understand) but has a few tricks to make it easier than writing something like:

F2 1E 03

To understand machine code you would need to understand a bit of electronics and how gates work. VERY basically a machine instruction (like our F2 above --which is just a hexidecimal representation of a binary number) would correlate to a certain path inside the processor that would process the instruction.

That's about as detailed as I can get without getting in too deep.
__________________
FSBO (For Sale By Owner) Realty

Reply With Quote
  #8  
Old March 25th, 2003, 06:22 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
ooh

thanks =)

Reply With Quote
  #9  
Old March 25th, 2003, 06:33 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,440 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 50 m 56 sec
Reputation Power: 797
Like rodk mentioned, assembler is very close to machine code. Let's say you want to add 5 to the value contained in memory address 1145. In machine-code, the instructions would be (hypothetically of course):
42 1145 5
where 42 is the hypothetical instruction op-code to the CPU to tell it to add numbers. In assembler, this would be written as something like:
ADD [1145], 5

See the similarity?? The assembler code is very close to machine code, except that it uses mnemonics for all the op-codes. So, this makes the code a little more readable, since you can tell that it is adding two numbers, instead of trying to remember what the number 42 does.

Reply With Quote
  #10  
Old March 25th, 2003, 06:44 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
that's complicated. not something i'd understand now or in the close future.

thanks a lot for explaining =)

Reply With Quote
  #11  
Old March 26th, 2003, 06:14 AM
rendy's Avatar
rendy rendy is offline
Moderator
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: London
Posts: 348 rendy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 21 m 17 sec
Reputation Power: 7
Everyone should be forced in life to write a temperature controlled fan 'program' in 64K assembler

Reply With Quote
  #12  
Old March 26th, 2003, 01:09 PM
riv's Avatar
riv riv is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 463 riv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 50 sec
Reputation Power: 8
One may wonder how to program a compiler if there's not even any existing type of language.

Back then they used a series of switch to write the data directly into the memory using the binary sequence.

If you remember the movie Apollo 13 you will see that some NASA cs are reprogramming one of the mainframe doing just that with something like this. Eventually they programmed an OS to make it easier to add peripherals (such as tty's or tape drives).
__________________
Words must be weighed, not counted.

Reply With Quote
  #13  
Old March 26th, 2003, 01:27 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,440 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 50 m 56 sec
Reputation Power: 797
Yep, seems that Seymour Cray had the operating system of the Control Data Corporation CDC 7600 memorized and would toggle it in off the top of his head.

Altair (the first personal computer) hackers used to do the same thing. IIRC, when one of the guys from the Homebrew Hacking Club (was it Steve Dompier?) was trying to demonstrate his music program, he was toggling it in by hand when someone tripped on his power cord. Poor guy had to start again from scratch

Reply With Quote
  #14  
Old March 26th, 2003, 01:36 PM
wannabe wannabe is offline
=) wannabe?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2002
Location: florida
Posts: 2,153 wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level)wannabe User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 21 h 58 m 25 sec
Reputation Power: 9
Send a message via AIM to wannabe Send a message via Yahoo to wannabe
but why make things easier and easier, they should've stopped at some point. if it stayed that way, there would so much less competition in this area.

Reply With Quote