#interop between javascript and erlang targets

1 messages · Page 1 of 1 (latest)

dapper lodge
#

Right now I have a library that is targeting javascript and I want to use it in a project that targets erlang, is there an easy way to do interop between the two of them? Or are the targets for each isolated?

cunning crescent
#

the compiler doesnt care what you put in target field for packages. it anaylses the api per-function to determine what can be used on what target

dapper lodge
#

How would it work then if the function cannot be used? For example I'm using javascript_dom_parser to get the dom tree for the library but I need the output of this in the project running in the erlang target, would there need to be a fallback on javascript_dom_parser for this to work?

cunning crescent
#

if you write one yeah

#

if you dont write one the project wont compile because theres no implementation for that function for the given target

dapper lodge
#

I see. Ok I'll look into adding some extra bindings for fallback

cunning crescent
#

if its not your project and the package doesnt have a fallback or erlang implementation you're out of luck

#

thats just kinda how multi-target stuff works im afraid ^.^

dapper lodge
#

got it got it