Why does c++ need a compiler? Does ruby use a compiler?
Moderator: Coders of Rage
Why does c++ need a compiler? Does ruby use a compiler?
Why does c++ need a compiler, and html doesnt? does ruby need a compiler, if not then what did I even download?
Link to what I thought was a ruby compiler. http://www.ruby-lang.org/en/downloads/
a confused person.
Link to what I thought was a ruby compiler. http://www.ruby-lang.org/en/downloads/
a confused person.
"Criticism is something you can avoid easily by saying nothing, doing nothing, and being nothing. " - Aristotle
http://www.facebook.com/profile.php?id= ... ef=profile
http://www.facebook.com/profile.php?id= ... ef=profile
- ismetteren
- Chaos Rift Junior
- Posts: 276
- Joined: Mon Jul 21, 2008 4:13 pm
Re: Why does c++ need a compiler? Does ruby use a compiler?
Im am not an expert, and a can give you the fully correct explanation.
But basicly; when you compile a c++ file, the compiler makes it into an executeable .exe file, wich your computer can run. HTML dosent have to be translated into anything else for your browser to read it.
I am not sure if ruby gets compiled...
(i dont know if the thing you linked to is a compiler. It might be a libary(a set of basic funtions))
But basicly; when you compile a c++ file, the compiler makes it into an executeable .exe file, wich your computer can run. HTML dosent have to be translated into anything else for your browser to read it.
I am not sure if ruby gets compiled...
(i dont know if the thing you linked to is a compiler. It might be a libary(a set of basic funtions))
- Moosader
- Game Developer
- Posts: 1081
- Joined: Wed May 07, 2008 12:29 am
- Current Project: Find out at: http://www.youtube.com/coderrach
- Favorite Gaming Platforms: PC, NES, SNES, PS2, PS1, DS, PSP, X360, WII
- Programming Language of Choice: C++
- Location: Kansas City
- Contact:
Re: Why does c++ need a compiler? Does ruby use a compiler?
Also note that this is required because Windows, Mac, and Linux all read different file types when they run, so they would have to be compiled specially for each.ismetteren wrote:Im am not an expert, and a can give you the fully correct explanation.
But basicly; when you compile a c++ file, the compiler makes it into an executeable .exe file, wich your computer can run.
A compiler takes your code and essentially converts it into Assembler code. The machine doesn't understand C++, but it understands Assembler and Machine Language.
Some languages are scripting languages and, instead of a compile, they have an interpreter. An Interpreter will not generally compile or mess with the code beforehand, it just starts at the starting place, reads each line, and executes it as it comes up. If something's wrong, THEN it complains. Visual Basic, Python, and Lua are scripting languages.
No idea about Ruby.
Re: Why does c++ need a compiler? Does ruby use a compiler?
Ruby is a scripting language too.
Technically, you could think of a browser as the "compiler" for HTML, if you use the term compiler loosely.
Technically, you could think of a browser as the "compiler" for HTML, if you use the term compiler loosely.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Why does c++ need a compiler? Does ruby use a compiler?
Ruby is interpreted, not compiled. It's a scripting language just like Perl, Lua, Python, etc.
HTML is "interpreted" by your browser.
HTML is "interpreted" by your browser.
Re: Why does c++ need a compiler? Does ruby use a compiler?
I've only ever used Ruby in scripts, and then had a language or program use the scripts, but never complied it to an executable. Although, I am pretty sure it can/has be done. I'd have to research more, Ruby is not one of my go to scripts.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Why does c++ need a compiler? Does ruby use a compiler?
Ruby, Perl, Lua, and those kinds of scriping languages can be "compiled" into executables in a sense. It's not the same as compiling a C/++ program. You are basically packaging your script with its executable interpreter into a single executable file. Your script is still being interpreted. It's not magically becoming a compilable language.
Re: Why does c++ need a compiler? Does ruby use a compiler?
yeah that's kinda what I meant, sorry I wasn't more clearerGyroVorbis wrote:Ruby, Perl, Lua, and those kinds of scriping languages can be "compiled" into executables in a sense. It's not the same as compiling a C/++ program. You are basically packaging your script with its executable interpreter into a single executable file. Your script is still being interpreted. It's not magically becoming a compilable language.
Re: Why does c++ need a compiler? Does ruby use a compiler?
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
- mllarson
- Chaos Rift Regular
- Posts: 183
- Joined: Fri Nov 14, 2008 5:20 pm
- Location: Minnesota, where "Cold as Hell" has real meaning...
Re: Why does c++ need a compiler? Does ruby use a compiler?
A scripting language is interpreted by another program. In other words, it is "looked at" by a program to see what tasks are supposed to be done. This type of language is slower than compiled. A compiled language is one that is looked at by a compiler program, and then translated into the machine's native instruction set. Certain scripting languages like PHP have a compiler to make it faster to run. Basically scripts are used to make anything that you'd want to run on any type of computer. Compiled programs, however, only work on the CPU type they were compiled for. Hope that helped more than it confused.
-Matt
-Matt
"Mmmm... these paint chips are scrumptious!"