Open MajeedKazemi opened 2 years ago
Agreed, javascript execution is preferred over python, and we can equate logging with print/say statements.
The following is an example of how we can do this.
var test = "console.log("Hello World");"
function execute(code) {
var F = new Function(code);
return (F());
}
execute(test);
use prompt to get input from user and test it
convert everything to JS and execute JS locally. This is a better approach compared to using Pyodide as it will allow us to do more interesting things such as getting user input through a modal similar to Scratch, or display output in interesting ways.
Using JS would also allow future versions of the tool to create interactive outputs (draw lines, animate objects, and etc.)