Hacker News new | past | comments | ask | show | jobs | submit login
Lem: A Common Lisp editor/IDE with high expansibility (github.com)
159 points by lelf on Mar 16, 2019 | hide | past | web | favorite | 77 comments

I use Common Lisp professionally for work, and I love using Emacs and SLIME for editing Lisp. But over the past decade or so, I’ve also learned to maneuver around Emacs, and give it the attention it needs to become somewhat proficient at it.

In the case of others, I’ve observed much less patience. Patience maybe isn’t even the right word; perhaps it’s just an unwillingness to invest in something that doesn’t really communicate an obvious return. Many of my coworkers, especially those who want to edit a little bit of Lisp but don’t want to make it their life story, really wish there was a better editor.

Many of them Python programmers, or even technical folks with a non-programming background, really aren’t sold on this whole Emacs thing to edit a weird language. Out of the box, you have to look up the plethora of cheat sheets and commands and figure out why GUI Emacs doesn’t see your PATH and why changing the font doesn’t stick and ....

They do appreciate the likes of Atom, PyCharm, Jupyter notebooks, etc. with big beautiful GUIs with big beautiful menus and slick websites and “out of the box” support for what they need to do. Pop-up suggestions, dedicated terminal windows, etc. “Obviously” Emacs can do these things, if not better and with more breadth, but it’s all hidden behind The Model of Emacs Thinking (TM).

I really look forward to efforts like Lem improving. I hope they try to do at least one thing really well—editing and interacting with Lisp—and not 100 things poorly (e.g., trying to replace Python editors out of the gate). A great Lisp editor will be such a boon for the language, maybe as important to its rebirth a decade ago as Quicklisp was to it. Lisp is such a wonderful tool, and I want folks to see the great industrial uses it has. Selfishly, I also want to see more contributions to my own Lisp projects on GitHub. To the extent Lem can facilitate that, I’m entirely on board.

(If you’re looking for some cool things to hack on in Lisp, try quilc [0], qvm [1], or maybe even Lem itself!)

[0] https://github.com/rigetti/quilc

[1] https://github.com/rigetti/qvm

I definitely fit into that second paragraph, and I appreciate you being careful to distinguish patience from being convinced of cost-benefit. I came to the conclusion after some pottering that it would be tough to make emacs nearly as good a python IDE as pycharm, not like a weekend's work it looked like a project in itself. It would again be a project in itself to make it as useful as jupyter for data-things. Someone has worked on embedding jupyter in emacs but it's a bit janky and you're then locked out from any extensions which will be written in javascript and expecting a DOM.

An investment in emacs seems to require a 10+ year time horizon, which means betting that it's going to grow and not decline, the numbers seem against that. I think what I really want is atom/light-table to get a lot better but the second died at birth and vscode is going to kill the first whilst having an uglier inner model that is less friendly to extensibility. I really wish Mr Granger had stuck with Light Table instead of running down a blind alley of VC money. There's a great quote that the threat to emacs is the browser, since it's a completely scriptable environment, I guess jupyter/light-table/atom embody that.

I still use spacemacs for running shells and editing files kind of ad-hoc.

Emacs + Jupyter integration got significantly better with the recent emacs-jupyter package [1], which, while young, is about as un-janky as any Elisp I've seen. I use this daily now for Julia/Python development.

The acs-jupter Org client augments Org's code cells with dynamic completion and inspection provided by the (potentially remote) kernel. The sessions can be managed per-subtree, enabling me to maintain various contexts within one Org file.

[1]: https://github.com/dzop/emacs-jupyter

vscode is going to kill the first whilst having an uglier inner model that is less friendly to extensibility.

I haven’t used VS Code much, but it’s extensions seem pretty rich.

What things can an extension do in Atom that it can’t do in VS Code?

Comparing to jupyter seems odd. Org-mode can already do most anything I have seen jupyter do. Out of the box, pretty sure it can do more, since it supports tangling of source blocks for execution.

Note that I can't really claim you are wrong. People do seem to be converging on these tools rather heavily. I just can't see how it is capabilities that is driving it. Looks more like standard marketing.

I think programmers are very good at fighting through frustration and pain, because so much of the job is just bad existing software, or libraries we don't control, or legacy code we don't have time to refactor etc. And so when something feels off in Emacs, your natural reaction is the same as when something is off in Word, on on your smartphone, or whatever. You just swallow your pride and live with it.

It's hard to truly internalise that this isn't necessary in Emacs, that you can actually achieve a level of productivity and proficiency with elisp that the moment something annoys you, you can and should just fix it once and for all. That discipline is hard in any codebase, but it's especially hard with your editor that you don't really think of as just a pile of code that you are personally charged with maintaining.

To an extent much of Unix is like this. In the early days it's exhausting and can be overwhelming - so much stuff seems suboptimal to your workflow and almost infinite customisability feels like a bit of a Fuck You when you just want to get stuff done. But then you realise you've had Linux installed for more than 20 years and there's stuff you could have fixed in your teens and never thought of again. At some point you should really just commit.

Patience maybe isn’t even the right word; perhaps it’s just an unwillingness to invest in something that doesn’t really communicate an obvious return.

I'd say it's more like the relation with a person. If you have no choice (your boss) you do whatever is needed, mostly. If you have choice but still you're very interested (for some reason) you put up with some quirks. Otherwise, you'll rather be with someone kinder.

I am curious to know which domain you are using CL professionally. Can you tell us a little bit more? Also are you using an Open Source CL or a commercial one? P.S: mmmh... I guess you are working for Righetti right?

Quantum computation, specifically on compilers and simulators.

> They do appreciate the likes of Atom, PyCharm, Jupyter notebooks, etc. with big beautiful GUIs with big beautiful menus and slick websites and “out of the box” support for what they need to do. Pop-up suggestions,

Basically just like the surviving commercial Common Lisp IDEs have been doing the last 30 years.

care to share your emacs config/setup ?

I installed the stable (not Electron version) and kicked the tires. Looks like a fun project if you want turtles all the way down Common Lisp.

I admit that even for Common Lisp, I usually just use VSCode to edit with a separate repl (I always define a function (ll) that reloads the code I am working on so this is not inconvenient). Off topic but I now also mostly use VSCode for Haskell, Python, and Julia. Still love Emacs, just don’t use it as my main driver anymore.

I'm surprised that emacs users and some vim users too are switching to VSCode. Assuming I am not RAM constrained (I have "only" 6 but my system never lags- I have 0 chromium engines on my system), what is your workflow and what does VSCode do better?

Sensible defaults are a big part of it for me. Using VSCode means that I spend very little time configuring the editor, or setting up extensions.

As far as Common Lisp goes, you could just install the Portacle distribution of emacs. This is essentially a fully-geared up CL IDE, including all the favourite emacs extensions for development (flycheck, company, paredit, magit, etc) and even SBCL and git!

It provides a single user.el file for user-specific configuration, but as it stands it is an excellent "emacs with great defaults".

Why would you spend time doing anything? You just do it once and commit it to github? That's how my vimrc lives.

Does doing it once not take time? I usually get bored halfway through and switch to an editor that works properly out of the box.

In fact, of course, doing it once is a pipe dream. Everything with vim and emacs 90% works, and you can spend infinite amounts of time chasing the other 10%.

For me it was TypeScript. I had terrible slowdowns in vim for whatever reason (was using a couple different plugins, and maybe things have improved since then), and VSCode is hands down the best TypeScript editor. I then found it to be a nicer experience for JS in general as well as C/C++.

I still use vim often but since I'm not a vim power user, the vim emulation mode/plugin for any particular editor is generally good enough for me.

vim works well with tmux on servers, with minimal config or the one in git, but i have a custom hacker keyboard layout, so maybe that plays indirectly. For me GUIs eliminate themselves from some of the work that's better done on a server, that said i tried vscode one day and it was pretty cool

What makes you work in 4 different languages?

More than 4 languages. I also like 3 Scheme dialects and also Ruby.

I am getting interested in Swift also since the Swift ‘turtles all the way down’ version of TensorFlow is under development and looks good.

But the keybindings...

I don't understand the goals of this project. What are these "tidy settings" they are talking about? And is having to install plugins in Emacs really such an obstacle? It would be great if the authors could elaborate a bit more about their motivation and vision.

Motivation: Emacs Lisp is not Common Lisp. It's cumbersome using Common Lisp for Emacs package development and cl.el is discouraged. Even not considering that simple fact, how we can use the massive Common Lisp ecosystem in a nice way? Sorry, I don't know how to do that in a simple way. Just no.

Beyond that Lem it is quite fast and there is the OpenGL [1] front as unofficial contribution. It could be embedded as a Lisp IDE inside of a game called Lisp Hacking Experience that was never made.

The amount of good reasons for doing that it can be enumerated by thinking about the common lisp ecosystem as I said earlier.

BTW, emacs is great but it not have good defaults enough for modern Common Lisp development, Lem it's awesome as default for Common Lisp ;). Not having any beginner friendly editor for Common Lisp it was one of the reasons that I teaching Lisp was so difficult.

Edit: Portacle is a good Emacs dist, but it is still emacs, so don't push the discussion with this in mind. It's pointless. And Portacle it's great in your own way (https://portacle.github.io/)

[1] https://github.com/pupcraft/lem-opengl

This post is full of misinformation.

cl-lib.el is not discouraged, it's widely used by Emacs itself and pretty much every substantial Emacs Lisp library out there.

What's discouraged is using an older version, cl.el, at runtime [1] because it replaces existing Emacs Lisp functions and pollutes the namespace. Even that's ok to use at compile time though.

Lastly, cl-lib.el is not cumbersome to use.

[1] https://www.gnu.org/software/emacs/manual/html_node/cl/Organ...

Actually there wasn't much disinformation.

cl-lib is cumbersome to use, especially since the CL operators now have a different prefix (since Emacs Lisp has no packages). This means I can not use any existing CL code in GNU Emacs - the operators are partially there, but all renamed.

That's cumbersome.

Let me give it a try, from an abstract/Emacs point of view:

Emacs is good for Lisp development, but both “raw” Emacs itself and most of the packaged customization versions (Spacemacs, etc) are fairly ‘opinionated’ about Lisp, and that opinion usually falls close to: Lisp is great, but Common Lisp is a little/some/much too much, so our choices often lean away from CL’s. (Lisp-1 vs. Lisp-2, dynamic vs. lexical scope, etc.) This means that you’re customizing in a nearby language, but one that dislikes some of the things that you liked when you chose CL, so there’s some impedance mismatch going on. That said, you can get a great CL dev environment from Emacs, but you’ll want to install a bunch of add-ons first, probably including a non-Emacs lisp interpreter and a package to bridge Emacs and that other lisp. True fans of CL would really like a full-blown Emacs with real CL at its core, and periodically people try to make those (Hemlock, etc), but they usually don’t catch on.

More misinformation here.

Emacs Lisp is a Lisp-2.

Emacs Lisp has lexical scope.

When writing code in Emacs, Emacs Lisp for all intents and purposes can be seen as a subset of Common Lisp, not an entirely different language like you present it to be.

Please try not to propagate this sort of misinformation again in the future. The things you claim are obviously wrong to anyone who has ever used Emacs Lisp, even once. Have you ever done that?

Please edit swipes and incivility out of your comments here, regardless of how misinformed someone else is. It's actually worse when you're right, because then you're discrediting the truth by associating it with rudeness.

There's an additional concern. As Lisp users ourselves, we remember how the CL culture was gutted by the wave of nastiness that rolled into it about 15 years ago. No trace of that is ok on Hacker News. Dismayingly, your comments have contained traces of it in the past as well as in this thread.

In fact, you have posted so many uncivil comments to HN already that we're going to ban you if you keep doing it. If you'd please read https://news.ycombinator.com/newsguidelines.html and take the spirit of this site to heart from now on, we'd greatly appreciate it. This means erring on the side of respecting others, assuming good faith, and providing correct information to teach readers rather than humiliate fellow commenters.

You might also find these links helpful for getting the spirit of this site:





Emacs Lisp is similar to CL, since both were derived from Maclisp and many basic code looks similar.

In Common Lisp a subset would mean that all programs of that subset would run unchanged in a full CL implementation. Emacs Lisp isn't like that.

More tragically, over time, Emacs Lisp implemented Common Lisp features - even though Richard Stallman does not like Common Lisp's features like keyword arguments - but not in a source compatible way. Emacs Lisp got CL features and operators via libraries, often with incompatible naming, but still can't be programmed in straight Common Lisp.

> This post is full of misinformation.

Maybe a few, but not full neither even so many. Thanks for pointing about cl vs cl-lib.

Please don't be discouraged by the occasional hostile reception. It's an invasive species here, which we do what we can to contain, but the bulk of the community is supportive and I hope that comes across in this thread! (And thanks for not taking the bait; your reply here was admirable.)

Yeah... Unfortunately or not, that type of person in the internet is so common that after years I learnt a little about it. Thanks for the support :) let's continue the good discussions on the thread o/

Nice work! Lem looks "Spartan" at first glimpse, the high expansibility however is a promising key for success. Anyone who truly loves Common Lisp has the opportunity to make Lem the best Lisp editor ever.

I am a long-term Emacs user but I think we really need an optional editor which can be extended in Common Lisp rather than Emacs Lisp. What I really like about Lem is the KISS principle ("Keep it simple, stupid") since Lem is based on curses which is good for portability.

I have no experience with Roswell. Is it possible to use QuickLisp packages? Or do you consider to switch from Roswell to quicklisp? That would make installation of Lem much easier!

Roswell and Quicklisp are two different things. Quicklisp takes care of downloading systems (what other languages tend to call packages) and makes them available to ASDF. Roswell and takes care of installing Common Lisp Implementations (think chruby + ruby-install). It also allows you to run lisp programs as scripts iirc.

FTW you don't need to install Roswell to try Lem, you can use cl-launch instead

FWIW you already can run lisp code as a script, at least under Linux. I've been doing the following for quite some time without issue:

--- xx


(format t "yup")


and then on the command line:

> chmod a+x xx ; ./xx


Caveat: You have to comment out the hashbang if you want to (LOAD 'xx) in the repl, or it will puke unceremoniously. It would be nice if repl devs allowed the LOAD function to simply treat it as a ; symbol since it wouldn't break anything and is more consistent with the cli behaviour.

I've only done this with clisp, so maybe other Lisp variants like sbcl et al already do this. YMMV.

EDIT: Realized the script came out all on one line. Fixed.

If you want to create an nice FOSS IDE for Common Lisp, play around with Alegro and LispWorks, don't just try to redo Emacs + SLIME.

And take advantage of Common Lisp, no Electron needed.

We use Allegro Common Lisp which has an interface[1] to emacs, and it's quite nice to use, minus several annoying bugs. Notably, gives you access to a REPL.

I just started working as a developer, and so far enjoying using it, despite not having experience with other languages in a professional capacity, or with large projects. The less my hands have to leave the keyboard the happier I am :).

I do use evil-mode, but I should probably get more comfortable with emacs keybindings as time goes on, especially since emacs has some useful keybindings in the context of s-expressions from what I recall.

[1]: https://franz.com/support/documentation/10.1/doc/eli.htm

Neat. I use vim, but it’s always nice to have options, especially ones that understand CL natively.

"I use vim"

Bold move, putting heresy right up front.

Quote Saint Ignucius from the Church of Emacs: " Although vivivi is the editor of the beast we consider vi as a penance not a sin"

Totally, I don't think even that it's possible being productive with Common Lisp using vim. Just don't fit in my mind. I use vim to edit my /etc/fstab and works really wonderfully. But Common Lisp? D: maybe there is some magical stuff, unicorns plugins and so on...

I use emacs for Clojure but I've got two amazingly productive coworkers who use neovim. It is a non-issue for them.

Given that wookie's author uses vim it is clearly possible. Another prominent lisper that uses vim is Steve Losh, they've even written their own swank equivalent based on nrepl, cl-nrepl https://github.com/sjl/cl-nrepl

I'm using vi (not even vim) for Scheme and some obscure LISP dialects and I indent my code manually. The magic is in LISP itself, no plugins required! :)

Whenever I wrote Common Lisp, I used vim + tmux + rlwrap & sbcl. I didn't find it to be a hindrance, but I've never done really complex things with CL either. YMMV :)

I used slimv for a while and it worked pretty well. Now I use evil-mode.

Do you use CL with Vim? How you handle the repl integration, ASDF, quicklisp, indentation?

I use slimv for indentation/general prettification. ASDF, quicklisp, repl, those I all do separately (I use gnu screen, have a screen for building/repling).

Interesting setup! Thanks for answering!

vlime/slimv exist for vim.

Why all Lisp editors/IDE's look like Emacs?

Note that Emacs and GNU Emacs are different things. Emacs is a family of editors, which share some basic design principles (buffers, keymaps, modes, extended commands, ...).

Why do you think Lisp IDEs look like some Emacs? Because you happen to know them and haven't seen the other ones.

Many Lisp IDE's have an Emacs editor, but are not based on Emacs. For example the MIT Lisp Machine has Zmacs, but that's mostly used for editing text (and some functionality around it). Zmacs is also used as a component in a few other programs, like the Mail client. Other than that most Lisp Machine programs are neither based on Zmacs nor have a Zmacs UI. Examples: file browser, font editor, terminal, Lisp repl - none of that feels/looks like Emacs.

Interlisp-D / Medley from Xerox didn't look like Emacs at all.

The Allegro CL IDE doesn't look like Emacs.

LispWorks uses an Emacs written in Common Lisp, but for example does not share the buffer handling (in LispWorks buffers have their own windows all the time and they can't be changed). Additionally much of the LispWorks IDE is not based on an editor paradigm (inspectors, debugger, preference windows, ...).

Since 15 years most (not all) open source CL developers used GNU Emacs + SLIME as the IDE. SLIME replaced older tools for GNU Emacs. There wasn't much competition for SLIME - it also was relatively easy for Lisp programmers to add IDE features to an editor extensible in some Lisp dialect - it's much more difficult and more difficult to make Eclipse or Intellij a decent Lisp IDE, and the results so far are clunky. SLIME OTOH is quite usable as a Lisp IDE.

It would be about time to have a better Lisp IDE than GNU Emacs / SLIME - especially one which is more graphical. But then, we now have the javascript web and GUIs are again different.

I was referring to recent-ish IDEs, although from all those you mentioned the only that do not look like Emacs to me are Allegro CL and Xerox's. The rest might not have exactly the same UI, but they still have a UI that looks very similar to Emacs.

As an example to the contrary, both the Allegro CL and DrRacket would be UIs that are not similar Emacs.

Because Lisp programmers like to extend their tools using Lisp. Which happens to be the case because Lisp is the most powerful language to have ever existed.

When you use Lisp to make an IDE to edit Lisp. Emacs like software is what you get.

For a programmers' text editor, you could do a lot worse than starting with the Emacs UI. (Even if working on character cell terminals, and being familiar to users, are not requirements.)

We should always be experimenting and finding better ways to do things, but not every such project has to start with Rethinking the Modeline and Echo/Input Area. :)

Because Emacs is the lisp way to code.

Eh, call me cynical but I'm gonna join the rest and say that this looks like yet another attempt to reinvent Emacs that'll eventually just be left to die somewhere. If all this time reinventing Emacs poorly had been spent developing Emacs instead we could've had M-x flying-cars by now.

One persistent problem I see in the Common Lisp (love the language!) space is the wide availability of crapware that not only doesn't bring something new to the table but is actively damaging to the community since it's diluting the set of good libraries and making it harder for new users to tell the wheat from the chaff. Lem is crapware. The problem it's supposed to solve, writing CL without configuring Emacs, is not a problem since there exists Portacle [1]. Lem is inferior to Emacs/SLIME/Sly in every way especially for writing Lisp. Lem has no future. But it exists and may act like a strange attractor to those who don't know better.

A question I'd really like to find the answer to: Why is there so much crapware for CL?. Why doesn't the community come together behind the few, really good, libraries but instead almost everyone goes out and does his own thing, the end result being an ocean of crap.

[1] https://portacle.github.io/

The first Emacs was written on top of TECO.

The came young students who had access to a brand new Lisp Machine in the MIT AI Lab (thanks to the welcoming spirit of Marvin Minsky and others). They implemented EINE (EINE is not Emacs) and ZWEI (ZWEI was EINE initially) and then Zmacs. -> Weinreb and McMahon. Bernard Greenberg wrote an Emacs in Maclisp for Multics. Hemlock was written in Spice Lisp. From then on a bunch of editors were written in Lisp.

Don't let you be discouraged. Learning to write well architectured programs is best done by writing programs.

I applaud those who put their thoughts between nested parentheses and turn them into working code...

I agree with this comment totally, specially in this part:

> Don't let you be discouraged. > Learning to write well architectured programs is best done by writing programs. > I applaud those who put their thoughts between nested parentheses and turn them into working code...

We should appreciate jobs like lem! They are trying, thinking! And this HN section??? JUST COMPLAINING! What are you doing for helping? WTF.

Sorry to hijack the thread but congrats on Lem. It's nice to see how far it's progressed. You even have an XCB binding in there!

Lemonodor-fame is but a hack away!

You haven't actually told us anything except what you think is “crap”. Could you please be more informative and less rude in your comments?

> Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something.


I mentioned the problem Lem claims to solve and proved that there are existing solutions to that problem. I also put forth that Lem is inferior to Emacs/SLIME/Sly when writing Lisp which should be obvious to anyone with Emacs experience. Then I made additional points which at least two people found of interest and tried to provide answers to.

I'm pretty sure all of that does not translate in me not telling you anything.

There can be multiple solutions to one problem, there's nothing wrong with experimentation. You seem to think it's OK to call any Emacs competitor crapware?

I defined crapware as something which dilutes the space of good libraries, offers nothing new and pretends to solve non-existing problems. I made my case.

The problems GNU Emacs does not solve for a CL programmer is its generally clunky user interface, lack of GUI features, its non-reusability in a Common Lisp program and its non-source-compatibility with Common Lisp. GNU Emacs will always be an extra component to a CL program and rarely will be the right user interface for a CL program - even though the program might need editor functionality.

One can get very far with it, but for some the combination of above is enough reason to look for alternatives.

By this logic, every new Linux distro, window manager, text editor, programming language, or anything else that competes with existing software is “crapware” that is “actively damaging” by “diluting the set of good [software]”. Competition is good! The community has never “come together” in any space (case in point: systemd), even outside of Common Lisp.

Corporations and small teams sometimes create software that is more cohesive and might be what you’re looking for, but this has never happened for a “community” of any reasonable size.

I agree with your point and disagree with the OP’s but I do believe that the proliferation of Linux DEs and recreation of basically the same software can often go beyond what is good.

One of the biggest things holding Linux behind today is the lack of a common vision. I think it’s no coincidence that Linux on the desktop really took hold only after Canonical started promoting Ubuntu. With Cqnonical retreating into the server space and basically abandoning desktops, I fear we are about to enter another era of Linux desktop stagnation at a time when arguably we need it most (OSX and Windows are increasingly becoming tied down, and the fastest growing OS is ChromeOS which isn’t just tied down but is also potentially a privacy nightmare).

That’s part of the reason that I’m an OpenBSD user, because there is a much smaller development team that has more of a cohesive vision. However, that doesn’t get in the way of user freedom. I’m just of the opinion that another desktop environment or window manager (or text editor, etc) that doesn’t take off isn’t an issue at all and it often pressures the incumbent to innovate and adopt new features.

Competition and a common vision don’t need to be mutually exclusive.

What a terrible vision about developing software. I hope you can change your mind in the rest of your life. Legacy software is not the end of all things.

I think the Lem developers would appreciate if you filed issues that caused you to believe what you do about the project, so they have a chance to improve the state of affairs.

beneath the invective there is an interesting point.

look at the context. its easy to understand in todays environment why someone would write a somewhat-finished personal project, put it on github, and try to get it noticed. personal itch, self-teaching, self-marketing, etc

whats less clear is how you get together enough time and bodies to spend the substantial effort to make something well documented, tested, and more broadly useful. especially in a lesser-used language.

open source has definitely 'won', but i dont think that issue has been adequately tackled. the story seems to be that you get to step #1, and get enough traction that you can hopefully build a functioning set of contributors.

[as aside lisp also has a reputation, unfounded or not, for encouraging people to develop a bespoke private universe thats hard for other people to get a handle on]

It's been an issue for a long time.


...give nodejs a try and see if you change your mind about "crapware" :)

That was fast. Just because something is not popular, it's not crapware. Nodejs libs are worse: they are proud to develop crapware software and have a extreme popularity by doing that.

Why we should support this type of software and attitude? There is something wrong with it.

> Why doesn't the community come together behind the few, really good, libraries but instead almost everyone goes out and does his own thing, the end result being an ocean of crap.

This is the Lisp Curse:


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