作者yaote ()
看板Perl
标题[问题] Compiler vs Interpreter
时间Sat Jun 18 15:08:23 2011
大家都知道Compiler通常用在高阶语言C/C++,而Scripting Language通常用
Interpreter做解译,而我有点搞不清楚Compiler与Interpreter的差别。
就我来说,Compiler很简单就是下列流程:
C code(printf/for/while) -> [Compiler] ->
Assembly instruction code(ADD/SUB/MOV) -> [Assembler]
-> Machine binary code(0010001)
而Interpreter的角色呢?他是如何转换成binary code呢?是不是比Compiler多了
几个步骤呢? 假设我们用Perl写程式,如何转换成binary code呢?
Perl -> Interpreter -> a bunch of C code -> compiler -> assembly ->
assembler -> machine binary code?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.34.225.82
1F:→ kdjf:wikipedia/perl/Implementation 06/18 15:24
2F:→ kdjf:先去看看吧 06/18 15:24
3F:→ kdjf:每个语言都不太一样,从纯interpreted(eg. bash)到几乎变成 06/18 15:26
4F:→ kdjf:binary(eg. perl) wiki/Interpreter_(computing)也可以看看 06/18 15:27
5F:→ yaote:Wiki并没有解释如何变成binary code的细节。 06/18 15:33
6F:→ yaote:只是都是个抽象的大概解释,没有较Detail的流程 06/18 15:33