HackerTube

Emacs Rocks! Episode 14: Paredit

emacsrocks8 HN recommenders · recommended in 7 months, 2013–2022
YouTube
tutorial · intro · evergreen · 2013–2022 on HN

A three-minute Emacs Rocks screencast by Magnar Sveen demonstrating paredit, which edits Lisp code structurally as a tree of s-expressions rather than characters.

Repeatedly offered as the quickest, most convincing demo of structured editing and why Lisp programmers love paredit.

9 comments from Hacker News

@Kaali2013-06 · in “Clojure Cookbook is now accepting contributions”

For those not familiar with Emacs, IntelliJ IDEA with La Clojure is also an okay choice. I use IDEA for Python, Java and Scala; and still switch to Emacs when I code in Clojure. The reason is that Emacs has really strong toolset for LISP, where many of the features are missing from other environments, or implemented partially. Slime/swank (nrepl replaces it, but I'm just slowly transitioning to it), provides code completion, documentation lookup, REPL, macro expansion and even live code updates on a running application; which can be a bit of a pain to setup on other editors. And the integration in Emacs is really great, as the repl buffer is really just a text buffer, the same as the one you are coding in. But the biggest reason for me to code LISP in Emacs is paredit. It really makes all the trouble with balancing parenthesis and moving around the sexps really easy. It might seem counter intuitive and a bit troublesome at first, but I really recommend you to try it. For a short and enthusiastic video on paredit, see ▶ this video -- and maybe the other Emacs Rocks! videos to learn more about modern Emacs.

Strongly recommends View on HN
@gabiruh2022-11 · in “Paredit 25 released (after 8 years)”

Yeah... a couple GIFs would. If I was them I would've just embedded this video from "Emacs Rocks!": ▶ this video It shows how incredible paredit is.

Recommends View on HN
@medo-bear2022-10 · in “The Hidden Origins of Lisp (2015)”

not op but for me structured editing is one of the biggest pluses when it comes to editing lisp code. here is a good example of what i mean [0]. btw autolisp standard formating is kind of an anti-example of good lisp formating. in emacs lots of excellent tools exist to make parantheses an extremely helpful feature [1] [0] ▶ this video [1] link

Recommends View on HN
@peterhadlaw2017-05 · in “Is Clojure dying, and what has Ruby got to do with it?”

The parentheses end up serving as a tool to speed up the development process with tool like paredit. You end up manipulating the "tree" of code vs the characters on a line. Check this out: ▶ this video

Recommends View on HN
@tikhonj2014-08 · in “An editor for composed programs”

Emacs's structured editing, in the style of paredit[1], sounds very similar to a text-based version of syntax-directed editing (SDE). Designed for Lisp and S-expressions, it's a system that lets you edit and navigate around nested expressions at a syntactic rather than textual language. As you type, the correct level of nesting is maintained and there are commands for moving and editing code in terms of s-expressions rather than characters. In practice, it's very easy to start using and very powerful... but requires using Lisp. It'll seem odd if you're not regularly a Lisp user. Happily, this idea can generalize well enough to distinctly non-Lisp languages. Structured Haskell mode[2] does this for Haskell, which has a less regular and sparser syntax than s-expressions. The documentation has a bunch of handy animations showing the various features, giving you an idea of how it works without having to install it yourself. This doesn't address the meat of the blog post—composing languages and grammars by taking advantage of structured editing—but it shows that the necessary foundation is possible with a perfectly normal text editor. It would be interesting to see if some of the ideas from Eco could be added to structured editing modes like this without requiring you to use an external, self-contained editor. [1]: link [2]: link Also, here's a great video of Paredit in action: ▶ this video

Recommends View on HN