views:

354

answers:

1

Why might you want to write a program in a machine independent language instead of a machine- dependent language? Why might a machine-dependent language be more appropriate for writing certain types of programs?

+3  A: 

In order to write a program in a machine independent language there must be something on this machine that will convert this language to a machine specific language (machines can read only machine language). The pros of this is that this something could perform optimizations for the specific machine it is running on which you won't be capable of doing in your machine dependent language as it is quite difficult to cover all the different machines your application could possibly run on.

Darin Dimitrov
+1 because I never thought of the optimization thing.
thinkswan
So does it all boils down to efficiency and portability?
Maxood
Efficiency and portability are important aspects of computer programs.
Darin Dimitrov
Wonder why virtual machines were not there when C or C++ was invented? Is it because platform independence was not a big issue in the 70s and 80s? Any comments?
Maxood
Virtual machines are not a new concept. `SmallTalk` has been around for some time.
Darin Dimitrov
SmallTalk was the first popular language that brought the concept of Virtual Machine. And that was in 1970s.Why virtual machines were not considered in the case of C++ when Bjarne Stroustrup invented it in 1985? Although, i know that he worked on Simula 67 and C to create the new language.But why virtual machine was not there?Why James Gosling was the only person after more than a decade (after SmallTalk) to re-introduce the concept of virtual machines for Java in the 1990s?
Maxood