Ask HN: Is a JIT Necessary for a JavaScript Runtime?

4 points by thosakwe ↗ HN
Hello! I am considering eventually writing a Web browser as an educational project.

I’m wondering if a browser with a JavaScript interpreter without just-in-time compilation would be too slow to be actually usable.

I think you could argue that if a site is unbearably slow in a regular interpreter, it’s probably also slow in v8 or another runtime.

I don’t doubt that I could write one... Just wondering if all the time is worth it.

Thanks!

2 comments

[ 3.5 ms ] story [ 15.0 ms ] thread
I’d it’s an educational project then go for it! It would be usable for reasonable websites but would probably struggle with gmail. Performance would also depend on your DOM implementation.
For your desktop browser you want JIT, but it's absolutely not required for all applications. For example, some platforms don't allow JIT due to security concerns, so any JS on those platforms has to be interpreted. There are also JS runtimes like JerryScript intended to run in low resource environments where JIT wouldn't be feasible.