#2840 Support running Fantom code under more JS VM than Node

CretinHo Wed 16 Jun 2021

These readily available JS VM:

https://ftp.mozilla.org/pub/firefox/releases/78.1.0esr/jsshell/

https://github.com/chakra-core/ChakraCore/releases

https://bellard.org/quickjs/

Please add the ability to run Fantom code on them rather than just Node.

Manually feed the generated JS into them caused a real mess that nothing works.

So having Fantom to take care of it and running the whole pod without having to manually extract the generated JS is much better!

CretinHo Wed 16 Jun 2021

I extracted sys.js from sys.pod and test.js from test.pod

I put them in the same directory.

Then I tried to run test.js using each of the above JS VM.

Like this: ./js test.js

None worked. I found on test.js there is reference to root.fan. What is this? I have no root.fan in my project and there is no root.fan from the extracted content of test.pod, too.

brian Thu 17 Jun 2021

The goal of Node is to use the most commonly used JS runtime as a test harness. The actual target for Fantom JS is browsers. For the server our focus is on JVM. I am not sure how those platforms need to consume their JS, but for the most part what the Fantom compilers is plain old JS

CretinHo Fri 18 Jun 2021

I understand. Thanks for your clarification.

Login or Signup to reply.