2009-09-21

Slime-sprof

Stas Boukarev polished up Juho Snellman's slime patch which nicely integrates SBCL's statistical profiler into Slime, turned it into a proper contrib (slime-sprof) and committed it to CVS. The patch dates back as far as 2005, with an update in 2006, and I'm glad that it eventually turned up into Slime itself.

Here's the link to the documentation explaining how to use it.

Thanks Juho and Stas!

  • Up-to-date screenshot by Stas:


  • Earlier screenshot by Juho:

2009-09-20

SLIME tidbits (2009-09-20)

Today I'll write about a very recent new addition: slime-edit-uses bound to the keys M-? and M-_.

It is the logical counterpart to slime-edit-definition (M-.) .

Basically, it's nothing more than a wrapper around the already existing Xref commands (slime-who-calls, etc.) but it's a pleasure to use because a) it's just one key binding which does all instead of a multitude of different special-purpose bindings, and b) it's an easy binding (M-? vs. C-c C-w KEY) and obvious as well (right next to M-. its counterpart.)

What does it do? Well see for yourself:

  • on functions, it'll show a list of all call sites.
  • on macros, it'll show a list of the sites the macro is expanded.
  • on special variables, it'll list all the places the variable is set, bound, or referenced.
  • on classes, it'll show a list of methods that specialize on that class. (no screenshot)
Of course, the usual disclaimer applies: The quality of this feature highly depends on how much Xref information your implementation is able to store.

Now, for me this begets the following question: How easy would it be to make SBCL collect Xref data during the build of itself?

2009-09-05

WANTED: trivial without-package-locks

Has anyone written a trivial wrapper definition for WITHOUT-PACKAGE-LOCKS ?

"Trivial" as in trivial-utf8, trivial-backtrace, trivial-garbage, trivial-shell, trivial-timeout, et cetera perge perge.

2009-07-25

Common Lisp & Vim

Nagging about how preposterous it is to be forced to learn Emacs, is no more.

Frank Duncan has been working on Nekthuth, a Vim plugin for Common Lisp. While it's not completely prime time right now, it certainly looks very promising. Definitively, the most feature-full plugin I've seen so far.

Now if you're one of those few lost souls who just do not want to find absolution in the Church of Emacs, take a look at it and give Frank a hand, or two. For example, make it use Slime's SWANK-BACKEND, not the server, just the portability layer.

Alternatives: Cusp, a plugin for Eclipse. ABLE, a standalone text editor written in Common Lisp.

2009-06-20

Erik Naggum, RIP.

It's sad but seems to be true: Erik Naggum was found dead in his home.

Last September, I wrote him a mail to thank him for the wealth of postings
he had contributed to comp.lang.lisp and for the impact they had on me.
I now feel incredibly glad I did that as I had always postponed doing so
for years.

Following is his response.

RIP, Erik.



* Tobias C. Rittweiler (2008-09-19 00:37)
> for a long time I've wanted to send an e-mail to express the
> gratitude I feel for the countless usenet postings that you have
> written in your comp.lang.lisp history. Now I finally came around
> doing so:

It’s been quite a while since I posted my last article to c.l.l, but
very warm and welcome messages like yours still keep coming in at a
rate of about one a week. It amazes me.

> Thank you for the time and energy you spent in writing so many
> sophisticated and thought-provocating articles. I never understood
> where you drew this massive amount of energy and the will to
> continue from, considering the feedback you received back at that
> time.

Even when I was posting at a high rate, I received more mail from
those who appreciated what I had posted. I needed that encouragement
and knowing that despite the increasing amount of insanity on the
newsgroup, lots of people were reading what I wrote with a positive
attitude. However, there are some people whose evil ways are truly
destructive, and those are the moralists and the punishers who are
utterly unable to produce anything good at all, but all the more
hell-bent on making others pay for such things as not living up to
their expectations, doing what they think is right, etc, and I drew a
considerable amount of energy from my life-long desire to rid the
planet of moralists and punishers. It may sound contradictory, but I
hold that the use of force and violence and the lesser evils of
moralizing and punishment should only be used to prevent any of them,
never to seek any other goal: Telling a moralist that moralizing is
wrong, punishing those who punish others, using force and violence to
stop those who initiate the use of force and violence — you get the
picture — is the right thing to do. Unfortunately, this gets the
moralizers and punishers all worked up, and they prove that they
really are the psychopaths they only appeared to be when someone had
the gall to do something against /their/ desires. So even though my
general outlook on life went under-appreciated, namely that if you
know what other people should have done in the past, you never have
any clue what you or anyone else ought to do in the future, and if you
are concerned with what you yourself ought to do in the future, you
generally leave other people alone to figure out what /they/ ought to do
in the future, too, lots of people picked up on the positive message:
Exposing moralists and punishers for what they really are —
psychopaths — does a great service to any community who suffers from
their pernicious effects. Of course, if you are a horribly bad person
like that, you can only see others as reflections of yourself, and you
never understand why anyone would want to moralize against or punish
/you/, because part and parcel of being rabidly insane is never being
able to see yourself from the outside, and you think insane thoughts
like “How /dare/ anyone moralize against or punish /me/, when I‘m the sole
moral authority in the whole Universe and everyone, everywhere have a
moral duty to behave the way /I/ tell them!”. Or, in other words, people
who partition the world population into “the good” and “the bad”
always make the mistake of believing that they fall into the “the
good” partition, when they are actually among the very few that are
truly evil: No monumental evil act in the history of mankind has been
committed by anyone who thought of themselves as “evil” — on the
contrary, the worse the (objective) evil, the more the perpetrator was
completely convinced of the goodness of himself and of his
“purification”. So when the newsgroup became plagued by the evil kind
of moron that has nothing to contributed and no rewards for anyone
doing the right thing, but only harm and punishment for those who do
the wrong thing in their eyes, it was time to quit. Had I had even
more energy, I could have stayed, but I had ran out of steam fighting
false accusations, which is another one of those hallmarks of truly
evil people who think nothing of harming the innocent in their crusade
against the “evildoers”. It turns out, as any study of history will
show, that those accused by moralists and punishers are always
innocent. That’s why we need courts, so those who accuse are not the
ones to decide on the guilt and the punishment. Stupid people tend not
to grasp this fact, and only see courts as means of letting people
they “know” are guilty avoid punishment.

> And I particularly mean your non-technical contributions. I read all
> those now already several years ago when I was sixteen if I'm
> remembering correctly. I recall how I was shocked at the tone you
> used, and the aggression you seemed to feel towards people, as I
> grew up in feel-good communities myself. [The postings] made me value
> technical expertise and competence over civil masquerade, and they
> revealed how the latter can sometimes even impair the communication
> for the former.

Civility and politeness are extremely useful tools in communication
with people who are more wrong than right, but of very little use with
people who are vastly more right than wrong. This counter-intuitive
observation comes directly from the fact that we simply do not need
civil and polite ways of telling people that they are right about
something. So the people who have most to gain from civility and
politeness are people who know they are and intend to /stay/ wrong while
they force everybody else hold their tongues. That may have been a
very good way of building societies before /anyone/ was usually right
about anything. It is only in the twentieth century that a sizable
fraction of the population had any means to know whether they were in
the right or in the wrong to begin with. Before we invented the
concept of the real world, everybody lived their entire lives in their
own emotional world. After science and technology invented the concept
of the real world and of truth as correspondence between thoughts and
reality, the internal, private world turned out to be /untrue/ almost
all the time. These days, I keep telling people that you only /really/
grow up and become a human being (as opposed to a mere animal) when
you realize that most of what you think and almost all you feel is
/wrong/ and every person, however smart or highly esteemed by their
peers, is utterly and completely incapable of determining where they
are right among all this wrongness on their own. We tend to believe we
are mostly right, however, and only notice when the consequences of
our actions contradict our best expectations. Now, there are many
areas of life where there /is/ no way to sort right from wrong, and it
would certainly be impolite to point out an error that was only
relative to our own personal values, which is where the impoliteness
of moralizing comes in, but modern man enjoys a growing number of
areas where we can unequivocally sort right from wrong, and then it is
impolite /not/ to point out an error, for that means we let someone
believe something that will cause them harm, or at least undesired
consequences, later on. This means that in the areas of life where
people are mostly wrong, it is indeed a good thing to be civil and
polite all the time, as one wouldn’t want others constantly to point
out one’s own mistakes, either, but in the many areas where it is
possible to be right, and positively harmful to be wrong, allowing
people to hold on to false beliefs in order to protect their feelings
is really, really bad for everyone. The key, therefore, is knowing
which areas can and which still cannot tell right from wrong. It is my
firm position that no areas of science, technology, engineering,
mathematics, and allied disciplines such as medicine, are proper
arenas for politeness and civility. If people are wrong and are
spreading dis- or misinformation in these fields, everybody hurts
because it becomes that much harder to know right from wrong. However,
in areas where no one can really tell, such as ethics, politics,
fashion, etc, even though we may have pretty good ideas and
communities who /choose/ a particular set of beliefs, it behooves people
to be humble and civil and polite because fighting with people who are
wrong, but believe they are right, yet there are no means to prove
that, would be extremely tiresome, as it became on c.l.l when people
who stopped thinking about issues where we /can/ decide right from
wrong, started to bother everyone with their /personal/ problems when
others disagreed with them.

> In retrospect, I'm pretty sure that you helped me become the
> individuum I am now.

I’m very pleased to hear that, and particularly that you took the time
to write and tell me. I wish you the best of luck for the future!

Best regards, Erik Naggum
--
Member of AAAI AAAS ACM AMS APS ASA ASL IEEE IMS MAA NYAS PSA SIAM USENIX
The United States of America still symbolizes individualism, rationality,
and intellectual achievement to me — even though most Americans disagree.

2009-05-14

SLIME tidbits (2009-05-14)

First a small addendum: In my previous blog entry I demonstrated the improved font-lock magic in Slime to shadow forms suppressed by reader conditionals. Anyone who succumbed to the temptation and updated their Slime checkout, should really update to today's HEAD. There has been a couple of issues which have been fixed meanwhile.

In this blog posting I'll demonstrate my work on Slime's inspector for STANDARD-OBJECTs. Previously it looked like this:

I always found the [set value] and [make unbound]buttons after each slot entry pretty distracting, if not to say annoying. So I spent some time to replace them with a checklist as follows:

Quite cool that you can do this with Slime's inspector! Notice that I did not have to touch a single Elisp code line for all this.

You may have noticed the new [group slots by inheritance] button: by default the slots are sorted alphabetically by their name. After pressing this button, however, the slots will be grouped according to the class they were inherited from. Or in CLOS terminology: according to the class they're direct slots of.

2009-05-02

SLIME tidbits (2009-05-02)

Since a long time SLIME tries to highlight forms specially that are suppressed due to reader conditionals. That feature has never worked reliably for me; sometimes such forms were highlighted, but most often not. And even if they were highlighted, redisplay (or rather refontification) would often remove the highlighting again.

While resuming to work on my named-readtables library -- which includes a little bit of portability glue --, I became annoyed^W intrigued enough to take a look at the cause of this non-deterministic behaviour.

The issue took more effort than I'd have initially expected. But as you can see from the screen shot, it should be fixed now. It shows the FINALIZE function from the trivial-garbage project. (I hope planet.lisp reader will be able to see the image, too.)