-----------------------------看了下po主說的書的英文原版,相關段落如下:“Of course, the machine defined by a certain language may be enormously complicated and expensive to construct directly out of electronic circuits but we can imagine it nevertheless. A machine with C or C++ or Java as its machine language would be complex indeed but could easily be built using today’s technology. There is a good reason, however, for not building such a computer: it would not be cost effective compared to other techniques. Merely being doable is not good enough: a practical design must be cost effective as well.”
不懂樓主什麼意思 c和java又不是機器語言
機器語言是1000111101101010101010101010101010100011111101111011110101011
-----------------------------看了下po主說的書的英文原版,相關段落如下:“Of course, the machine defined by a certain language may be enormously complicated and expensive to construct directly out of electronic circuits but we can imagine it nevertheless. A machine with C or C++ or Java as its machine language would be complex indeed but could easily be built using today’s technology. There is a good reason, however, for not building such a computer: it would not be cost effective compared to other techniques. Merely being doable is not good enough: a practical design must be cost effective as well.”
現在的machine code之所以能被機器理解是因為有相應的電子元件。比如說各種門組成的邏輯運算子。某些電路控制的branch jump..
所以作者只是假設如果我們直接建一臺可以理解C,C++,JAVA的機器。。也就是用電子元件對應上這些語言裡的各種syntax。。以現在的技術是可以完成的。。只是會非常的龐大而且價效比極低。。。
如果真的要實現的話,首先要有一個可以parse指令的東西吧,也許是一個巨大的FSN。然後至少每條指令都要有相應的一區域的電子元件去實現吧。比如assembly數字可以ADD, 那電路里就會有相應的adder...但是像c,c++,java這種高等語言。。。有class,function,overload...電路會非常的複雜。。。應該是不會有人做的= =