4 ms·
"Interpreted language" is an imprecise term. A language is a language whether implemented in a compiler, an interpreter, or a REPL that includes a compile step.
by brlewis 10y ago
"Interpreted language" is an imprecise term. A language is a language whether implemented in a compiler, an interpreter, or a REPL that includes a compile step.
JavaScript is faster than Go in some benchmarks, and slower in others. In benchmarks where it's much slower, the reason isn't that JavaScript interpreters exist. The reason is design decisions in the JavaScript language that make optimization difficult. http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=v8&lang2=go http://benchmarksgame.alioth.debian.org/u64/compare.php?lang...
Someone familiar with the V8 compiler might correct me, but I suspect that the binary tree program is slowed by JavaScript object-property access always being a dictionary lookup. I suspect that fasta and reverse-complement are slowed by JavaScript's one-type numeric tower ... everything's a float.
- pcwalton 10y agoJavaScript property lookup hasn't been forced into hash table access for probably a decade now.
- igouy 10y ago> … I suspect that the binary tree program is slowed by … I suspect that fasta and reverse-complement are slowed by … Maybe it's the way the programs are written. For example, binary-trees Go #6 program is no longer shown because it doesn't do what's required.