Lurker News

Comments (134) 36 threads

Earlier comments
munificent1 reply#
Wow, this is a fantastically documented and executed idea. I'm not enough of a Lisper to have an opinion on the content (though it certainly seems cool), but the presentation is top notch.
aidenn0#
As a lisper, the content is similarly well executed. It's a rarity to see both in one place.
lispm3 replies#
> Most programming languages have several syntax rules. Lisp has one: everything is a list.

Oh, not again.
The author is confusing s-expression syntax with Lisp syntax. Even s-expressions are more than lists (conses, cyclic conses, symbols, vectors, strings, various numbers, structures, ...) and the s-expression reader knows about more than pure s-expressions - for example comments.
Not every s-expression is a valid Lisp expression. For example (let "let") is not a valid Common Lisp expression. The syntax for LET is:

    let ({var | (var [init-form])}*) declaration* form* => result*
This is also using the syntax definition for 'declaration' and 'form'.

Lisp has built-in syntax (provided by special operators in Common Lisp) and arbitrary complex syntax provided by macros.
This is valid for other languages with a notation based on s-expressions, like Scheme or Clojure.

chrisoakman1 reply#
I can assure you the author of Parinfer is aware of this distinction ;)

That sentence is an oversimplification to give context to the rest of the content in that section. Should probably have an asterisk to clarify.

lispm1 reply#
It's one of the sentences which creates endless confusions and a false image of Lisp. 'Everything is a list'. Oh, Lisp has only one data structure? Lisp is difficult to read, because it has no other syntax? Lisp is a primitive language and not usable for real programmers... etc. etc. It also creates the impression that even proponents of Lisp-like languages don't actually understand the basics...
oconnore6 replies#
Who is endlessly confused? Who suspects that the author of a neat lisp editor plugin has never written a non-trivial line of Common Lisp, Clojure, or Scheme? What are the chances that people in either category are also curious and excited to experiment with novel editing techniques?

Continue this thread — 6 replies

Blackthorn3 replies#
We all knew what it meant, including the author. This is pointlessly pedantic.
lispm1 reply#
It's not. Explain Lisp to people not by treating them as idiots who won't understand that not everything is a list. There are numbers, vectors, strings, and various other forms of syntax in Lisp.

   (john "123" 1)  consists of a list, a symbol, a string, an integer

   |hi there|  is a symbol

   #*1010101011  is a bit vector

   #2A((1 1 1) (1 1 1))   is a 2d array
and so on.

Also look up the current Scheme report and see its syntax definition. 'Everything is a list' is fooling the reader and treating him/her like an idiot.

munificent5 replies#
I'm pretty sure people understand that "everything is a list" doesn't mean there are no primitive literal types in the language.

Continue this thread — 5 replies

spopejoy#
Hardly "pedantic" to point out imprecise language in a post about parsing source code. It's hilariously wrong when you consider the author's focus on Clojure, which introduces all sorts of wonky syntax.

Indeed the article begs for potshots from smug lisp weenies:
1) It's clearly talking about Clojure, yet leads with "Let's simplify the way we write Lisp". Them's fighting words in the Lisp corral.
2) Paredit clone, but only acknowledges that for animations.
3) No emacs version! (Understandable given #2 however)

nickpsecurity#
I'm the first to call out grammar nazi's and pedantic crap. Despite that, lispm is right to call it out for a correction. It's a factually inaccurate statement that's gives non-LISP readers a misleading impression about what the language and its machine code are likely capable of. It's also spread like wildfire due to constant repetition as lispm noted.

So, it's worth mentioning and replacing with something more accurate.

coldtea2 replies#
>The author is confusing s-expression syntax with Lisp syntax.

Then again what he says is true for 99% of the cases, and a good simplification.
>Even s-expressions are more than lists (conses, cyclic conses, symbols, vectors, strings, various numbers, structures, ...)
Still expressed as lists when it comes to the syntax level.

lispm1 reply#
> Then again what he says is true for 99% of the cases, and a good simplification.

It's not. Read it slowly: only a subset of s-expressions are valid Lisp programs. Examples for invalid Lisp programs, even though valid s-expressions:

    (cl:if x > 1 t nil)    ; IF takes 2 or three forms

    ((cl:lambda) (a) a)    ; not a valid lambda expression

    (cl:let "a let expression" ((a 1)) (+ a 1))   ; the second element should be a list of bindings

    (cl:defun foo args (length args))             ; arguments needs to be a list

    (cl:let ((a nil t)) a)                        ; a binding is a variable or a list of symbol/value
and so on.

Lisp syntax is not the syntax of s-expressions. Lisp syntax is defined ON TOP of s-expressions.
> Still expressed as lists when it comes to the syntax level.
Comments are not expressed as lists. Feature expressions are not lists. etc etc...

coldtea3 replies#
>only a subset of s-expressions are valid Lisp programs.

Sure, but the thing we're debating is whether "all s-expressions are valid Lisp programs" (that would be a miracle actually), but whether Lisp syntax is all lists.
And all those examples are still lists -- that the lists can also contain other items inside them, or that underneath they are implemented as cons etc, doesn't really change that.
>Comments are not expressed as lists.
They are not retained anyway when the strings are parsed to the "live" AST (AFAIK), so they are an exception to the other syntax in that too.

Continue this thread — 3 replies

PuercoPop#
> Still expressed as lists when it comes to the syntax level.

alists are not expressed as lists.

cmrdporcupine4 replies#
Looks like what Jetbrains would implement if they implemented a proper Lispy language support.

Very nice.

porker#
> Looks like what Jetbrains would implement if they implemented a proper Lispy language support.

Let's hope they do, soon!

nnq2 replies#
Am I the only one who is incredibly annoyed by how Jetbrains IDEs indent code?! Really, the fact that they totally fail to indent even mildly broken code is infuriating. At least ten times a day I feel like yelling at webstorm "YES, I know that that code is broken, that there are two unpaired {s and one unpaired ', but I'll fix that F LATER! NOW I just want to type this code here and have it properly indented even if there's broken code 10 lines above it and 20 lines below it. I KNOW, and I DON'T care NOW!".

I just want to download stuff from my head to the editor before I forget it, then later fix the mess, and have the IDE/Editor still help me in the meantime. If it needs to temporarily revert to a caveman-style indent-like-the-previous-line or event to temporarily disable auto-indent, I'm ok with that, but don't horribly mess up what I type in failed attempts to semantically auto-indent broken code that I don't wanna fix right now...

taternuts1 reply#
No - you aren't the only one, this infuriates me sometimes. The worst is when you have a file that someone accidentally mixed indentations or something, or use 2 spaces instead of 4 (even 4 spaces seems to break for me) for continuation/promise stuff. I'll enter insert mode and it'll be in-explicably tabbed out 5-6 times further than it should and I have to exit insert mode and manually move over to the correct spot or finish typing the function in shit-mode then manually fix the indenting. There's been several times where I've given up in frustration and opened up VIM or sublime text because I don't want to deal with it anymore.
andrewchambers#
Parsing correct code is easy. Parsing broken code is really hard because they have no way to predict the mistakes people will make.
twblalock#
Just ignore it, and when you fix it, select the affected lines and use the auto-indentation feature. Why do you care how it ends up being indented before you fix it, if you are paying so much attention to the stuff you are trying to download from your head?
lemming#
I'll be looking at integrating this into Cursive, definitely.
davexunit3 replies#
Good to see more people working on editors for Lisp, but I don't really see this as an improvement over the (immaculate, IMO) Paredit for Emacs.
ScottBurson1 reply#
Yes, those of us who have been editing Lisp using Paredit-like commands for years [0] may not find that much value here. But I think we're not the target audience; the goal is to help get newcomers over the hump, and that will be a wonderful thing if it works.

[0] 35 years, in my case. David Chapman and I implemented balanced-parenthesis editing commands for Zmacs (the Lisp Machine editor) in 1980. To my knowledge, it was the first such implementation for a text editor; the Interlisp structure editor already existed, but was considered hard to use.

ScottBurson2 replies#
Yep, that's him! Thanks for the links -- I had lost track of him and hadn't seen his blog.

Continue this thread — 2 replies

Blackthorn1 reply#
This is a huge improvement imo, and something that should be seen as a great advancement in usability. We've gone from needing to use hotkeys (paredit) to not needing to use them and having the machine figure out what you want to do.

Maybe others have different opinions, but I find this way of doing things a lot more natural and usable. It's like an old Oblivion mod for archery that asked the question: "Why do other archery mods have a hotkey for denocking your arrow? We just automatically denock if you look at the ground. It just makes sense."

Illotus#
This. It may not be huge for someone who is accustomed to those hotkeys, but for everyone this is a big deal. Imagine not having to commit those hotkeys to (muscle) memory at all.
danneu3 replies#
If it lets people write lisp with the same ease of writing Javascript or Python (i.e. without investing time learning a tool specifically for editing s-expressions), then that's an advantage over Paredit kinda like Sublime's advantage over Vim/Emacs.

Trying it out in Atom, it looks really promising. You just kinda start writing, like on the blank line at the end of a function body, and Parinfer fills in the parens depending on your indentation level in an intuitive fashion, merging your form into the tree above it.
In fact, it seems to strictly complement Paredit. Parinfer puts the parens where you want them, and Paredit is there for explicitly editing the tree.

davexunit1 reply#
> kinda like Sublime's advantage over Vim/Emacs.

Sublime is trash compared to Emacs.

roryokane#
danneu wasn’t necessarily saying that Sublime is better than Emacs overall. He was referring to Sublime’s specific comparative advantage over Emacs. The relevant advantage here is that Sublime is better at being easy to learn by new users, because it follows conventions used by the OS and by other programs.
sklogic1 reply#
Did I miss something and Sublime somehow got some advantage over Emacs? When did it happen and what kind of advantage, exactly?
roryokane5 replies#
Sublime Text’s advantage in this context is the advantage that all GUI text editors share, including Atom and GEdit. This advantage is a combination of being more familiar and having better defaults.

Some ways that Sublime is more familiar are that it uses the OS-standard editing hotkeys, such as moving by words with Ctrl-arrows or Option-arrows. It also uses OS-standard terminology, like “close window” instead of “kill buffer” and “paste” instead of “yank”. The result is that new users don’t have to learn anything to be productive – they just edit as if they are in Microsoft Word, while enjoying the programming-specific features of a text editor such as syntax highlighting and block folding.
The better defaults include easily creating more than one scratch buffer (just run “New File” multiple times), automatically balancing parens when you type, support for pixel-by-pixel smooth scrolling, and scrollbars that don’t confusingly shrink when you start scrolling past the end of the buffer. I’m sure Emacs supports all these things, but you have to manually configure it to do so first. Many users are scared off from Emacs after seeing that it requires up-front investment to get features that other editors already provide with no work.

Continue this thread — 5 replies

Grue3#
I dunno, I write Lisp, Javascript, Python with vanilla Emacs (no paredit), and out of those Python is harder to write than Lisp and Javascript because the latter are indented automatically by Emacs.

Having to indent stuff manually is a drag. Especially when you nest in deep with Python and need to close several levels of indentation. It's just inherently difficult to "measure" white-space with your eyes. With 2-space indentation which is used in Lisp, and naturally deeper nesting, it's probably even harder.

Load more comments