taylor_venable |
03-02-2007 07:30 AM |
Compilers
Quote:
Originally Posted by kalabanta
So are C and C++ the only programming languages that actually have their own form of a compiler?
|
No -- many languages compile to native code, and it's possible to write such a compiler for any programming language. For example, the following languages all compile to native code on some platform or another: Ada, C, C++, Erlang, Haskell, Java, OCaml, Standard ML. All a compiler does is translate the syntax and semantics of a language into the raw CPU instructions needed to execute programs written in that language, nothing more.
Typically, the more dynamic a language is (e.g. Perl, Python, Ruby, Scheme) the less likely it is to have a direct-to-native code compiler. Usually the course taken in such a case is to convert the program in the dynamic language into an equivalent C program, which is then compiled to native code.
And BTW, as far as learning Ruby goes, try Googling. Or even better, buy the Pickaxe book.
|