Are there any known limitation to Fantom's JavaScript compiler?
Which part of Fantom can't be compiled into JavaScript?
andySat 4 Dec 2010
The compilerJs itself is pretty complete. The big outstanding feature is facet support has not yet been implemented. Outside that, you're most likely to run into sys and fwt APIs that haven't been ported yet - mostly cause I haven't needed them for SkySpark. But we've built a pretty sophisticated front-end for SkySpark so quite alot of code has been implemented and beat on.
katoxSun 5 Dec 2010
@DanielFath: a useful comment by andy:
"You can run testSys in JS (via Rhino) with:
fan compilerJs::TestRunner <pod>[::<type>[.method]]
If a test class is not enabled - just add the @Js facet and recompile - and you can test - thats generally the easiest way to sort thru bugs."
I'd like to see a site with JS progress-o-meter which would give us better overall picture and it could also encourage people to finish certain APIs but someone has to implement it ;)
ahhatemSun 5 Dec 2010
How are the slot names of functions and field and the class names translated into javascript...
I am trying to asses if there could exist any sort of interoperability on the client between javascript and fan.
katoxSun 5 Dec 2010
@ahhatem, there is nothing preventing you from having 100% js-fantom integration. You only have to follow current conventsions. Let's say we have a class Item in pod example
Knowing this is useful if you want to extend Fantom types from javascript (or call them). There is no Javascript FFI so if you want to call js code from Fantom the best bet is to use native methods and call it from there. You only need to ensure that all functions you want to call are already imported.
katoxSun 5 Dec 2010
To understand the inheritance mechanism the best is to look at Obj js natives:
It means that $ctor of the extended type is automatically called with proper arguments on object creation via apply function. However you need to remember to manually wire your new inheritance hierarchy to ensure that all supertypes are initialized.
go4Mon 6 Dec 2010
It will be useful for Ajax to support XML or JSON.
DanielFath Sat 4 Dec 2010
andy Sat 4 Dec 2010
The
compilerJs
itself is pretty complete. The big outstanding feature is facet support has not yet been implemented. Outside that, you're most likely to run intosys
andfwt
APIs that haven't been ported yet - mostly cause I haven't needed them for SkySpark. But we've built a pretty sophisticated front-end for SkySpark so quite alot of code has been implemented and beat on.katox Sun 5 Dec 2010
@DanielFath: a useful comment by andy:
"You can run testSys in JS (via Rhino) with:
If a test class is not enabled - just add the @Js facet and recompile - and you can test - thats generally the easiest way to sort thru bugs."
I'd like to see a site with JS progress-o-meter which would give us better overall picture and it could also encourage people to finish certain APIs but someone has to implement it ;)
ahhatem Sun 5 Dec 2010
How are the slot names of functions and field and the class names translated into javascript...
I am trying to asses if there could exist any sort of interoperability on the client between javascript and fan.
katox Sun 5 Dec 2010
@ahhatem, there is nothing preventing you from having 100% js-fantom integration. You only have to follow current conventsions. Let's say we have a class
Item
in podexample
will have the following model in javascript:
Knowing this is useful if you want to extend Fantom types from javascript (or call them). There is no Javascript FFI so if you want to call js code from Fantom the best bet is to use
native
methods and call it from there. You only need to ensure that all functions you want to call are already imported.katox Sun 5 Dec 2010
To understand the inheritance mechanism the best is to look at
Obj
js natives:It means that
$ctor
of the extended type is automatically called with proper arguments on object creation viaapply
function. However you need to remember to manually wire your new inheritance hierarchy to ensure that all supertypes are initialized.go4 Mon 6 Dec 2010
It will be useful for Ajax to support XML or JSON.
ahhatem Mon 6 Dec 2010
Thanks for the detailed response...