<div dir="ltr"><div>Just to clarify a bit, we were more thinking of extending the default repl to have line editing features, rather then making xrepl the default, or having xrepl use libedit rather that libreadline.<br><br></div><div>It would not be too terrible if we required a user to have it installed to use it. (It's included in both OS X, and most Linux distros have good package management.)<br><br></div><div>I also think making readline/base use libedit, and readline use libreadline is a bit of a red haring. As, afaik, they have the same API, it doesn't make sense for one of them to be the 'base' of the other.<br><br></div><div>Here's another idea Asumu had (which I like), rather than bundling libedit with racket, or hoping the user has it installed we can take something like linenoise[1], and implement it in Racket (which is doable as the whole thing is about 1,000 lines of code anyway). I think this would avoid the dependency issue anyway.<br><br>[1]: <a href="https://github.com/antirez/linenoise" target="_blank">https://github.com/antirez/linenoise</a><br></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><br></div>~Leif Andersen</div></div></div>
<br><div class="gmail_quote">On Tue, Nov 25, 2014 at 1:00 PM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, Nov 25, 2014 at 11:38 AM, Sam Tobin-Hochstadt<br>
<<a href="mailto:samth@cs.indiana.edu" target="_blank">samth@cs.indiana.edu</a>> wrote:<br>
> On Tue, Nov 25, 2014 at 11:00 AM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>> wrote:<br>
>> Do you have in mind making "xrepl" intended to be part of Minimal<br>
>> Racket? If not, what's the mechanism for `racket` using "xrepl" when<br>
>> it's available?<br>
><br>
> I can think of a few ways of doing this.<br>
><br>
>  1 Just make xrepl part of minimal Racket (probably removing the<br>
> mandatory dependency on scribble/text/wrap)<br>
<br>
</span>If this is the only dependency that stands in the way of making it more<br>
minimal, then it should be easy to make it dynamically loaded (like much<br>
of the other functionality it uses).  Just have a wrapper that<br>
dynamically requires the wrap function, and if it fails, it will just<br>
not do the wrapping.  (IIRC, the things that xrepl uses wrapping for<br>
fall outside of what you can get with a naive and quick implementation,<br>
like wrapping error messages where the indentation matters.)<br>
<span><br>
<br>
>  2 Have `racket/init` dynamically test of the presence of<br>
> "xrepl/main.rkt" as a collection-file-path, and load it if available.<br>
>  3 Have `racket/init` (or the `racket` binary) test for something like<br>
> `racket/init/extended` which would be part of "xrepl" and part of<br>
> other extended repls.<br>
>  4 Like 3, but have an additional package which depends on "xrepl" and<br>
> just contains `racket/init/extended`<br>
><br>
> I prefer 2, 3, or 4 of these options -- it seems fine for "Minimal<br>
> Racket" to not have line editing, but I'd be interested to hear what<br>
> others expect.<br>
<br>
</span>(3) and (4) sound to me like an overkill -- `racket/init' is already<br>
supposed to be extra interactive repl stuff, and adding an extra-extra<br>
thing seem like overcomplicating it.  (2) sounds perfectly fine though.<br>
Also, as I said above, getting (1) should be easy, but is that the only<br>
dependency that would fall outside of a minimal distribution?<br>
<span><br>
<br>
>> A similar question applies to "libeditline". Currently, for Linux and<br>
>> other Unix platforms (not counting "natipkg" variants), our<br>
>> convention is that native libraries are either part of the<br>
>> `[g]racket` executable or they are installed separately by users<br>
>> through the OS's package manager. We can't link to "libreadline" by<br>
>> default in a Racket distribution, and since "libeditline" isn't<br>
>> typically included with Linux distributions (as far as I can tell),<br>
>> it seems like we haven't solved any problem unless we provide<br>
>> "libeditline".  Should "libeditline" become not only part of the<br>
>> Minimal Racket distribution, but even part of the Racket executable?<br>
>> Or should our convention and/or distribution infrastructure change?<br>
><br>
> I was thinking that the "readline-core" package would dynamically test<br>
> of "libeditline", and if it's not there fall back to "libreadline".<br>
<br>
</span>Why is it needed to have a core subset?  => What are the readline<br>
features that are missing from editline?<br>
<span><br>
<br>
> My opinion, as someone who isn't a lawyer but has read a lot about<br>
> this, is that this would not cause Racket to be a derived work of<br>
> readline.<br>
<br>
</span>If that's valid, then that would be really nice.<br>
<span><br>
<br>
> If we don't want to do that, I see a few possibilities:<br>
><br>
>  1. We ship xrepl in whichever way we decide, and change the message<br>
>  it prints when it can't find "libeditline" to suggest changing things<br>
>  or adding (require xrepl/readline) to .racketrc.<br>
>  2. We ship a copy of "libeditline"with xrepl as a built binary, even on linux.<br>
>  3. We statically link "libeditline" to Racket in the standard distribution.<br>
><br>
> I think 1 sounds most appealing if we're not ok with dynamically<br>
> falling back to "libreadline".<br>
<br>
</span>(1) sounds good, except that it must target naive users -- so suggetsing<br>
package installation is not a good idea.  An alternative to a printout<br>
would be a question:<br>
<br>
    I can't find editline (a library for line editing), but I see that<br>
    you have readline installed.  Use it instead?<br>
<br>
(And if readline does have some feature that editline doesn't, then the<br>
question can be always be asked.)<br>
<span><font color="#888888"><br>
--<br>
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:<br>
                    <a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a>                   Maze is Life!<br>
</font></span><div><div>_________________________<br>
  Racket Developers list:<br>
  <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
</div></div></blockquote></div><br></div></div>