From: Edward Tate
Subject: Lisp questions
Date: 
Message-ID: <8c94a7f0.0410270206.35cef8a7@posting.google.com>
Hey people, I recently started writing a software rasterizer in
C++(for educational purposes of course), and half-way through the
development I got interested in Lisp.
I'm currently using CL-SDL, but there are a few things that are
unclear to me, is it possible to bit shift in Lisp(like say to plot a
24 bit pixel)? Is everything that is possible in SDL with C++ possible
in SDL with Common Lisp?
I was also wondering about the impact that the GC would have on the
performance. I noticed that it jittered slightly on some OpenGL demos,
would there be any way to get rid of this through code optimisation?
Also when I dragged an application from the background the demos
slowed down from 400fps+ to 5-6fps, is there a valid reason why this
should happen?

From: Jeff M.
Subject: Re: Lisp questions
Date: 
Message-ID: <1098885451.661347.41580@f14g2000cwb.googlegroups.com>
You can bit shift with ASH. However, care should be taken when doing
this, since Common Lisp supports bignums. For example:
(ash 1 33) => 8589934592 (not 0)

Jeff M.
From: Matthew Danish
Subject: Re: Lisp questions
Date: 
Message-ID: <87fz3zuasi.fsf@mapcar.org>
···········@hotmail.com (Edward Tate) writes:
> Hey people, I recently started writing a software rasterizer in
> C++(for educational purposes of course), and half-way through the
> development I got interested in Lisp.
> I'm currently using CL-SDL, but there are a few things that are
> unclear to me, is it possible to bit shift in Lisp(like say to plot a
> 24 bit pixel)? Is everything that is possible in SDL with C++ possible
> in SDL with Common Lisp?

Of course it is possible to bit-shift; see operators ASH, LDB, (SETF
LDB), LOGIOR, LOGAND, LOGXOR... etc in the Hyperspec.

  http://www.lispworks.com/reference/HyperSpec/Body/c_number.htm

Technically, everything you can do in C++ you can do in Common Lisp,
but I haven't implemented all functionality of SDL in CL-SDL.  Almost
everything is done, though, and you should be able to do what you need
to do.  Patches are always welcome.

> I was also wondering about the impact that the GC would have on the
> performance. I noticed that it jittered slightly on some OpenGL demos,
> would there be any way to get rid of this through code optimisation?
> Also when I dragged an application from the background the demos
> slowed down from 400fps+ to 5-6fps, is there a valid reason why this
> should happen?

Hmm, what implementation are you using?  I did optimize for CMUCL but
it should work fine in Allegro too, without jitter.  I can imagine the
demos would slow down if you drag another application in the
background, simply because of the strain on the CPU you are causing by
doing so.  Is there any reason why this is unreasonable?

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org