I did manage to run some JS code generated from ATS in a React-native project (for printing out factorial numbers). I was actually able to load in the entire libatscc2js library, and I wrote the factorial function in CPS-style:
// implement fact(n) = kfact(n, lam(res) => res) // implement kfact(n, k) = if (n > 0) then kfact(n-1, lam(res) => k(n*res)) else k(1) // I will post my code once I can get something more interesting. In the long run, it may make even more sense to transpile ATS into Java (instead of JavaScript) for targeting Android. ATS can already be used with Objective-C. So targeting iOS is already within reach. One just needs to figure out a way to stream-line it. Cheers! On Wednesday, November 22, 2017 at 10:44:36 PM UTC-5, gmhwxi wrote: > > Thanks for the links! > > Will try to find time to do a simple example using ATS and React-native :) > > If you are already familiar with React-native, then doing such an example > should be straightforward: > > 1) Pick a React-native project you did; > 2) Take out the logic part and do it in ATS; then compile ATS to JS; > 3) Combine the rest of JS code in your project with the JS code generated > from ATS source. > > Cheers! > > On Wednesday, November 22, 2017 at 10:08:44 PM UTC-5, Raoul Duke wrote: >> >> That is cool. There's some other things that might be worth looking at >> as food for thought. (some of these are for React-Native since I am >> more on the mobile side, not on the web side...) >> >> Haxe https://github.com/massiveinteractive/haxe-react >> >> Reason >> https://blog.behrends.io/how-to-setup-reasonml-for-a-react-native-project-8c51f1cc1d34 >> >> >> Rust >> https://medium.com/@marekkotewicz/building-a-mobile-app-in-rust-and-react-native-part-1-project-setup-b8dbcf3f539f >> >> > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/a6238064-e0ca-4629-9aef-571de135f730%40googlegroups.com.
