TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Improve your REPLs with rlwrap

91 pointsby telemachosover 12 years ago

12 comments

larsbergover 12 years ago
This program is exactly what we usually recommend for people who aren't using SML/NJ inside of an Emacs inferior window (which is far and away the most common usage mode for experienced SML/NJ programmers - all ten of us &#60;grin&#62;).<p>I personally apologize for my laziness. Two or three different times I've started in on making something similar to the haskeline package in GHC to provide readline-style support to make life easier for students, but have never quite finished it up. Unfortunately, "just linking" readline/libedit isn't a very friendly solution given the way that the interpreter is currently architected, as it's written on top of the ML basis library primitives for reading/writing individual characters from the input stream.
评论 #5087285 未加载
评论 #5089991 未加载
jackalopeover 12 years ago
I've been using rlwrap for years with Oracle's sqlplus command line client on Linux.<p>Because it uses readline, it can benefit from settings in ~/.inputrc, along with all of your other readline-based applications for a more uniform experience.<p>For example, I'm a vi(m) user, so I put this in my .inputrc:<p><pre><code> set editing-mode vi </code></pre> That's just the tip of the iceberg.<p>These days, I tend to use the dbext vim extension for Oracle queries, allowing me to develop and save them in one file per project. But when I need to fire off something quick on the command line, it's nice to have rlwrap available.
评论 #5087854 未加载
Inufuover 12 years ago
This is great, exactly what I needed for the new Coursera class about Programming Languages: <a href="https://class.coursera.org/proglang-2012-001/class/index" rel="nofollow">https://class.coursera.org/proglang-2012-001/class/index</a><p>(They start of with ML and a very simple REPL)
评论 #5087138 未加载
wgingover 12 years ago
OS X users, I advise using<p><pre><code> brew install rlwrap </code></pre> instead of downloading the tarball in the link. You may feel tempted to download a tarball and compile readline. But I experienced the problem mentioned in rlwrap-0.37/BUGS:<p><pre><code> 49-On recent OS X sytems, libreadline is not the real thing, but a 50-non-GNU replacement. If the linker complains about missing 51:symbols, install GNU readline and try again. </code></pre> This may then lead you to attempt compiling and installing GNU readline, which will ultimately lead you to try to solve more problems you're having in compiling readline. You might find this fun. But if you just want to get things over with, there is an easier way. Homebrew[1] to the rescue:<p><pre><code> brew install rlwrap </code></pre> Perhaps this is just obvious to others. Would've saved me a few minutes to hear this, though.<p>[1]: <a href="http://mxcl.github.com/homebrew/" rel="nofollow">http://mxcl.github.com/homebrew/</a>
评论 #5088115 未加载
malandrewover 12 years ago
For the rlwrap gurus in the thread, is there a way to use rlwrap to better deal with multiline expressions in the repl?<p>For example, when using a clojure repl and entering a multiline expression, I might err on one line and want to go back and correct that line before evaluating the expression. Unfortunately, the only option I have right now is to terminate that expression by entering in a bunch of closing parens and then trying to enter in the entire multiline expression again. It'd be great if multiline expressions could be modifiable and if you could up arrow to load a previous multiline expression.
评论 #5088865 未加载
6renover 12 years ago
I just want to say that rlwrap is awesome.<p>Such a <i>simple</i> idea, yet so effective.
nigglerover 12 years ago
rlwrap seems cool at first blush, but you quickly realize that for anything nontrivial (e.g. context-aware autocomplete) you need to use readline directly
评论 #5088324 未加载
pi18nover 12 years ago
I knew about rlwrap, but hadn't bothered to learn anything in depth. Thanks, keywords are a great feature that I wouldn't have known without this.
shitlordover 12 years ago
For people who like ruby but think irb sucks, there's pry (<a href="http://pryrepl.org/" rel="nofollow">http://pryrepl.org/</a>), but it's still missing some features.
评论 #5091227 未加载
prezjordanover 12 years ago
This is a godsend, thank you! I've been having a tough time using `sml` and `gprolog`, but this fixed every single issue I found. Thumbs up.
toolsliveover 12 years ago
ocaml has an awful default interpreter repl, so most people use it with emacs. Alternatively, my default rlwrap is this:<p>rlwrap -p"0;31" ocaml -init _init.ml<p>the -init allows me to preload, set directories aso.<p>As a remark on the side. A lot of people complain about a lot of things without even bothering to improve the quality of their working environment.
Syssiphusover 12 years ago
News at 11'