One REPL to bind them all?

后端 未结 3 609
醉话见心
醉话见心 2020-12-28 14:22

I\'d like to know if there is a REPL which is not language-specific. I spend a lot of time dipping in and out of REPLs (mainly for Clojure, Scala and Haskell), and the bund

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 15:09

    Scala 2.9 REPL will have CTRL-R reverse search support. The nightly builds have that already. There has been context aware tab completion for a while (though it could be improved).

    When using scala with rlwrap, use the -Xnojline flag:

    rlwrap scala -Xnojline
    

    That prevents jline from interfering with rlwrap. Then rlwrap is free to use readline to implement cursor motions and history but that is before the interpreters sees the line and you won't have language-aware completion.

    I hope that the Scala REPL will be improved.

    • There is a presentation compiler that is part of 2.9 which I think is used for things like highlighting errors and completion.
    • The jline used by scala 2.9 is capable of using ansi colors leveraging jansi

    So I can dream that one day I will have IDE level feature in the Scala REPL. Realistically, it would require substantial effort and adding these features is surely lower priority than improving eclipse support for instance... Besides it may make more sense to add REPL support in eclipse.

提交回复
热议问题