Hacker News new | ask | show | jobs
by gruseom 5305 days ago
Somebody showed me some shit Mathematica can do (by way of embedding images and live representations of data) that goes way beyond this and any other Lisp REPL I've seen, so let's not get too smug.

On another note, it's a pleasure to see a bit of the I Ching in there - in the classic Wilhelm/Baynes edition, no less. It is one of the greatest works of civilization. (As for Wilhelm/Baynes: how a translation of a translation could have turned out so well is a mystery. Putting it beside any other I Ching in English is like comparing a Monet to a daguerreotype.)

1 comments

I rarely use the REPL directly in Lisp anymore, I use the Superior Lisp Interaction Mode for Emacs, better known as SLIME. emacs had a project running for a while for video editing. It also has a working google maps embedding. I'm sure with appropriate whacking I could intertwine it with a Lisp listener instead of my IDE.
Slime is a Lisp REPL. It's the one I was thinking of. Yes, people have dabbled around the edges adding images and other things that Emacs can do. But that isn't the same thing as a REPL designed with data visualization in mind. Lisp is not the state of the art here.
Granted.

To be 100% honest, I'm not sure why a programming language REPL needs to have full data visualization. I may not fully get the idea of REPLs, but it would seem to me that that would be the responsibility of a layer above it to manage data presentation; sophisticated data I would consider to require a domain-specific viewer anyway.

I agree with you there, so I guess what I want is a REPL that has hooks for custom printers, i.e to display an object of type X my way instead of the usual way. I'd like "printing" to optionally include graphics or whatever else makes for a good display of that data. And I'd like the representation to be interactive, so that one can drill down into sub-data or whatever else is appropriate. That too (obviously) is the responsibility of the custom printer, not the REPL itself, but I wish the REPL would make it easy to build such extensions. Little domain-specific visualizers.

Why? Well, some programs rely heavily on specific data structures that may not be very easy to interact with if you print them out as generic lists or hashtables or whatever. The Slime Inspector is next to useless for things of any complexity.

I present to you print-object, a generic function in Common Lisp.

http://clhs.lisp.se/Body/f_pr_obj.htm

So say you have a object type FOO, you can do this:

    (defmethod print-object ((obj FOO) stream)
      ...)
Now, when you have a FOO on the repl, print-object will be called.

Obviously it doesn't provide a drilldown approach and any number of nifty and useful functions.