Live data from Hacker News

Pretty Lisp

pretty-lisp.org

101–110 of 115 posts

Re: Pretty Lisp

#101
post #89

Earlier quoted context omitted.

When you want to write an essay, do you use something that draws your essay as some complex graphical representation, or do you use something like Word or a text editor, that for the most part shows your essay as just a bunch of boring characters on the screen? Sure, there may be some fonts and indentation and colors. (Eclipse and VS use those, too.) But the text is the point. It's the same with code. Code is a means…

We have the systems we have now because we used the same medium for thousands of years. To create new expressive mediums that take advantage of computers will take careful design and iteration, just as alphabetic text went through various handscripts like cursive, torturous to read German blackletter http://en.wikipedia.org/wiki/Blackletter and settled on http://en.wikipedia.org/wiki/Roman_type Then we went to san se…

Yes, to be more clear, I should have said all the attempts to replace code with some kind of a graphical representation, ends up reducing expressiveness.

Augmenting the text with graphical representations is a wonderful idea, that IDEs already perform in many ways, with many more yet to be discovered.

Re: Pretty Lisp

#102
post #83

Earlier quoted context omitted.

You're absolutely correct. Right now we focus on moving text around. Where the magic will come in, as these sorts of things progress is developing interactions to move the ideas around. Moving further up the power curve is always a good thing. My comment was based on the concept and my interpretation of those concepts in the future. Not necessarily on the reality right now.

We've done a lot of moving up the curve. Generally, when you move up the curve, there's a way to serialize it as text. Then, you might as well actually do so, and use all the advantages of a textual representation to use the abstraction. Compare a concise Haskell specification of something with the C equivalent. The problem with people who seek to replace our glorified text editors that we use for source code editing…

> Generally, when you move up the curve, there's a way to serialize it as text.

Agreed. I think this has something to do with the fact that programming is not about the objects on screen themselves, it's about the interaction that occurs between those objects and the mind of the person looking at them. The objects are not real, but mere representations.

Therefore, the interaction I have with a block of code is defined by my experience wrestling with the problem at hand in the language of that block, during which my brain has "mapped" from the text to a sort of abstract visualization of its value (or "serialized", as you put it).

I don't think a tool that makes a "picture-block" for me will ever help. My brain has to do the work of understanding those blocks by compressing each text block into a form (block? graph node? neither?) that I can hold in my head.

Strangely enough, if the above is correct, that means that there is more value in implementing a tool like this (for the implementor) in $LANGUAGE than there is for a potential user. Perhaps this is why programmers keep writing them, and users keep on not using them.

As the user, I need to learn something either way, and learning is usually hard/expensive. Therefore, why learn the (imperfectly-mapped) "picture-block" abstraction at all?

It'd be interesting to see if programmers feel the need to keep using these sorts of tools them once they've written them. My guess is no.

Re: Pretty Lisp

#103
post #58

Huh. I wouldn't call this pretty. Why do you need a box around everything? One of the arguments about Lisp is how visually distracting the parentheses are (and yes, experience Lisp hackers learn to tune them out; that doesn't change the fact that they are visually distracting); the boxes are even more visually distracting. To use Tufte's terminology, this is decreasing the data-ink ratio, not increasing it. Take a lo…

I elaborate a bit on this point in my comment below about Scratch. My claim is that this 'pretty lisp' is still stuck in the flat-text mindset, doing something pretty much identical to indenting. Whereas what we really want are graphical (in the sense of network) editors.

It isn't a huge leap forward conceptually, but the boxes to show scope are a whole lot faster for me to read than counting parentheses.

Re: Pretty Lisp

#104
post #56

Earlier quoted context omitted.

Paredit is nice, but barely works for stock Lisp syntax. One of the best things about Common Lisp is reader macros, and in order to integrate them with structured editing, you'd need to change the reader macro mechanism to be based around a composable context-free grammar description that can be shared between the reader and the structure editor. I'm pretty sure that's still an open research problem. Personally I thi…

At least among the Emacs-using Common Lisp users I've known (and discussed the topic with), Paredit is considered a clear win. Same in my experience. What do you use? If there's something better, I'd be happy to use it. (When I last observed someone editing Common Lisp code without turning on Paredit, it was rather depressing, how much time he spent closing parens and re-indenting everything. But maybe you use someth…

I started using Paredit in 2010, and wrote Lisp in Emacs for 7 years before that. Paredit make some things very convenient, but I can't say it has sped up my programming significantly. It has made it a lot more convenient for me to use the REPL, which has changed my programming style.

Two things that save time when indenting code and work in all Emacs programming modes:

1. (global-set-key (kbd "RET") 'newline-and-indent) in .emacs to automatically indent every newline (also points out problems in your syntax right away)

2. C-Space to start region selection, C-M-b or C-M-f to jump back/forward a code block (s-exp), then C-M-\ to reindent region.

The other thing I use is my https://github.com/vsedach/mouse-copy mode for "structured" copy and paste. It's convenient sometimes.

I use reader macros a lot more than Common Lisp programmers do now, and I encourage people to use them and think that reader macro usage will become more widespread, in particular due to Tobias Rittweiler's named-readtables library (http://common-lisp.net/project/named-readtables/).

In particular, I use cl-interpol (http://weitz.de/cl-interpol/) both for string interpolation and to do HTML templating (http://paste.lisp.org/display/118522). I also wrote a uri-temple library for Common Lisp (http://common-lisp.net/project/uri-template/). When I used CL-SQL, I used its reader macro syntax, and I thought it was worthwhile, but could have been better designed.

Re: Pretty Lisp

#105
Here's an interesting discussion of a s-expression editor: http://alan.dipert.org/post/445462664/the-s-expression-edito... (and a follow-up post: http://alan.dipert.org/post/17375691572/structural-editing-r...).

The above article refers to Interlisp (also mentioned elsewhere in this discussion), which still(?) survives in the form of Medley (http://www.venue-medley.com/). (I emailed Jill Sybalsky a few months back, but following the death of her husband, the product's future is rather uncertain...)

I came to Lisp from Smalltalk, so I'm already spoiled, having used the best IDE ever (hey, it's not just me: http://onsmalltalk.com/aha-moments-in-lisp); adapting to Emacs/SLIME was quite an interesting contrast.

OpenGenera was a step in the right direction: a LispVM + LispOS which together created a very Smalltalk-like IDE. (The notion of 'synergy' has real meaning here!) Developing a modern version of this further with ideas for structural editing of s-expressions would be quite interesting...

But, of course, talk is cheap ;-)

Re: Pretty Lisp

#106
every time I see such a project show up I'm both happy and sad: happy to see one more soul arrive at the "there must be something better than text" thought and doing something about it; sad because they invariably create a visual/structural editor.

... and not a really good one, at that. Not to pick on this specific one, but if you're creating a UI for code editing that's not text, please design your interaction well. And yes, I know that this is probably version 0.1 and you plan to smoothen the rough edges, which is why i'll not pick on the fact that the editor for each structural element is not even in-place, for example.

but that's not my point. writing code as text conflates two things (or 4, depending on how you think of duals):

1. source text has both syntax and meaning.

2. source text is both the display and storage format (this is the killer feature/bug).

my point is that every attempt to "solve" the "problem of coding using text" (on in this case the subset of lisp's umpteen parens getting in the way of understanding) focuses on the first half of #1 above.

as others have mentioned, there have been structural editors since the 80s. from the research i did (admittedly with limited acm access) they seemed to have died down due to two problems:

1. the scale problem: text packs the largest amount of information into the smallest amount of space. any visual/structural system better have a good way of dealing with large codebases.

2. the fluid use problem: it looks good, but is it easy to use when editing anything but a small enough piece of code this way? typically the amount of interaction "work" you have to do to jump between elements and so forth makes it very inefficient compared to text. the commonly cited example was "How do you change a for loop to a while?". in any text editor, you can take the characters apart easily to reform them into some other construct, but in a structural editor, you have to actually delete all or most of the old structure and re-form the new one. i did find research that refuted this specific claim (ask if interested), but that didn't help the adoption.

i have been thinking of "better ways to code" and structural editors in particular for about 3 years now and here're some of my conclusions to date:

1. text is king because of its universality - think cypher from the matrix saying "I don't even see the code. All I see is blonde, brunette, red-head"

2. We already have good structural editors. They're called vim and emacs. vim has the better interaction model, imo, while emacs has better support for creating new language modes (again, imho, no flame war intended). then there's the smalltalk ides that inspired the Visual Age products that inspired eclipse.

3. The additional overload of "chrome" in text the {}'s, ()'s and begin/ends are much less a hassle than that caused by a visual editor's chrome.

4. There is much more value in pursuing better ways of coding than just flogging the "text sucks" meme. Think Non-textual language workbenches, for example.

Finally, one specific commment about playing around with lisp's syntax. I've tried it (https://github.com/vinodkd/lispdown) and the one thing that stands out is: Lisp has no syntax, so it can become any syntax. I dont know how any structural editor can handle that in a meaningful way.

Re: Pretty Lisp

#107
post #88
post #86

Earlier quoted context omitted.

What does that mean? I can't think of any graph-editing GUI that I'd want to use to write code. There's a reason I still do my graphs in dot, and not in some WYSIWYG editor -- it's much easier to manipulate them.

I don't know. I don't think it exists yet. But have you ever seen an expert using etags/search/debugger/etc to bounce around a large codebase? The location of the functions in the file hierarchy doesn't matter at all. The important graph --the important graphs -- are latent in the code itself.

Bingo.

Re: Pretty Lisp

#108

Earlier quoted context omitted.

It's funny, more and more I'm moving my work to Mathematica because it works sort of like this already. That, and it's as far along the power curve from python/ruby as python/ruby is from C.

I've heard Mathematica praised before, but not in precisely those terms - I was under the impression it was more a DSL for mathematics. Can you give a few examples of things it can do that put it that far along the power curve relative to Python/Ruby?

Well, Wolfram|Alpha. I switch from computer vision to parsing to machine learning on a daily basis. But I haven't used the workhorse mathematics functions like Solve or Integrate in 3 years.

Perhaps it would be better to call it a 'Domain General Language' for everything.

Re: Pretty Lisp

#109
post #74

Earlier quoted context omitted.

Executive brief - Go high end, where the money is. Where results are valued. Licensing isn't an issue - $3K/year+libraries for development. A runtime player for Mathematica costs $300. You just have to pick your projects carefully - No rails todo apps. One recent project I worked on was auto segmentation and labelling of MRI images. Auto-segmentation was the easy part. Labelling however took several different approac…

This sounds like the kind of work that most people I know would choose matlab for (image segmentation). I personally have never used either for such, but do you have any thoughts on the matter? Is Mathematica getting better at the things matlab used to be best at?

I think most people you are know are just ignorant of how much better Mathematica is. It's okay. People like to stick to what they know.
Post reply on HN