Babylon Native Alternative

I’ve read that with Babylon Native you can run your application crossplatform using the same code, I’d like to ask if it would too much work to maintain a Typescript to CLI compiler so you can run your babylon app on any CLR like Mono for example.

pinging @bghgary and @syntheticmagus

Hi cilinhosan,

Welcome to Babylon! Transpiling TypeScript to something else was an interesting idea, and I believe it was one that we considered at the time we were making decisions about the implementation details of Babylon Native. However, we ultimately decided to go with a true native C++ solution — mainly because of portability.

Babylon Native isn’t intended to exclusively be a vehicle for pure Babylon apps. While it can certainly serve that function, we also designed it to be “embeddable” so that you could package it up into a component and use it inside other programs. Pretty much every every execution environment in existence has some relatively easy way to call pure native code: the Java Native Interface, for example, is what we’re currently using to get Babylon running as a component inside of React Native apps on Android. Going the other way, however—trying to incorporate, for example, a Mono-style CLI component into an app that isn’t already equipped with a runtime for it—is much more complicated.

So, in the interest of maximizing our portability both in terms of where Babylon Native could run and what it could be incorporated into, we chose instead to just bundle up a way to run real JavaScript on a real JS runtime (which, arguably, is just a non-CLI version of what you’re talking about) into a highly-consumable native package. There are some other advantages (and disadvantages) to that decision as well, but I think portability was the main motivator behind the decision we made.

4 Likes