It should be noted that rlwrap works on all programs that use readline. I've used it when starting out with programming in SML and getting annoyed at the missing arrow-up command history.
Actually, rlwrap works well with all line-reading programs that DON'T use the readline library, and not so well with some that do. Like the python debugger. :(