Subject: Re: macro question
From: Erik Naggum <>
Date: Sun, 10 Mar 2002 13:32:58 GMT
Newsgroups: comp.lang.lisp
Message-ID: <>

* Rolf Wester
| The point is that at work I have a NT PC (CLISP) and a Compaq Tru64
| workstation (CMUCL) which I access over our intranet.  It's more
| comfortable to do development on the PC and do the long runs on the
| Compaq machine.  I'm going to install Linux on the PC too (not so easy to
| get it through in the the institute I'm working at).  The problem with
| the commercial implementations is that they are to expensive to get it
| easily payed by my employer especially if I wanted to have it both on the
| PC and the workstation (I'm working at a reserch institute and we get
| Visual C++ at a much much lower price).

  If you are an accredited research institute, you get _serious_ discounts
  from Franz Inc, at lest.

| First I would have to show that using CL would be a great benefit for the
| institute.  I'm the only one amoung my colleagues even knowing CL.  The
| trial versions of ACL or LispWorks are to limited to be useful for me.

  And they are not even useful to show that you can develop faster than the
  runtime supposedly suffers?  Remember, if you spend a week tinkering with
  your C++ solution, your Common Lisp solution would already have the

| For arrays I turned to TNT, a collection of template classes that allow
| more secure array access. With bounds check turned on this is a great
| advantage over the simple C arrays :). Of course this slows down the
| program :(. I'm going to benchmark TNT with bounds check turned on. Maybe
| that it turns out that CMUCL isn't so much behind this.

  An interesting optimize declaration you may want to look at is (safety 0)
  if you have not already tried it.  I am not sure what CMUCL does with it,
  but Allegro CL can get seriously faster with this declaration.

  Duane Rettig has also posted and made available some information on how
  to write code with unboxed floats.  I have never actually tried this, but
  from reports of people who have, it seems to be exceptionally efficient.

  Now, the only problem I have with floating point on the IA32, is that the
  hardware is much better than the languages that are usually used on it.
  Floating-point on that hardware uses an internal 80-bit representation,
  which is what you really want to compute with.  Hand-writing assembly
  code to handle some of these things is actually well worth the effort if
  it takes days to do a run.  IA32 floating point is easy to program and it
  can be done reasonably elegantly.  It even has a good number of registers
  that are not tied up with nonsense.  It may well be the only thing that
  is done right on that architecture's instruction set side.

| I did it. CMUCL is much faster than CLISP for this problem but there is
| still virtually no timing difference between the solution suggested by
| you and the closure.

  That is quite interesting to hear.  However, have you tried to refactor
  the algorithm and compute c1 and c2 outside the function and pass them
  in?  Have you tried writing a compiler-macro that does this for you?

| But I have to admit that tutorials and Graham's book "ANSI Common Lisp"
| was quite helpful for me. And I guess without the competent help that one
| can get here learning CL would be much more difficult (at least for me).

  I once told a friend who was interested in learning Common Lisp that the
  only way to learn the language well was to find a community of people who
  used it.  The problem is that such communities are somewhat hard to find.
  You can much too easily exhaust an electronic forum.

  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.