News for hackers. Stuff that matters.
Re:What makes a good REPL? by flavio81 on Monday August 28, 2017 @09:36AM (#15116397)
Take a look at Smalltalk's environment and take a look a t Common Lisp's REPL. They have all the features that make for a good 'REPL'.

(As noted before, REPL is a Lisp term that stands for:

read - from keyboard input, parse the input string into the syntactic structure of the language

eval - eval the expression, this includes binding variables or defining new functions, also re-defining functions, even if such function is currently under execution on the running program.

print - print the result of the evaluation (in Lisp all expressions evaluate to something, even if this 'something' is NIL).

loop - go to 'read')

Re:What makes a good REPL? by junke on Monday August 28, 2017 @09:44AM (#15116446)
> in Lisp all expressions evaluate to something

Minor nitpick, but note that if you define:

    (defun foo () (values))
Then (foo) does not return a value and accordingly, the REPL prints nothing. But in a context where you need a value, that value would be NIL: if A evaluates to 3, then after (setf a (foo)) it will evaluate to NIL.
Re:What makes a good REPL? by kazinator on Monday August 28, 2017 @05:35PM (#15120272)
According to a famous epigram by Alan Perlis, Lisp programmers know "the value of everything, but the cost of nothing". It reflects the expectation that a language which calls itself Lisp is expected to produce a value out of any expression which evaluates.

Though Common Lisp adds the nuance of multiple values, the behavior you describe is how it conforms to this general expectation. Code written in an everything-really-has-one-value dialect of Lisp can be easily transported to Common Lisp (or at least transported without without difficulties specifically caused by this issue).

Scheme, a Lisp-like language, allows some evaluable expressions to have an "undefined" or "unspecified" result value. Logic translated to Scheme from a Lisp dialect without attention to this issue can have a surprising or incorrect behavior. For instance, if the original code executes a do loop, with the expectation that it yields nil (or some similar false/empty value in the original dialect). In Scheme's do loop, if the result expression is present then it specifies the value; otherwise the value is not specified.

Re:What makes a good REPL? by flavio81 on Tuesday August 29, 2017 @01:53PM (#15126186)
> Scheme, a Lisp-like language, allows some evaluable expressions to have an "undefined" or "unspecified" result value.

That's why they are heretics !!

(Just joking of course... Scheme is the other great Lisp dialect.)

Re:What makes a good REPL? by nerdponx on Monday August 28, 2017 @04:22PM (#15119752)
> Common Lisp's REPL

The SBCL and CCL REPLs do not support readline-style editing. This actually makes them infuriating to use outside of Emacs or some other IDE-like environment. There is definitely a market for a high-quality, implementation-independent Lisp REPL.

Re:What makes a good REPL? by flavio81 on Tuesday August 29, 2017 @01:52PM (#15126179)
> The SBCL and CCL REPLs do not support readline-style editing. This actually makes them infuriating to use outside of Emacs

TL;DR: I fail to see how this can be a problem.

Yes, but they do work fine inside Emacs (or perhaps inside other IDEs), and if i was using the SBCL command-line and needed readline-style-editing, then it was because I'm developing or debugging, so I'd be inside Emacs (or other IDE) in the first place...

Re:What makes a good REPL? by SomeHacker44 on Monday August 28, 2017 @05:08PM (#15120086)
rlwrap FTW
Re:What makes a good REPL? by nerdponx on Wednesday August 30, 2017 @08:01PM (#15137132)
Also linedit. But using it still requires you to add it to your favorite implementation's init file. Would it be possible to write a "meta-REPL" using linedit? Then again, there already is a Jupyter kernel for CL, so maybe I should look into making that work for me.