comp.lang.ada
 help / color / mirror / Atom feed
From: tking@gumby.SRC.Honeywell.COM (Tim King)
Subject: Re: Ada vs. LISP
Date: 9 Mar 89 17:22:33 GMT	[thread overview]
Message-ID: <18385@srcsip.UUCP> (raw)
In-Reply-To: eachus@mbunix.mitre.org's message of 6 Mar 89 16:52:26 GMT


In article <45978@linus.UUCP> eachus@mbunix.mitre.org (Robert Eachus) writes:

>      One of the things which I did during the ANSI standardization of
> Ada was to look for ANYTHING in the standard which would make
> translation of LISP programs into Ada difficult.  There were a few
> problems in the early drafts, but they were all eliminated by the
> final draft. 
>   ...
> (There are certain LISP lexical conventions that are incompatible with
> Ada, but they are easily dealt with: 'a --> QUOTE(A).)

Now, I'm no world class Lisp hacker, but I do know Ada, and I know enough
about Lisp that I almost choked on my tongue when I read this.  I showed
this article to an associate who is heavily involved with Lisp (eg, as a
member of the ANSI Common Lisp standards committee, and as a longtime Lisp
zealot).  He suggested that you might consider the following points:

  1) Lisp's ability to store arbitrary objects in arrays regardless of
     the type of the object (ditto for lists, hash tables, etc.).
  2) The first class nature of functions in Lisp.
  3) Lisp's ability to share state among closures (you might be
     able to do this with Ada tasks).
  4) Lisp macros.
  5) Lisp symbols (they have plists and function bindings).
  6) Lisp's complex type specifiers (e.g. type foo is either an integer or
     an array).
  7) And so on.

In a nut shell Ada can't support Lisp's view of typing, and functions are
not first class objects in Ada.  Even if you could somehow solve these
problems, the performance of the resulting "AdaLisp" would be abysmal.

If you *really* don't have anything better to do, try to write the following
code in Ada:

  (defun funs (n)
    (let ((z n))
      (cons #'(lambda (x) (incf z x))
	    #'(lambda (x) (decf z x)))))

  (setq foo (funs 0))
  (funcall (car foo) 10)   =>  10
  (funcall (cdr foo) 3)    =>   7

(=> is a short hand for evaluates to, and is not part of Common Lisp)

-----------------------------------------------------------------
Tim King                             |
Honeywell Systems & Research Center  |  Are we having fun yet?
Mpls, MN  55418                      |

  reply	other threads:[~1989-03-09 17:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-02-22 10:56 "Forced to Use Ada" Edward Berard
1989-02-27 23:28 ` Bob Hathaway
1989-03-01 23:49   ` A. Jeff Offutt
1989-03-02 20:04     ` Bob Hathaway
1989-03-03 17:21       ` Paul Raveling
1989-03-05  1:07         ` Bob Hathaway
1989-03-06 16:52         ` Ada vs. LISP Robert Eachus
1989-03-09 17:22           ` Tim King [this message]
1989-03-09 20:40           ` C++ vs. Ada (was Ada vs. LISP) Archie Lachner
1989-03-10  3:31           ` Ada vs. LISP John Gateley
1989-03-13 19:23             ` Robert Eachus
1989-03-12 16:22           ` Steven D. Litvintchouk
1989-03-15  1:33         ` "Forced to Use Ada" Douglas Miller
1989-03-15 17:29           ` Paul Raveling
1989-03-16 14:06         ` karl lehenbauer
1989-03-09  5:36     ` Harry S. Delugach
  -- strict thread matches above, loose matches on Subject: below --
1989-03-08 22:05 Ada vs. LISP Bob Riemenschneider
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox