Arc Forumnew | comments | leaders | submitlogin
A repl for Arc in (indirectly) Arc
6 points by akkartik 1359 days ago | discuss
It highlights comments, strings and matching parens as you type, and provides commandline history (caveats below). Particularly useful in learning situations if someone doesn't have readline libraries at hand (like on a mac without homebrew/macports) since it requires no dependencies besides anarki. Screenshot:

I must add that it has many issues. Off the top of my head, history isn't persistent. You can use up/down to navigate history but not left/right to edit a line. You have to backspace. It's super slow because it's an example app for my new project[1]. Up arrow loses anything you'd already typed in. And on and on. But if you still want to try it out:

  $ git clone
  $ cd mu
  $ git clone
  $ ./mu
[1], which allows me to write automated tests for interactive terminal programs using blocking I/O. Incidentally, one of the interesting things about mu is that it implements first-class continuations independently of arc/racket's call/cc. Continuations turn out to be particularly easy to understand/use in an imperative/assembly context. I just broke call-with-current-continuation into two operators: current-continuation which returns a value of type continuation and continue-from which takes a continuation as argument. I find them easier to reason about: all they do is save and restore the call stack, and they're easily generalizable to delimited versions as well. Perhaps call/cc is what Rich Hickey calls complected or not simple? A simple example, though it will require reading the project Readme first: One huge caveat: mu currently has no GC or even free. The longer it runs the more memory it consumes. Continuations will eventually complicate memory management to perhaps an unjustifiable degree.