News for hackers. Stuff that matters.
Re:Can your REPL do this? by mtraven on Wednesday December 07, 2011 @10:50AM (#3324254)
Still waiting for a REPL that could what Lisp Machines could do in the early 80s -- namely integrate graphics with object-specific behavior.

http://dspace.mit.edu/handle/1721.1/6946

http://en.wikipedia.org/wiki/Common_Lisp_Interface_Manager

http://www.sts.tu-harburg.de/~r.f.moeller/uims-clim/clim-int...

Re:Can your REPL do this? by gatlin on Wednesday December 07, 2011 @01:30PM (#3325094)
I think [Racket][1] does this.

[1]: http://racket-lang.org

Re:Can your REPL do this? by omaranto on Wednesday December 07, 2011 @02:50PM (#3325577)
Here is a direct link to a tutorial that shows off graphics in the Racket REPL: http://docs.racket-lang.org/quick/index.html
Re:Can your REPL do this? by draven on Wednesday December 07, 2011 @11:37AM (#3324489)
There's a listener written with McClim that's easily installable with quicklisp. It's the one captured in the wikipedia article screenshot actually.

(ql:quickload 'clim-listener) (clim-listener:run-listener)

Re:Can your REPL do this? by ruediger on Wednesday December 07, 2011 @02:30PM (#3325448)
I wish Emacs would provide a canvas like API to draw in buffers. That way integrated graphics could be easily added. This would create a completely new Emacs experience.
Re:Can your REPL do this? by smashing on Wednesday December 07, 2011 @08:03PM (#3327034)
There is an Artist Mode for Emacs. The "pictures" are ASCII-esque ;) http://www.cinsk.org/emacs/emacs-artist.html
Re:Can your REPL do this? by ruediger on Wednesday December 07, 2011 @08:47PM (#3327152)
I know. But for serious application a real drawing capability is needed. This should actually be possible to implement on top of the GTK+ layer.
Re:Can your REPL do this? by tokipin on Wednesday December 07, 2011 @12:22PM (#3324724)
Do you know if Mathematica does what you're describing? Mathematica functions and calculations can take arbitrary objects as arguments. Example: http://blog.wolfram.com/2008/12/01/the-incredible-convenienc...

And arbitrary objects can take the role of unique values. It's quite convenient, especially considering that Mathematica's language and display system let you put arbitrary expressions anywhere you want (like a 3D plot animation used as the surface texture of a 3D cube).

Re:Can your REPL do this? by saraid216 on Wednesday December 07, 2011 @06:37PM (#3326747)
Why waiting?
Re:Can your REPL do this? by weavejester on Wednesday December 07, 2011 @10:01AM (#3324001)
Factor's REPL can handle images, colours and fonts:

http://re-factor.blogspot.com/2010/09/visual-repl.html

I've been meaning to write something like Factor's REPL for Clojure, but haven't gotten around to it yet.

Re:Can your REPL do this? by cemerick on Wednesday December 07, 2011 @02:14PM (#3325366)
Working on it: http://cemerick.com/2011/10/26/enabling-richer-interactions-...

In a heterogeneous mix of tools, getting the channel right is a big part of the challenge. Lots of the interactivity is going to be client-specific (i.e. what's possible / attractive in Eclipse is different from Emacs/vim/TextMate), but the channel underneath is a big enabler.

Would love to hear what you have in mind specifically, if only to see if there's a vector I'm not considering that I should be.

Re:Can your REPL do this? by weavejester on Wednesday December 07, 2011 @06:03PM (#3326624)
I was thinking of using a browser, as you'd get images, tables and so forth for free. The Ace code editor could be used for the prompt, which would provide syntax highlighting and indent rules for the prompt.
Re:Can your REPL do this? by reader5000 on Wednesday December 07, 2011 @10:18AM (#3324080)
Also animations. Pretty easy to do with swing-based repls, not so sure with others.
Re:Can your REPL do this? by colanderman on Wednesday December 07, 2011 @09:50AM (#3323958)
I don't get this. Someone wrote a bunch of cute Lisp functions that use Unicode and put them on a webpage?
Re:Can your REPL do this? by whateverer on Wednesday December 07, 2011 @10:22AM (#3324112)
Yes, it was pretty artistic as far as programs linked on Hacker News go, but technically... it was just a bunch of functions and macros which produced formatted strings.

Not that it's bad on itself, but the title suggested otherwise.

Re:Can your REPL do this? by cldwalker on Wednesday December 07, 2011 @05:35PM (#3326473)
Agreed. This has little to do with what their repl can do and is mostly a bunch of functions with their output.
Re:Can your REPL do this? by funkah on Wednesday December 07, 2011 @12:13PM (#3324672)
It's "pretty" and "clever", not actually useful to actual human beings. You know how nerds can be, sometimes.
Re:Can your REPL do this? by darklajid on Wednesday December 07, 2011 @08:21AM (#3323615)
I didn't find a decent/direct way to get to the code itself. This seems to be the repository that is mentioned/used in that text:

https://github.com/whalliburton/academy

Edit: And someone who likes dead prez I certainly got a kick out of the hexagram examples. Haven't seen those for a while.

https://en.wikipedia.org/wiki/Dead_Prez

Re:Can your REPL do this? by raldi on Wednesday December 07, 2011 @11:00AM (#3324302)
Yes. It was called BASIC and it came with my IBM PC XT in 1985.
Re:Can your REPL do this? by gruseom on Wednesday December 07, 2011 @11:54AM (#3324567)
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.)

Re:Can your REPL do this? by pnathan on Wednesday December 07, 2011 @01:03PM (#3324961)
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.
Re:Can your REPL do this? by gruseom on Wednesday December 07, 2011 @02:21PM (#3325399)
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.
Re:Can your REPL do this? by pnathan on Wednesday December 07, 2011 @04:23PM (#3326104)
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.

Re:Can your REPL do this? by gruseom on Wednesday December 07, 2011 @05:22PM (#3326398)
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.

Re:Can your REPL do this? by pnathan on Wednesday December 07, 2011 @10:38PM (#3327489)
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.

Re:Can your REPL do this? by yvdriess on Wednesday December 07, 2011 @08:51AM (#3323711)
Well I learned something new. SBCL and CLISP seem to have good unicode support that work well with emacs+slime.
Re:Can your REPL do this? by d0mine on Wednesday December 07, 2011 @10:44AM (#3324229)
Re:Can your REPL do this? by omaranto on Wednesday December 07, 2011 @03:03PM (#3325656)
Just to make sure I understand: in "Can your REPL do this?" the word "this" refers to printing Unicode characters, right?
Re:Can your REPL do this? by gcr on Saturday December 10, 2011 @02:46PM (#3338297)
DrRacket's REPL supports image literals. The racket language also includes functions for manipulating these. Take a look at this program: http://img13.imageshack.us/img13/6493/drracket.jpg

In the "Definitions" pane at the top, we define three variables, bruce-lee, energy-blast, and terrible-accident. In the "Interations" pane at the bottom (here's the REPL), we compose them together.

Re:Can your REPL do this? by rryan on Wednesday December 07, 2011 @10:13AM (#3324061)
https://github.com/whalliburton/academy

Since there's no link to the actual repo in that document.

Re:Can your REPL do this? by brutol on Wednesday December 07, 2011 @04:23PM (#3326103)
(let ((i0 (parse-integer "4DF0" :radix 16))) (loop for i from i0 to (+ i0 300) do (princ (string (code-char i))))) ䷰䷱䷲䷳䷴䷵䷶䷷䷸䷹䷺䷻䷼䷽䷾䷿一丁丂七丄丅丆万丈三上下丌不与丏丐丑丒专且丕世丗丘丙业丛东丝丞丟丠両丢丣两严並丧丨丩个丫丬中丮丯丰丱串丳临丵丶丷丸丹为主丼丽举丿乀乁乂乃乄久乆乇么义乊之乌乍乎乏乐乑乒乓乔乕乖乗乘乙乚乛乜九乞也习乡乢乣乤乥书乧乨乩乪乫乬乭乮乯买乱乲乳乴乵乶乷乸乹乺乻乼乽乾乿亀亁亂亃亄亅了亇予争亊事二亍于亏亐云互亓五井亖亗亘亙亚些亜亝亞亟亠亡亢亣交亥亦产亨亩亪享京亭亮亯亰亱亲亳亴亵亶亷亸亹人亻亼亽亾亿什仁仂仃仄仅仆仇仈仉今介仌仍从仏仐仑仒仓仔仕他仗付仙仚仛仜仝仞仟仠仡仢代令以仦仧仨仩仪仫们仭仮仯仰仱仲仳仴仵件价仸仹仺任仼份仾仿伀企伂伃伄伅伆伇伈伉伊伋伌伍伎伏伐休伒伓伔伕伖众优伙会伛伜 NIL
Re:Can your REPL do this? by adobriyan on Thursday December 08, 2011 @08:59AM (#3329055)
#x4DF0
Re:Can your REPL do this? by anon_d on Wednesday December 07, 2011 @12:02PM (#3324615)
This is actually pretty cool. Shame about the title.
Re:Can your REPL do this? by fbomb on Wednesday December 07, 2011 @10:21AM (#3324103)
Wow. TRS-80 graphics.
Re:Can your REPL do this? by deltasquared on Wednesday December 07, 2011 @01:12PM (#3325010)
To run the demos from SBCL: (require 'asdf) (asdf:operate 'asdf:load-op 'academy) (in-package :academy) (help)