all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Thomas Lord <lord@emf.net>
Cc: Tom Tromey <tromey@redhat.com>, emacs-devel@gnu.org
Subject: Re: guile and emacs and elisp, oh my!
Date: Sat, 24 Apr 2010 13:05:11 +0200	[thread overview]
Message-ID: <m3hbn13yc8.fsf@pobox.com> (raw)
In-Reply-To: <1272062597.6107.29.camel@dell-desktop.example.com> (Thomas Lord's message of "Fri, 23 Apr 2010 15:43:17 -0700")

Hi Tom,

Thanks for your mail, it brought up some things I hadn't thought about.

On Sat 24 Apr 2010 00:43, Thomas Lord <lord@emf.net> writes:

> Sure, Schemers ought to be encouraged to write
> "(null? x)" rather than "(eq? x '())" but ... 
> what about "(eq? x y)"?  

To me, `(null? x)' checks nullity. `(eq? x '())' is ambiguous -- it
could be a check for nullity, or it could be a check for identity. `(eq?
x y)' to me is unambiguous though, it is a check for identity.

I would be interested to know if you had a case in mind in which the
introduction of nil to Scheme let to incorrect results via `(eq? x y)',
beyond those documented in Nil.html.

> More damingly, perhaps, what distinction does 
> Guile plan between the Scheme symbol, "'nil", and
> Emacs the Emacs lisp symbol, "nil"?  Do emacs
> lisp and Guile not even agree on what is and what 
> is not a symbol?

Irritating! I did not even realize that nil was a symbol.

Given that there appear to be few Elisp primitives that operate on
symbols, I imagine the way this will go will be for nil to not be a
symbol to Scheme, but we'll add some shims to elisp to have it be a
symbol, and have the elisp reader read 'nil as nil. There are only about
50 instances of 'nil in the emacs source, and some of them are ''nil, so
hopefully this will not cause too much of a problem.

To my (naively optimistic?) tastes, we're not at chaos yet; but this is
certainly a step in that direction.

> And: since Emacs lisp and Guile can't agree about
> equality (whichever flavor) - how do I write a 
> hash table library useful to both environments?

Scheme will probably get some new operators out of all of this: nil-car,
nil-cdr, nil-equal?, nil-hash, nil-assoc, etc. By default, a hash table
implemented in Scheme would treat nil and '() as distinct, though you
could implement one with nil-hash and nil-assoc and you get an
elisp-style hash table. Elisp hash tables use Elisp hash and assoc,
which are bound to nil-hash and nil-assoc or their equivalents.

> If, absent the historic liabilities, someone proposed
> a programming environment with multiple syntaxes, sure,
> but all sharing a common data representation - with
> (), #f, and Emacs lisp nil .... wouldn't you think they
> were kind of insane?   The multiple syntaxes part - fine.
> But the triad of (), #f, and nil?  It would seem, in my view, 
> to be a (mis-)feature designed mainly to make programming
> in that environment harder.

I am inclined to agree, though I would probably state things
differently: the Elisp code that is out there is liability, yes, but
wealth also.

As you note, we're always making these economic decisions, and with
regards to unknown (and often unquantifiable) costs and benefits -- well
you never really know until you step into that unknown, right? (And the
reasons that lead one to make those steps often go by slippery names
like "faith" or "instinct" or such things.)

Anyway, rambling here at the end. I respect your desire for a new lovely
Scheme Emacs; but I think I'm going to try for a future world that
includes Elisp and Elisp programmers. Maybe over time it all stays in
Elisp; that's fine. Maybe people find they like Scheme better, and
incrementally rewrite things in that language. That's cool too, and
personally I hope things go that way. But we'll see!

Happy hacking,

Andy
-- 
http://wingolog.org/




  reply	other threads:[~2010-04-24 11:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 20:18 guile and emacs and elisp, oh my! Andy Wingo
2010-04-15  8:38 ` christian.lynbech
2010-04-15  8:53 ` joakim
2010-04-15 17:34   ` Andy Wingo
2010-04-15 23:54   ` Ken Raeburn
2010-04-16  6:48     ` joakim
2010-04-16 17:05     ` Ken Raeburn
2010-04-16 17:16       ` Ken Raeburn
2010-04-16 18:23       ` Stefan Monnier
2010-04-20 22:36 ` Tom Tromey
2010-04-21  7:37   ` christian.lynbech
2010-04-21  9:27   ` David Engster
2010-04-21  9:49     ` David Kastrup
2010-04-21 11:04       ` Lennart Borgman
2010-04-21 11:58       ` David Engster
2010-04-21 12:22         ` David Kastrup
2010-04-21 16:43   ` Ludovic Courtès
2010-04-22  9:35   ` Andy Wingo
2010-04-22 15:14     ` Karl Fogel
2010-04-25 19:36       ` Tom Tromey
2010-04-23  2:00     ` Thomas Lord
2010-04-23  8:28       ` Andy Wingo
2010-04-23  9:17         ` Ludovic Courtès
2010-04-23 10:19         ` christian.lynbech
2010-04-23 11:28           ` Andy Wingo
2010-04-23 11:31             ` christian.lynbech
2010-04-23 13:10               ` Andy Wingo
2010-04-23 22:43         ` Thomas Lord
2010-04-24 11:05           ` Andy Wingo [this message]
2010-04-25  0:02             ` Thomas Lord
2010-04-25 16:54           ` Richard Stallman
2010-04-25 17:11             ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hbn13yc8.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=emacs-devel@gnu.org \
    --cc=lord@emf.net \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.