22

JAVASCRIPT AND PERFORMANCE

Running a computer program on a machine requires bridging the gap between the programming language and the machine’s own instruction format. This can be done by writing a program that interprets other programs, as we did in Chapter 11, but it’s usually done by compiling (translating) the program to machine code.

Some languages, such as the C and Rust programming languages, are designed to express roughly those things that the machine is good at. This makes them easy to compile efficiently. JavaScript is designed in a very different way, focusing on simplicity and ease of use. Almost none of the operations it lets you express correspond directly to features of the machine. That makes JavaScript a lot more difficult ...

Get Eloquent JavaScript, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.