Assemblyscript: [Feature request] Add REPL

Created on 29 Jun 2019  路  3Comments  路  Source: AssemblyScript/assemblyscript

It will be nice to have REPL with history and minimal environment. I guess we could reuse some urils from node.js like "repl" module:

const Repl  = require('repl');

const repl = Repl.start({
  prompt: 'assemblyscript> ',
  useColors: true,
  ignoreUndefined: true
});

repl.on('line', line => {
   line = line.trim();
   // try compile assemblyscript for this line here
});
question stale

All 3 comments

Since we are talking about a static compiler here that cannot evaluate an additional line ad-hoc, it looks like the only way this can be done is to keep a complete history of the input (discarding invalid input) and recompile everything with a new line added, including any variable assignments, function calls etc. This might work somehow, but I wonder if it's a good match due to compile time delay.

I guess it possible. For example Rust has some unofficial crates for this. Like evcxr_repl and runner. Also see RFC proposal.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DuncanUszkay1 picture DuncanUszkay1  路  3Comments

jerrywdlee picture jerrywdlee  路  4Comments

evgenykuzyakov picture evgenykuzyakov  路  3Comments

kyegupov picture kyegupov  路  3Comments

pannous picture pannous  路  4Comments