News for hackers. Stuff that matters.
Re:Try Clojure by hombre_fatal on Wednesday May 22, 2024 @02:26PM (#40444309)
Maybe online "learn lisp" repls should implement paredit keybindings in their editor and have a short section on how to manipulate s-expressions. Because you're gonna have to learn it to use the language, but it also helps people understand from the start that "oh, so using the language isn't actually complete shit".

Instead, this fact always seems glossed over, and because of it anyone who spends 60 seconds writing lisp by hand into a repl assumes that's the lisp experience and nopes out forever. When in fact paredit makes lisps the easiest-to-edit languages in the world.

Re:Try Clojure by writeslowly on Wednesday May 22, 2024 @03:10PM (#40444915)
I spent a few months writing a decent sized Clojure program just using my IDE's matching bracket highlighting and some sort of rainbow parentheses settings, and never found it very annoying. I'm not sure there are that many more parentheses than curly-bracket languages, it's just that all of the closing parentheses are more likely to cluster together at the end.
Re:Try Clojure by askonomm on Wednesday May 22, 2024 @02:32PM (#40444421)
Or Parinfer. I personally like Parinfer more than Paredit, mainly because I can't be arsed to learn a gazillion keyboard shortcuts.
Re:Try Clojure by hombre_fatal on Wednesday May 22, 2024 @02:35PM (#40444463)
Oh, interesting. Yeah, that's even better for an onboarding tutorial. I didn't know it existed (used Clojure for 6 years a long time ago).

Cool: https://shaunlebron.github.io/parinfer/

I always thought that the surrounding tooling (having to learn how to edit parens productively, using nrepl/cider, maybe even emacs... with evil-mode of course) to be both the worst and then eventually the best parts of Clojure.

Re:Try Clojure by askonomm on Wednesday May 22, 2024 @02:38PM (#40444517)
I'm one of those mainstream devs (who also did Clojure for 6 years, coincidentally) who never got into emacs, and always just used the Cursive IDE plugin for IntelliJ and its Parinfer editing mode. I know I probably didn't unlock true god mode of productivity, but it worked fine for me.
Re:Try Clojure by hombre_fatal on Wednesday May 22, 2024 @02:58PM (#40444764)
I had already used vim by the time I found clojure during uni (back when I had the energy to learn major new things), but vim support sucked for things like evaluating code blocks in the buffer, so I tried emacs and immediately slapped on evil-mode (vim bindings inside emacs).

For those six years I don't think I used emacs keybindings during that time except to move between files and execute clojure code. I couldn't be arsed to learn it. It was basically a fancier vim, haha.

These days I use VSCode for all software. At some point in my 20s I found out there's life outside of coding so now I use a less esoteric editor. I'm sure its clojure / nrepl / paredit / parinfer support is fine. (Seems to be this: https://calva.io/) Back in 2010 the options weren't as great.

Re:Try Clojure by stefcoetzee on Wednesday May 22, 2024 @07:02PM (#40447890)
Yup, Calva's pretty great.
Re:Try Clojure by simongray on Thursday May 23, 2024 @02:53AM (#40451342)
I'm the same, always just used parinfer with IntelliJ, though I do know a few paredit key combos that I use occasionally (paredit isn't disabled just because parinfer is enabled).
Re:Try Clojure by globular-toast on Wednesday May 22, 2024 @02:34PM (#40444457)
At the very least they should have auto-closing and matching parens. I dread to think how many people have been put off Lisp because they think we actually type all those parens (in fact Lisp users have enjoyed IDE features many programmers could only dream of for decades).
Re:Try Clojure by anentropic on Thursday May 23, 2024 @07:52AM (#40453548)
I remember trying Clojure a few years ago, and Racket, and had similar problem with both... feels like everybody doing LISPs is using Emacs and it was hard to get a decent set up in VS Code configured and working properly
Re:Try Clojure by jwr on Wednesday May 22, 2024 @04:40PM (#40446222)
> When in fact paredit makes lisps the easiest-to-edit languages in the world

That is true and whenever I switch from Clojure to C, I immediately feel the pain (what do you mean I can't just kill or lift this entire expression?).

But structured editing has a learning curve, so it's a difficult balancing game. Beginners are overwhelmed by all the parentheses, while experienced programmers don't even notice them and love the structured editing approach.

Re:Try Clojure by neilyio on Wednesday May 22, 2024 @05:21PM (#40446734)
I use Helix [0] myself, which has tree-sitter based commands for moving + selecting up/down/forward/back by expressions. These are built-in and require no configuration.

It's surprisingly excellent! Sure, the "language" of paredit features more powerful text manipulation that just simple movement... but combined with the new "jumping" in the latest Helix release [1], it makes for a very impressive keyboard-based navigation system.

[0]: https://helix-editor.com [1]: https://helix-editor.com/news/release-24-03-highlights/

Re:Try Clojure by silcoon on Wednesday May 22, 2024 @05:36PM (#40446920)
TryClojure author here. Thanks for the suggestions! I’ll look into adding parinfer soon and maybe add a section on the benefits of integrating Clojure with the editor.