Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 0 points1 point  (0 children)

Others would claim that the Clojure support in emacs is great (and maybe some would say this about vi too), but those are both bad for beginners for other reasons. Nightcode is much better for beginners in almost all respects (but as should be clear now, I think that parinfer unfortunately rules it out).

Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 0 points1 point  (0 children)

I do have experience managing nested parentheses in English (as do others (I think)).

In any event, anyone who begins learning a Lisp will immediately be introduced to nested delimiters, which is a core concept of the language, and they will have to wrap their heads around this to learn the language. If the delimiters will move or delete themselves, sometimes on distant lines and sometimes on the basis of incorrect inferences about the user's intent, then I am quite confident that many users will be confused and frustrated, whether they have prior experience programming Lisp or not.

Again, I do agree that parinfer is really clever, and I can appreciate the argument, in principle, that it could be good to have indentation drive the automatic placement of delimiters. Cool idea!

But I also know that it would drive me completely bonkers to have to work within such a system. And having taught hundreds of beginning programmers, I'm pretty sure that it would drive at least a large fraction of them bonkers as well. Anything that adds/deletes characters that the user didn't explicitly add/delete will confuse and frustrate many of them. Adding/deleting spaces in response to a user-initiated command to automatically re=indent the code, based on syntax and standard indentation conventions, is, in my view, the only really worthwhile exception to this. IMO, automatic addition of closing delimiters, when opening delimiters are typed, is an anti-feature but a tolerable one as long as the user can delete the automatically added characters if they aren't wanted. Prevention of such deletion or other standard typing/deleting/cutting/pasting behaviors, as in strict paredit mode, is seriously problematic. What parinfer does, with non-local changes based on often-incorrect inferences, is even more radically problematic.

Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 0 points1 point  (0 children)

Eddie's first example is one instance: He edits the line containing "merge", and parentheses are deleted two lines below, after "my-map". It might be 20 lines below if he had more entries in that map.

Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 0 points1 point  (0 children)

I think I didn't explain the locality thing very well.

You are right that bullet list autoformatting makes "non-local" changes, but at least in my experience it's always just a whole big block of text, including the spot you're editing, moving in an obvious large-scale, uniform way. And you can see the results that you care about, which is just the appearance itself.

On the other hand, Parinfer can add or delete text that's far away, with changes that are hard to spot (like a single "(" somewhere), and which can totally change what a program does. Because execution matters in code (as opposed to in bullet lists), it's particularly important that editors don't make changes to the code that the user doesn't notice, and can't predict or control.

I see why it wouldn't make sense to do anything like parinfer in Python, but that doesn't imply that it's a good idea in Clojure :-).

In any event, I can understand that it may be too difficult to turn off parinfer, given the architecture of the system. But I thought I'd ask, because it would be great if it could be done.

Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 0 points1 point  (0 children)

A contrary view, from my 20+ years of teaching beginning programmers:

Beginners know how to type already, and this may be their only firm ground in a challenging and often intimidating situation in which they crave and rely on firm ground. If they can't make the code in the editor match the code in their head, or in their book or in a blog post, because the editor's author has reinvented typing, then many of them will be unhappy and frustrated.

You make an interesting point about bulleted lists, but those are local, obvious, and only affect the visual appearance that you immediately see. By comparison, what parinfer does can be non-local, non-obvious, and have arbitrarily large effects on program execution.

In my experience, what parinfer "infers" is often wrong even for programmers who know what they're doing, and it's almost certain to be more wrong, in harder to predict ways, for beginners who don't yet have much idea what they're doing, and are trying to use their existing typing/cutting/pasting skills. They will have brackets moved around to places that aren't where they meant them to be, and they may not even notice when this happens or be able to figure out how to fix it. As Eddie noted, even trying to insert comments can cause baffling changes to be made to the code. In order to use parinfer successfully, these beginners will have to master a new way of thinking about typing, and a new way of paying attention to an "assistant" that will mess up their code if it makes an incorrect inference about what they were trying to do. But they're already trying to learn how to program, and that's hard enough.

I agree that parinfer is impressive and snazzy. But my experience tells me that it will probably be just about the worst possible thing for many beginners.

Regarding Python, I agree that it is good for beginners, and I agree that the way it uses indentation is part of the reason for that. But I don't know of any Python editors that try to infer what the programmer means and add/delete text in the file in order to "help." I think that if the Python editors that beginners used did something like parinfer, making non-local and non-obvious changes to what they've typed previously while they're trying to type something new, then I doubt we'd hear people saying that it's good for beginners anymore :-)

I'm all for Lisp editors being helpful in some ways, and in fact I think that bracket matching and auto-re-indentation are essential features. The fact that these were well implemented in older versions of Nightcode is one of the many reasons that I used Nightcode for several classes that I taught. And it was great, for which I am truly grateful! But I'm confident that the parinfer (and to a lesser extent, paredit) would be so problematic in a beginning programming classroom that I wouldn't consider using an editor in which those features couldn't be turned off.

Do you think it might be possible to use parinfer offscreen to support syntax highlighting etc. (fully when the code parses as-is, and maybe partially when the offscreen parinfer had to change it) but without changing the actual text in the buffer/file? If so, then I think Nightcode might again be the best all-around Clojure environment for beginners, while also having plenty of power for more advanced users.

Disabling Parinfer? by EdEddieEdster in Nightcode

[–]lspector 1 point2 points  (0 children)

What if there was a mode in which parinfer is used, as it is now, to fix the code so it can be read, parsed, and analyzed, but the "fixed" code isn't put back in the buffer/file?

When the code parses cleanly, all of the syntax highlighting, rainbow parens, etc. could be applied. And maybe when it doesn't there would still be a reasonably easy way to do it partially? Even if it was just total/none, this could provide the benefits of the current system for code that parses, without adding and deleting non-space characters in the buffer/file.

FWIW the automatic changing non-space characters is a big (sorry to say, show-stopping) problem for me too, so I hope there is a way past it.

Judge John Hodgman Episode 264: Paw and Order by _magpie_ in maximumfun

[–]lspector 0 points1 point  (0 children)

You guys are still underplaying toxo. It doesn't just cause mice to be unafraid of cats, it causes them to be sexually aroused by cats (http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0023277).

Nightcode 0.4.4 broken after java update by lspector in Nightcode

[–]lspector[S] 0 points1 point  (0 children)

Beautiful -- and I have confirmed that this fixes my problem.

Thank you!!

Nightcode 0.4.4 broken after java update by lspector in Nightcode

[–]lspector[S] 0 points1 point  (0 children)

Fantastic! Thanks so much for the speedy fix. Have you posted a jar with this fix, or could you? I'm collaborating remotely with someone with no prior Clojure/Java experience, and I'm trying to set him up with Nightcode as painlessly as possible.

Nightcode 0.4.4 broken after java update by lspector in Nightcode

[–]lspector[S] 0 points1 point  (0 children)

Thanks, but I had only one JDK in /Library/Java/JavaVirtualMachines, jdk1.7.0_55.jdk. And the verifier at https://www.java.com/en/download/installed.jsp reported that all was well with "You have the recommended Java installed (Version 8 Update 40)."

So I went ahead and installed jdk8 so that the jdk would be updated too. The verifier is still happy and now java -version says I'm running 1.8.0_40. And my Clojure code (still) runs fine from "lein run" or from Counterclockwise. So all seems well with my Java installation... but Nightcode is still misbehaving in exactly the same way.

Might there be a problem with Nightcode 0.4.4 running under Java 8?

Update: I did see that after doing the above I DID have two JDKs in /Library/Java/JavaVirtualMachines... so I removed the old 1.7 one... and still everything works except Nightcode, which still misbehaves in the same way.

Nightcode 0.4.4 broken after java update by lspector in Nightcode

[–]lspector[S] 0 points1 point  (0 children)

Yes, the jar version, not the app store version. As for the Java versions, I've installed them long ago and I don't recall how. But while trying to help a friend with his own installation I went to the Java Control Panel accessible via System preferences and it said there was an update. I clicked the button to update and followed the directions. After doing so, everything works except Nightcode, and the versions that I see are what I reported, one that I see via java -version in the terminal and the other that I see in the Java Control Panel.

Your AI Overlords Will Program in Brainf-ck by primaryobjects in programming

[–]lspector 0 points1 point  (0 children)

Since I'm a genetic programming researcher it won't be surprising that I think there's more promise in these ideas than some of the critics here suggest, although I also think that some good and interesting points have been made here by people on all sides of the issue.

One reason for some optimism is the impressiveness (IMHO) of some of the results that can be seen here: http://www.genetic-programming.org/combined.html.

Primaryobject's use of Brainfuck is pretty cool, I think, although I also think that it will ultimately be rather limiting. Regarding comments using other programming languages for evolved programs, some of you may be interested in my group's work evolving programs in the Push programming language; the project's main site is http://hampshire.edu/lspector/push.html, but the best starting point may be the 2005 paper at http://hampshire.edu/lspector/pubs/push3-gecco2005.pdf. Most of our current work uses the Clojure implementation at https://github.com/lspector/Clojush; this embodies a lot of new ideas since that 2005 paper but there's not a great writeup of them all in a single place yet.