You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Moddable SDK is primarily for building executables for microcontrollers, not computers. We do build and run executables on computers for our simulator (mcsim) and for many of our tools (mcconfig is written in JavaScript and executed by our XS JavaScript engine). We have limited support for building command line tools.
A good place to start is the the JavaScript REPL example at $MODDABLE/examples/js/repl. To run that on macOS, set-up the Moddable SDK and then:
cd $MODDABLE/examples/js/repl
mcconfig -m -p x-cli-mac
repl
Note a couple things:
The build target is "x-cli-mac" instead of "mac" or "sim" to indicate that this will run on the command line
This is a release build (no "-d") to avoid having debugger output in the REPL
On some versions of macOS you may need to remove -lpng16 from the the x-cli-mac makefile or you will get a linker error (yes, we should fix that)
When it starts up, you should see something like:
Moddable JavaScript REPL v0.0.5
XS engine v13.2.0
? for help
>
Use .help to see the list of installed commands. You can use the CLI class to add commands to the REPL.
Here's the bad news: the REPL does not currently support network operations. Adding that is possible, but not trivial. The REPL does support network operations on embedded devices, like the ESP32 MCU. There is an outstanding PR from @cmidgley that might be helpful here.
Is it possible to create a native executable using this SDK? I want to create a simple websocket client in Javascript that runs in a mac terminal.
The text was updated successfully, but these errors were encountered: