Using 3rd Party Javascript Libraries


I'm working on a language that generates Javascript. I've built off of the Calculator JS example to give me a starting point, but the code that I am generating must integrate with a 3rd party Javascript library. The library is Babylon.js.

I really just need to be able to reference Babylon's types and functions in my mappings for generating the Javascript, but I can't find any way to reference a non-Java library as a model.

Is there something I am missing?



I think I have found that I can use a plain text generator to directly code the library types and functions, so that should work for now. For future reference, how could a library be incorporated as a feature of a supported language?


It's possible but complex. You'd need to look at how Java stubs are implemented in MPS and design something similar for JavaScript. The relevant part of MPS sources is here:


Please sign in to leave a comment.