Hacker News new | ask | show | jobs
by steveadoo 3223 days ago
If you could AOT compile the templates into bytecode, which has to be parsed, why not just AOT compile the templates straight to JavaScript(like Angular 2/4)?
3 comments

This is what I was going to ask as well. The only benefit I can see to this is that they are trying future proof for when WebAssembly or some other back end is more prevalent? Maybe they want to do Glimmer-Native?

Handlebars -> JS/TypeScript compiler -> Bytecode -> JS probably anyway -> HTML seems like a lot of work.

The bytecode representation is more compact than the compiled JavaScript. And this has an impact on execution speed.

See past discussion: https://news.ycombinator.com/item?id=14050625

I would assume because their VM/bytecode version is very fast at rendering updates and smaller in size than a "represent the bytecode as JS" version.