this post was submitted on 24 Nov 2023
1 points (100.0% liked)

Lisp

55 readers
3 users here now

founded 1 year ago
MODERATORS
 

I have been wanting to program in lisp for a good while, but I do not enjoy using Emacs, and Slimv and Vlime haven't functioned. So, would having Vim in one terminal editing a file and then a REPL in another work?

top 21 comments
sorted by: hot top controversial new old
[–] stylewarning@alien.top 1 points 1 year ago (1 children)

You won't get "the Lisp experience", which is the killer feature to many, but yes you can.

[–] supercompass@alien.top 1 points 1 year ago (2 children)

So then, what is the "Lisp experience", and why does everyone want it?

[–] stylewarning@alien.top 1 points 1 year ago (1 children)

The development of a program is very incremental, immediate, and interactive. The idea of the editor and the program begin to blend. The cycle type between observing program behavior and changing program source is trivialized and almost not even noticeable. In the end it allows you to converge on ideas very, very rapidly. Programming in other languages/environments feels like having asthma.

The problem is that describing this never really makes sense.

[–] LordLargo@alien.top 1 points 1 year ago (3 children)

Is there a video we can see what this is like? I have looked it up and often the videos are like an hour long and there is more talking than showing.

[–] therealdivs1210@alien.top 1 points 1 year ago

Here's a video of live coding a game in CIDER (which is like SLIME for Clojure - another Lisp).

[–] dzecniv@alien.top 1 points 1 year ago

+1 for long talking. My attempt at it: https://www.youtube.com/watch?v=jBBS4FeY7XM 5min, shows how we can restart a running program from any point in the stack trace, without restarting the program from zero.

Some more I recommend: https://www.cliki.net/Lisp%20Videos

[–] SlowValue@alien.top 1 points 1 year ago

It is difficult to find good demonstration videos. Here is another:
https://www.youtube.com/watch?v=jBBS4FeY7XM

Emacs with Elisp btw. is working alike. So you could experience that "Lisp experience" yourself easily, just by modifying Emacs itself. You can change ca. 99% of it on the fly, redefine whole parts of its functionality without need to restart Emacs. Sometimes that's not realized. Together with edebug, its good in-code documented functions and introspectibility it is a nice programming experience. Sometimes I miss that tight integration with Common Lisp.

[–] fraxertius@alien.top 1 points 1 year ago

You've seen a couple descriptions in the sibling comments to this one, and it probably sounds like what you feel about python/ruby/whatever. But you really should try lisp with editor integration. Or, try some smalltalk for a lot of the same feel. Smalltalk has better integrated tooling, though I'd argue lisp through swank feels nicer. The common spiel sounds so similar to regular repls, but feels profoundly better in practice. I always thought of languages using repls as toys prior to earning common lisp.

[–] Ok_Advisor1053@alien.top 1 points 1 year ago

Ofc, do whatever you want.

[–] Patrick-Poitras@alien.top 1 points 1 year ago

In learning emacs, I found it easier to spend a few hours customizing emacs so that it does exactly what I wanted rather than learning how to do things the emacs way. (yay CUA mode!) If the thing holding you back is that the defaults are garbage, or you prefer Vim bindings, there's some packages that handle that. Maybe there's a glimmer of hope there.

That being said, if you've given those a try, or are just plain out done with emacs, you can use SBCL like an interpreter and have it produce the output you want. The experience you'll get from that is similar to other languages that run on the "Write -> Compile -> Run -> Read output" cycle, like C++ or Rust.

REPL-style, interactive workflow is going to be more difficult. The UX in REPL mode with default SBCL is bad enough that if I had to use that, I'd probably copy-paste code in and out of the REPL window from another editor. Slimv and Vlime are probably better than that.

[–] bigfondue@alien.top 1 points 1 year ago

If you enjoy using vim, maybe evil-mode would make the experience of using Emacs more enjoyable for you.

[–] fedreg@alien.top 1 points 1 year ago

Try olical/conjure plugin for neovim. It's definitely not as good for CL as slime/sly but it works much better than vlime/slimv (for me) https://github.com/Olical/conjure/wiki/Quick-start:-Common-Lisp-(Swank)

[–] josharmenta@alien.top 1 points 1 year ago

Try pulsar and slima

[–] pcostanza@alien.top 1 points 1 year ago

I recommend LispWorks! (“…but it isn’t free…”)

[–] dzecniv@alien.top 1 points 1 year ago

Yes, you can (load "file.lisp") in the REPL and have a somewhat interactive session (or start everything from scratch everytime…). I just read an ecstatic comment about that yesterday: https://news.ycombinator.com/item?id=38374577

[–] eminent101@alien.top 1 points 1 year ago (1 children)

Slimv and Vlime haven't functioned

What exactly do you mean by this? Either should just work! Did you face any specific difficulties with them?

[–] supercompass@alien.top 1 points 1 year ago

Slimv requires Vim with python, which I don't have, and Vlime requires me to run sbcl --load /vlime/lisp/start-vlime.lisp every time.

[–] yelircaasi@alien.top 1 points 1 year ago

How about the Lem editor? That's pretty lispy

You don't.

You could use Dr Racket. Racket is a derivative of Scheme. Dr Racket supports several versions of Scheme.

[–] anticrisisg@alien.top 1 points 1 year ago

Need, no. Want, yes.

[–] love5an@alien.top 1 points 1 year ago

Yes, you do need it. And btw the most prominent problem with emacs is its default keybindings. These are not suited for modern keyboards. The first thing you should do when you start customizing emacs is to rebind the keys. After that, everything would be way easier. There are a lot of key binding packages out there, just look for something that suits your needs or your habits.