
Lem: A Common Lisp editor/IDE with high expansibility - lelf
https://github.com/cxxxr/lem
======
reikonomusha
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](https://github.com/rigetti/quilc)

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

~~~
zimablue
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.

~~~
dangirsh
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](https://github.com/dzop/emacs-
jupyter)

------
mark_l_watson
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.

~~~
fxfan
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?

~~~
foldr
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.

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

~~~
foldr
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%.

------
tmalsburg2
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.

~~~
lerax
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/](https://portacle.github.io/))

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

~~~
insertcredit
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...](https://www.gnu.org/software/emacs/manual/html_node/cl/Organization.html#Organization)

~~~
c256
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.

~~~
insertcredit
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?

~~~
dang
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](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:

[https://news.ycombinator.com/newswelcome.html](https://news.ycombinator.com/newswelcome.html)

[https://news.ycombinator.com/hackernews.html](https://news.ycombinator.com/hackernews.html)

[http://www.paulgraham.com/trolls.html](http://www.paulgraham.com/trolls.html)

[http://www.paulgraham.com/hackernews.html](http://www.paulgraham.com/hackernews.html)

------
progman
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!

~~~
PuercoPop
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

~~~
ksaj
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

#!/usr/bin/clisp

(format t "yup")

\---

and then on the command line:

> chmod a+x xx ; ./xx

yup

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.

------
pjmlp
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.

------
emit_time
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](https://franz.com/support/documentation/10.1/doc/eli.htm)

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

~~~
analognoise
"I use vim"

Bold move, putting heresy right up front.

~~~
lerax
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...

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

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

~~~
lispm
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.

~~~
badsectoracula
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.

------
Smithalicious
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.

------
insertcredit
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/](https://portacle.github.io/)

~~~
lispm
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...

~~~
lerax
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.

~~~
PuercoPop
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!

