C++ sucks for games

G

Gerry Quinn

Check out

http://www.franz.com/success/customer_apps/artificial_intelligence/kurzweil.lhtml
and links.

The mention about use as a screensaver seems to imply that it is
generated statically, and I'm sure that is also possible, but I've
also seen it actually running as a screensaver in the background,
generating new paintings each time.

Yes, I had forgotten about that - it is a valid example of a good
Windows screensaver written in Lisp. Worth a download - I tried it
yesterday. [It runs as a screensaver just as normal, i.e. creating a
painting, pausing for a while, then erasing it and creating another.]

Comments: (1) the paintings are interesting, and very good for computer
generated paintings, but I would hesitate to make extraordinary claims
for them. (2) Windows integration is adequate, but no more, using very
basic GUI features, i.e. there's no evidence that it's all that easy to
make (say) a fancy Settings screen.

- Gerry Quinn
 
S

Svein Ove Aas

Gerry said:
Check out

http://www.franz.com/success/customer_apps/artificial_intelligence/kurzweil.lhtml
and links.

The mention about use as a screensaver seems to imply that it is
generated statically, and I'm sure that is also possible, but I've
also seen it actually running as a screensaver in the background,
generating new paintings each time.

Yes, I had forgotten about that - it is a valid example of a good
Windows screensaver written in Lisp. Worth a download - I tried it
yesterday. [It runs as a screensaver just as normal, i.e. creating a
painting, pausing for a while, then erasing it and creating another.]

Comments: (1) the paintings are interesting, and very good for computer
generated paintings, but I would hesitate to make extraordinary claims
for them. (2) Windows integration is adequate, but no more, using very
basic GUI features, i.e. there's no evidence that it's all that easy to
make (say) a fancy Settings screen.
Okay, that's it.

This incredibly talented guy spent *how* long on teaching a computer to
paint, writing something closer to real AI than most people have ever
imagined could be possible, and what you're concerned about is /Windows
integration/?

You, sir, are amazing.
*plonk*
 
M

Maahes

Depends which of the following two hypotheses you think more
likely.

(A) I over- or under- comment to about the same degree
whatever language I'm using.

(B) All languages require about the same level of commenting,
measured in comments per line of code. (At least for
code written by me).

I find (A) much more plausible than (B).

(C) Languages which differ more from English (when read left->right) require
more commenting. Consequentially, you are under-commenting your Lisp.
 
M

Maahes

3. Bauhaus was the second Lisp-based version of the Newton operating
system, also written in Ralph (a third version, written in C++ and
NewtonScript, and chosen for non-technical reasons, was the one
shipped).
It was a five-person, two-year project.
[...]
Also, it doesn't help the case when you here that the version of Bauhaus
that shipped was a C++ version... why would you even consider writing a
C++
version when you've already got 2 versions written in Lisp, which is
supposed to be a far better language...

What part of "chosen for non-technical reasons" did you have trouble
understanding?

The part that says what the non-technical reasons where.
 
G

Gareth McCaughan

Maahes said:
(C) Languages which differ more from English (when read left->right) require
more commenting. Consequentially, you are under-commenting your Lisp.

I don't think it's true that Lisp differs more from English
than C++ does. Apparently you do. How familiar are you with
Lisp?

And, as it happens, I find (A) more plausible than (C),
at least if you're taking (C) as an absolute rule (which
is what you'd need to draw your inference about my alleged
undercommenting). There are other things that make a
considerable difference to how much commenting is needed.
 
G

Gerry Quinn

Gerry Quinn wrote:
Okay, that's it.

This incredibly talented guy spent *how* long on teaching a computer to
paint, writing something closer to real AI than most people have ever
imagined could be possible, and what you're concerned about is /Windows
integration/?

You, sir, are amazing.
*plonk*

Dude, in the first place Windows integration is only one of the two
points I made, and it is entirely relevant to the question that was
asked. MORE relevant, in fact, than the quality of the program, which I
don't deny.

In the second place, I don't want to get involved in an artistic debate,
but I was not all *that* impressed by this much-touted example of
incredible AI. While composition is undoubtedly good (definitely his
best achievement by some considerable margin), the drawings are very
repetitive, and some aspects are quite pedestrian, notably the colouring
and the entire absence of shadow [unless you count the hair-colouring
quirk]. Given the repetition, it's clear that the AI as such is rather
limited; the images are at best doodles on a theme, at worst a
relatively shallow expression of the author's input.

As to how long it took (and presumably according to the Lisp boosters
his thirty years of work are equivalent to about 150 years of C++), I
don't see that it matters much.

- Gerry Quinn
 
M

mikel

Maahes said:
3. Bauhaus was the second Lisp-based version of the Newton operating
system, also written in Ralph (a third version, written in C++ and
NewtonScript, and chosen for non-technical reasons, was the one
shipped).
It was a five-person, two-year project.
[...]

Also, it doesn't help the case when you here that the version of Bauhaus
that shipped was a C++ version... why would you even consider writing a
C++
version when you've already got 2 versions written in Lisp, which is
supposed to be a far better language...

What part of "chosen for non-technical reasons" did you have trouble
understanding?


The part that says what the non-technical reasons where.

Presumably, my reply that gave those reasons solved that problem.
 
K

Kenneth Tilton

Gerry Quinn said:
So if you asked a Fortran programmer to acquaint you with the thoughts
of Aristotle, he would give you an English translation of his works.
Whereas a Lisp programmer would give you the original, plus a copy of
'Teach Yourself Ancient Greek'.

Argument by analogy! I love these!! Seriously, I checked out your web
site, and I think it might be helpful to turn the challenge "Show me the
Lisp game!" around: what exactly do you think Lisp might not be able to
handle in writing such games? The logic? The graphics? The GUI?
Performance? Other?

After all the ranting about how different is Lisp, at one level it
really is just a conventional HLL, with functions, iteration, objects,
structures, arrays, etc, etc.

All your games could be done easily in Lisp, and because Lisp is so much
more productive you could put more time and energy into the graphics and
gameplay logic and still finish sooner.

kenny
 
D

Duane Rettig

Gerry Quinn said:
As to how long it took (and presumably according to the Lisp boosters
his thirty years of work are equivalent to about 150 years of C++), I
don't see that it matters much.

No Lisp boosters have said anything like this. If I take your meaning,
that you are taking an (arbitrary but often used) 5X efficiency factor
of Lisp over C, then if you were to guess that Harold Cohen has spent
1 year's worth of work on Lisp out of the 30 years of work on Aaron
(i.e. 29 years of useful enhancement of Aaron itself) then the ratio
you're using would have put the C++ work at 5 years, thus leaving 25
years of useful work on Aaron itself.

Cohen gave a talk at ILC2002
(http://www.international-lisp-conference.org/ILC2002/index.html),
where he described his work. If you follow some of the links from the
url I gave previously and read the history and look at the photos,
you'll discover that a large portion of time spent on Aaron has not
even been software-related; for example, Cohen has built several large
"robot" painters which perform the physical task of making actual
small-room-sized paintings on the floor. It would have been a shame
if several of these years of hardware work had been wasted trying to
fiddle with the underlying language.
 
S

Stefan Ram

Gerry Quinn said:
Dude, in the first place Windows integration is only one of the
two points I made, and it is entirely relevant to the question
that was asked. MORE relevant, in fact, than the quality of
the program, which I don't deny.

I don't think, that a screen saver is a good choice for any
serious program. It occupies the whole screen, when it is
running, therefore it does not allow one to work with the
computer the normal way. It also can not easily be monitored
with other programs at the same time, so I feel less secure
when running a screen saver. Moreover, it will not install,
when the windows size is less than 1024 x 768 - can't it even
rescale?
In the second place, I don't want to get involved in an artistic debate,
but I was not all *that* impressed by this much-touted example of
incredible AI.

All I saw in the gallery was a parameterized picture:

Write a program to draw a picture (this is usually not AI),
then parameterize it (by number of plants drawn, number of
people drawn, position of arms of people, ...). This might be
some work, but that does not imply AI.

SHRDLU has more of what I consider to be AI: Some
implementations will not only paint a drawing with nice
blocks, they will also allow me to manipulate the drawing
using the English language. An AI painting programm could:

- take request in spoken English

- invent styles to draw based upon

- its understanding of the structure of things
in three dimensional space

- its understanding of how the eye and brain
of humans recognice things in pictures
(so it would not have to use photo realism
only, as created by naïve ray tracing)

- combine multiple ideas to express in one
picture, so that a picture might express
hidden or multiple diffuse meanings, which
a human viewer might possibly understand
or misunderstand.
 
K

Kenneth Tilton

Jacek Generowicz said:
Kenneth Tilton said:
Gareth McCaughan said:
Jerry Coffin wrote: [...]
(define (fact x) (if (= x 0)
(1
(* x (fact (- x 1))))))
As for a Lisp excerpt beginning "(1 ", well, ...

PWUAHHHAAHAHHAHAAHAHAAHHAAAAA....

Ahem.

(case x
(1 'a)
(2 'b))

I think you mean:

(case x
(1
'a)
(2
'b))

:)

kt
 
M

Maahes

mikel said:
Maahes said:
3. Bauhaus was the second Lisp-based version of the Newton operating
system, also written in Ralph (a third version, written in C++ and
NewtonScript, and chosen for non-technical reasons, was the one
shipped).
It was a five-person, two-year project.

[...]

Also, it doesn't help the case when you here that the version of Bauhaus
that shipped was a C++ version... why would you even consider writing a
C++
version when you've already got 2 versions written in Lisp, which is
supposed to be a far better language...

What part of "chosen for non-technical reasons" did you have trouble
understanding?


The part that says what the non-technical reasons where.

Presumably, my reply that gave those reasons solved that problem.

yep
 
M

Maahes

Steven E. Harris said:
No, for equivalence, you'd need something more like

void Rabbbit_Jump(Rabbit* this, int distance);

with the constraint that "this" is nonzero.
yes, my bad.
 
M

Maahes

== C++ ==
are those two really the same? afaiu, with

Rabbit nick;

nick.jump(3)

the rabbit nick gets passed as an implicit argument to the function

hs

Yeah, my bad. It should have been Rabbit_Jump(Rabbit *this, int distance)
 
G

Gareth McCaughan

Maahes said:
Of course you do, hence your previous email.

Is that intended as a constructive contribution to the thread?

I have some evidence that (A) or something stronger -- i.e.,
less favourable to your case -- is true; I find that when I
return after an absence to old Lisp code I've written (with
whatever level of comments I put in) I generally find it
at least as easy to get back to work on as I do with old C
or C++ code I've written (with, again, whatever level of
comments I put in).

This is, of course, all anecdotal and subjective. But it's
more than you've offered in defence of your contrary claims,
which so far as I can tell amounts to "I think Lisp looks
really bad and I found it difficult when I was briefly
exposed to it in college, so it must be a terribly low-level
language and need lots of comments".

Of course, maybe you're just (counter-)trolling and I've been
thoroughly had. :)
 
G

Gerry Quinn

Here's the source to the game Concetration. I wrote it a few days ago
for my daughter... Note that it's not production code, just a couple of
hours fun project (I added a comment or two for you.)

http://www.naunton.us/michael/cl/concentration.lisp

Just for pig-iron, I wrote a clone in C++ today, based on your
description (I can't run yours). Took about the same time! Likewise,
it's not production code (in particular, it will crash if it's given no
images at all - I should have fixed that at least).

The two might be an interesting comparison for readers of the thread.
My version is for an MFC dialog app. I left out most of the AppWizard-
generated boiler plate i.e. a CWinApp-derived class whose files I didn't
open at all, and a CDialog-derived class where I only added code to one
function. All my actual code is in the text file:
http://bindweed.com/misc/concen-src.txt

There is some bitmap-twiddling done by my DibDC class (not included),
but your version makes external calls to do the same thing, so I figure
that's fair.

I was surprised to find it is actually shorter than the Lisp version in
terms of characters, though it has more lines (a lot have just one curly
bracket). I was sure it would be longer, especially since I did some
things in quite a roundabout and repetitive way.

Those who want can download the 148 KB Windows executable from:
http://bindweed.com/misc/Concen.exe

Just pop it into a directory along with some .bmp files of any size
(there must be at least one or it will crash). It's quite fun! When
you've solved the puzzle, you have to close it and run it again for
another. Perhaps I'll tidy it up a bit, add a few options and sfx and
release it as a freeware...

Gerry Quinn
http://bindweed.com
Games, Kaleidoscopes, Screensavers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,510
Members
48,195
Latest member
Tomjerry

Latest Threads

Top