Is Ruby really an interpreted language if all of its implementations are compiled into bytecode?

前端 未结 7 925
渐次进展
渐次进展 2020-12-08 16:15

In the chosen answer for this question about Blue Ruby, Chuck says:

All of the current Ruby implementations are compiled to bytecode. Contrary to

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 17:04

    Nearly every language is "compiled" nowadays, if you count bytecode as being compiled. Even Emacs Lisp is compiled. Ruby was a special case because until recently, it wasn't compiled into bytecode.

    I think you're right to question the utility of characterizing languages as "compiled" vs. "interpreted." One useful distinction, though, is whether the language creates machine code (e.g. x86 assembler) directly from user code. C, C++, many Lisps, and Java with JIT enabled do, but Ruby, Python, and Perl do not.

    People who don't know better will call any language that has a separate manual compilation step "compiled" and ones that don't "interpreted."

提交回复
热议问题