Hacker News new | past | comments | ask | show | jobs | submit login
Emacs4CL: A DIY kit to set up vanilla Emacs for Common Lisp programming (github.com/susam)
112 points by susam on June 27, 2023 | hide | past | favorite | 28 comments



Nice guide!

Relatedly, I made the switch to sly not long ago. Well, ok, it was a few years at this point...

Regardless, worth taking a look at including in this guide. http://joaotavora.github.io/sly/#Stickers, in particular, are very powerful and fun playing with.


Why did you switch to Sly?


I can't remember, right off. I want to say that slime was having issues for me one day, and someone suggested sly. I switched and inertia has kept me on it. I don't know of that many differences, all told. It was nice that I didn't have to remember what all nice plugins I wanted for the repl. And then the stickers and such are just fun.


For what it’s worth, if your goal is to write Lisp in Emacs, a reasonable environment can be set up in a few minutes on a modern system with a package manager:

1) Download Emacs 2) Download e.g. sbcl 3) Install SLIME using Emacs’s package manager 4) Maybe install paredit

That’s basically it, modulo a few small bits of configuration I may have overlooked.


What Lisp needs is an IntelliJ IDE.

Failing that, true support for out-of-the-box with Visual Studio Code would be nice. Yes, I know about Alive and that... what I mean is, you open up a Lisp file and it asks to download the LSP for Lisp, Alive, and other support extensions.


Lisp Machines, alongside Smalltalk, are the genesis of IDEs.

Maybe LispWorks and Allegro Common Lisp should be less ignored, or have more FOSS friendly licenses, but that is all.



Thanks Vince, I will try SLT tomorrow.

I might also copy some of the article’s .emacs file and try it.


Even if it had an intelliJ IDE it wont be used.

The barrier to entry is not the IDE, its that Lisp is not fashionable at the moment. Those who know how to use it, put their head down and do the work, those who dont will follow the next fashionable trend for their work that they see their employment needing.


3/4 of devs use Visual Studio Code. A significant portion of the remainder use full-fat Visual Studio or an IntelliJ product.

The number of new Lisp users in 2023 is pretty small, sure. But it's frickin' 2023, those users need a better onboarding experience than having to futz with Emacs, even given something like Portacle. They will be familiar with VSCode or one of the above IDEs, not Emacs, and they shouldn't have to entirely relearn how to write code.


>But it's frickin' 2023, those users need a better onboarding experience than having to futz with Emacs

Funny, the years spent onboarding Emacs, and GNU/Linux for that matter, was the experience I was looking for.I never wanted to be just another cog in a well lubed task grinding machine.

>they shouldn't have to entirely relearn how to write code

If you are referring to elisp, it really isn't a mountain to climb or anything like that. Besides, only very basic lisp knowledge is required to customize Emacs, after that you can code your day away in a lisp of your choosing.

If you are looking for a more modern experience with emacs try elgot + tree-sitter [1]

[1]: https://www.adventuresinwhy.com/post/eglot/


You can use lisp with vi or any other editor you like.


There are developers out there who don't just jump on the next fashionable trend but who still want a better out of box experience than "you want to learn Lisp? Cool also learn emacs and about all these different lisp distros"

Common Lisp will probably never be the next Python, but it might be the next Ruby.


Thanks for this. I don't get to far in the weeds with setting up emacs but this showed me how to make the toolbar disappear so I'll be adding that.

I've unfortunately put CL on the back burner for the past month or so. I felt I kind of stagnated with it, couldn't grasp some concepts (condition systems), and then felt I needed to up my game at work so put CL aside for a bit.


A book has recently been written on the condition system https://www.goodreads.com/book/show/53889382-the-common-lisp...


Thanks. I have it and read most of it. I need to re-read it and get serious about learning / studying CL


> this showed me how to make the toolbar disappear

It’s no great mystery; it’s right there in the menu. Select Options → Show/Hide → Tool Bar → None

Then, to make the change persist, select Options → Save Options


Conditions are one if the most unique parts of CL, so definitely give them another look!

It’s kind of like being able to direct exception handling from farther away in the stack.

I say this as someone who started learning CL in earnest maybe two months ago :)


Thanks. I haven't given up, just put on hold for a bit.


Today, FYI, we have good to very good plugins for other editors: Atom/Pulsar, VSCode, Jebrains, Sublime, vim of course: https://lispcookbook.github.io/cl-cookbook/editor-support.ht... as well as a Jupyter kernel, simpler support with Eclipse and Geany, as well as Lem, a ready-to-use editor for CL (and other languages with its LSP client). The LispWorks IDE (with a free version) is less surprising than Emacs and has more graphical widgets.


Lispworks IDE free version seems like the safest bet for a beginner recommendation. It works without fuss, it has a GUI step debugger, is well supported, consistent across platforms and architectures. All those things outweigh the limitations of the free version for newbies IMHO.


Might as well ask here: I’ve seen discussion of the fastest CL implementation, but which uses the least memory? CLISP? Is it still viable? ECL?

Edit: I love SBCL, but sometimes I don’t love it taking a minimum of 100 MB of RAM.


Note to self: try ECL’s byte code mode. In default/C mode, it ended up using more memory than SBCL when compiling Hunchentoot (as a test case).


Answering my own question (non-definitively): CLISP uses the least memory.


this is great! i’ve been messing around with learning common lisp lately and setting up a good dev env was harder than expected.

> Use Emacs

> Emacs is a very powerful and extensible editor. It comes with over 10,000 built-in commands.

this cracks me up. i know lots of people love emacs, but who hears “10k commands” and goes, “wow, perfect”


Honestly, I do. I love typing M-x with a random word and finding something that does what I wanted to or is pretty close.


> who hears “10k commands” and goes, “wow, perfect”

You have to understand: Those thousands of commands are like songs. You wouldn't pay and subscribe to Spotify if they allowed only a few hundred songs, right? When another editor adds another command, it's not composable. You cannot meddle with it; there are no hooks, no advising. In Emacs, every command is a function, a function you can alter, extend, exploit, or override. So, yes, give me a million elisp functions. I'd love to use them in every weird way possible.


The thing is, the 10k commands don't get in the way. You'll never interact with them, unless you type 'M-x thingiwanttodoandwowitsalreadythere'.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: