Closed awcoding closed 7 years ago
I have reproduced the issue; this looks like a bug.
Regarding task.js
, I'm not sure what exactly you mean. Generators expose a nice interface that might be useful for a native API one day, since you can "pause" a JavaScript function to wait for a DoppioJVM function call to return. But it's not fruitful to pursue them as the default solution until they are present in all web browsers and are fast.
@awcoding you need to use a package name, not a class name. The error message should be fixed, though.
Try: ./doppioh -classpath . -d natives/ classes/ns
@awcoding OK, I was wrong; the help text specified that class names should work. I found a bug that prevented it from working. This is now fixed in v0.4.2. Thanks for reporting!
Thanks for that. Sorry for the late response. I just got back from my vacation.
Is it meant to put more than: registerNatives({ }); in the file? That's all I get.
BTW Regarding js generator support, I think it's in Chrome, FF & Microsoft Edge now. That's pretty good. I doubt it will get any better than that for the next 5 years.
Is it meant to put more than: registerNatives({ }); in the file? That's all I get.
It will put that into a file if the classes you passed to doppioh
have no native methods. Are you sure your target classes/packages have native methods?
BTW Regarding js generator support, I think it's in Chrome, FF & Microsoft Edge now. That's pretty good. I doubt it will get any better than that for the next 5 years.
Oh, that's good progress. My next point still holds, though: They need to be relatively fast. I know that initial generator support limited their execution to JS interpreters, limiting their performance. The last I heard, FF and Chrome landed some initial JIT support, but the performance story isn't clear yet. I talked with the folks who work on Pyret who may evaluate a generator-based solution for their native JS functions; if it works out for them, maybe I'll look into using them in Doppio.
Oops, forgot my native keyword,. :)
I had a problem with generating a native stub method using doppioh.
PS ES6 Generators have started working for me lately in chrome. So I thought an approach like this (https://github.com/mozilla/task.js) might be of interest, for a potential solution to the browser api wrapping issue in doppio.