What do you do for memory management? Conservative GC or Ref counting? If ref counting, how do you detect cycles?
It does appear most JS features can be translated to C++, even if at some overhead. Did you encounter any which wasn't straightforward?
It does appear most JS features can be translated to C++, even if at some overhead. Did you encounter any which wasn't straightforward?
There were a lot of hurdles along the way and we solve them as we come across them. Keeping values native when JS uses them dynamically was a challenge. d = new Date(); d.foo = 1 is easy if you box everything, but then it's a slow interpreter (like some other projects in the field). So we had to invent a new mechanism; native types get a side table for extra properties.
Generics and union types were also challenging: one JS generic can need several different C++ layouts.
eval is limited: new Function runs on a small evaluator written in C++, and direct eval isn't supported yet.