Talk:Host object APIs

From MozillaWiki
Jump to: navigation, search

I'm worried that we're overloading "native" too much. but the damage is pretty limited so we can go with it until we come up with something better. ES4 lets you declare types as such, like a typedef, we might want to borrow that syntax if its easy.

If you declare a native pointer, can we require it to be private? GO could automatically do this but thats spooky action at a distance. heck, if GO could do escape analysis on it that would be good too... the only thing you ought to be able to do from AS3 is copy to local or builtin private slots. any native type cant be used on a nonprivate function signature. error to upcast a native type to *. etc. we currently dont enforce any of this since native pointers are *, however the will treat them as void values, is that still true?

Shall we add verbage for areas we are willing to relax?

I'm not clear on the no native ctor rule, not sure that's a requirement. native methods have signatures just like any other method and they're invoked like any other method.

Native functions written in forth can take varargs, we could allow native methods to do that if they accept Box[], the risk/downside is that now they'll need api's for doing things with Box values, which are the kinds of things we want to avoid. but, we already allow * and Object types on native signatures, which exposes Box to native code already.

Is it possible to bury the references to host_abc_data inside the generated code for a callin? then the vm initialization is just host_init(gc, vm_config). then the callin functions and headers are the only artifact of AS3 compilation that shows through to C++.