C++ sucks for games

J

John Thingstad

I suspect that most "MS-Windows Developers" work like that too.
Probably an important factor as why we see so many BSOD in public
appliances...

Most Lisp programmers perhaps.
In all C++ development for Windows I have done we've used Windows.
Client programming under Windows isn't bad. Much better than the tools for
Unix.
(I'm still talking about C++)
I dare say most Windows programmers actually develop under windows.
They gripe about Micro$oft but still use Visual C++.
C++ isn't productive or pretty but it gets the job done.
Even today I'd still choose C++ over Java any day.
 
K

Kenneth Tilton

Gerry Quinn said:
My biggest concern (leaving pure language and re-use considerations out
of it) would be easy integration with standard Windows controls and
features.

Will the C interface do? Can do. Corman Lisp offers a nice set of
bindings so you Just Call windows API as if it were in Lisp. Same with
AllegroCL.

I gather MS is moving to C++-only deals, which gets ugly since one needs
to develop C glue.

I would also require the creation of reasonably compact
downloadable .exes that would work reliably on just about any Windows
machine, and would not require downloading of added libraries or
environments.

By compact you mean "will fit on a CD"? Can do. :)
But this is the thing - you go on about how Lisp is "so much more
productive" but there's no evidence of it! My 'Concentration' clone
(see else-thread) is about the same length as Michael Naunton's and took
about the same time to write.

Agreed. I take it back. Lisp is like a Formula I racer (yeah!!
analogies!!). It does not pay off (much) until you have some interesting
driving to do. Concentration and, from what I can see, your games are
too simple to exercise a language. Not that they are bad games!

I was going to port Michael's version to Cells (my FRP hack) when I
realized it would have about three rules. Yawn. I do not need VisiCalc
to buy a six-pack of Bud and some pretzels.

Call it prejudice if you like, but I *trust* C++, like C before it, to
not fail in this regard. Even for apps much much bigger than mine.

Well, no, the last bit is exactly the issue, and has not been
established by the Concentration shoot-out.

I propose we all toss off an air traffic control system, one in C++, one
in Lisp, and one in Lisp/Cells, then see. We'll have Michael go first
again. :)

kenny
 
T

Trent Buck

Quoth Gerry Quinn on or about 2004-11-11:
But this is the thing - you go on about how Lisp is "so much more
productive" but there's no evidence of it! My 'Concentration' clone
(see else-thread) is about the same length as Michael Naunton's and took
about the same time to write.

Someone looking to get flamed might suggest that this is in part because
the program is small -- there is no need for capabilities Lisp provides.

I'm a pretty new to Lisp, but I can immediately an advantage Lisp has
over C/C++: there are demonstrably things that can be expressed in Lisp
but not in C / C++.

A concrete example is defining operators that don't evaluate their
operands exactly once. For example, this specialized loop construct:

#define _aug_doseq(i,from,to) \
for (i=from; \
from<to ? i<to : i>to; \
from<to ? ++i : --i)
#define doseq(i,from,to) \
_aug_doseq((i),(from),(to))

/* example usage */
int
echo (int argc, char *argv[])
{
int i;
doseq (i, 1, argc)
printf (argv);
}

....which only works if the arguments are functional. I can't think of a
way to define doseq to take arguments with side-effects without using
GNU extensions *and* having an unclosed brace in the macro.

In my opinion, Lisp is more elegant. For now I'm taking it on faith
that this is equivalent to `better', at least for high-level problems.

Game programming involves a lot of low-level stuff, right? I don't
think there's any contradiction in saying that Lisp is better for
high-level tasks and C is better for low-level tasks.

-trent
 
C

Christopher C. Stacy

John Thingstad said:
Have you ever developed commercially? lol
Only a academic can afford to ignore 80% of the market potential.

Only the home market is 80%.
A lot of corporate server-based computing is done on Unix.
 
J

John Thingstad

Only the home market is 80%.
A lot of corporate server-based computing is done on Unix.

corperate server market yes..
Since Windows server truly sucks the I wonder why the number isn't heigher.

Corperate market no.
Most desctop computer's run Windows.
The number is still approx 80 %.
 
H

Hannah Schroeter

Hello!

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'.

OK, that got me giggling.

But in fact, a Lisp programmer usually works from both ways. So
the result is a mixture between metaprogram and program, instead
of only metaprogram and a pure statement of the problem.

Especially as you can go to some length to extend the language
(as defined by the ANSI spec plus extensions you might use) by
quite "normal" means that are used to other programmers too
(defining library routines and data structures). Just that in
Lisp you can as seamlessly extend the language in other ways by
adding syntactic transformations (vulgo macros) or by influencing
CLOS (by using the MOP) or...

Kind regards,

Hannah.
 
J

John Thingstad

Corperate market no.
Most desctop computer's run Windows.
The number is still approx 80 %.

I should perhaps add that this number is difficult to verify since many
people
overwrite the Windows that came with the machine with Linux and 40 %
download Linux from
the net so they are not counted. So the number of windows users is
probably artificially high.
 
H

Hannah Schroeter

Hello!

Maahes said:
class's and methods are just a structural concept. C has structs and if you
wanted to implement a class with methods, its just as easy to do it in C.
Of course, virtuals and hierachy get messier, though still possible.

Of course, as witnessed by Xt/Xaw.

Kind regards,

Hannah.
 
K

Kaz Kylheku

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'.

That analogy would work perfectly if English lacked the expressiveness
to capture the semantics of the ancient Greek.
 
D

David Steuber

John Thingstad said:
I should perhaps add that this number is difficult to verify since
many people
overwrite the Windows that came with the machine with Linux and 40 %
download Linux from
the net so they are not counted. So the number of windows users is
probably artificially high.

I would love to believe this. Certainly I have wiped Windows from a
machine and just booted Linux. Make that two machines. But I don't
think the typical user does that. I doubt that even a full percent of
Windows machines get converted to Linux or *BSD. At least not
machines that are newer than one or two years old.

I'm currently running OS X on a PowerBook G4 and Debian Linux on an
Intel box that was built from parts.
 
P

Pascal Bourguignon

David Steuber said:
I would love to believe this. Certainly I have wiped Windows from a
machine and just booted Linux. Make that two machines. But I don't
think the typical user does that. I doubt that even a full percent of
Windows machines get converted to Linux or *BSD. At least not
machines that are newer than one or two years old.

I'm currently running OS X on a PowerBook G4 and Debian Linux on an
Intel box that was built from parts.

It doesn't matter. It's easy to have more than 50% market share when
all the OS sold by your competitors are installed on computers sold
bundled with your own. (NeXTSTEP/ix84, OPENSTEP/ix86, Solaris/ix86,
BeOS/ix86, etc). And it's best when your OS being sold and paid for
IS NOT used, since that means less support.

Either you have to buy Solaris/sparc, a Macintosh, or build yourself
your PC from parts, to avoid the Microsoft tax.
 
G

Gerry Quinn

Gerry Quinn said:
And this differs from the art of any abstract
expressionist painter how?

I pointed out some quite obvious deficiencies in the work of 'AARON'
earlier. (Not when we were talking about screensavers, but when
somebody raved at me for not giving it enough respect when the reason it
was introduced in the first place was as an example Lisp's capacity for
making screensavers, not art.)

At best AARON is at the level of generating repetitive doodles. That
may well be a fine software achievement, but I do not think it is a
great artistic achievement.
If a formal model of painting is possible, then it
will be a parameterized function of some kind.

If the second clause is true in any interesting sense, I would consider
the above to be close to an impossibility proof for the first clause.
The point is this guy has produced the best such
parameterized function in existence, and he did it
in Lisp.

And this counts as evidence for C++ somehow?!

The only way it counts as evidence for C++ is in precisely the way I
stated: its functionality as a Windows screensaver is limited.

- Gerry Quinn
 
G

Gerry Quinn

Only the vast, vast majority of home users, who're Gerry's target market.

Personally I use it because I'm a gamer, and to a lesser extent because I
can't be bothered to figure out how to duplicate my desktop setup under X.
I do seem to make a bit more of an effort to write portable code than
Gerry does though.

My 'Concentration' game is a bad example because everything is in a
CWnd-derived class. Such a class is already given up to Satan, and can
commit no further sin.

A more substantial game would have a 'game' object separate from the
'windows' object, and the game logic classes would be fairly portable.
[I do allow use of CPoint, CRect, etc. and CString, but even if MS
didn't have portable versions of these, I could knock up code to
replicate their functionality in a couple of days (I would rewrite all
but CString, which I would translate to <string>). Other than that, the
only MS-dependency is that it's compiled and tested only on MSVC. This
probably does introduce the odd portability hit, but I think it should
not be excessive, particularly as I tend to eschew 'fancy' code.]

- Gerry Quinn
 
G

Gerry Quinn

I should perhaps add that this number is difficult to verify since many
people
overwrite the Windows that came with the machine with Linux and 40 %
download Linux from
the net so they are not counted. So the number of windows users is
probably artificially high.

On the other hand, it has been suggested that most who buy a PC with
only Linux installed overwrite it with a pirated version of Windows!

Anyway, I think the number of people is only one consideration. The Mac
may have no more home users than Linux, but Mac users have no
ideological hangups about buying software...

- Gerry Quinn
 
G

Gerry Quinn

There is this website called Google where you can go
and type things like "lisp comparison C++" and it
lists relevant web pages and if you click on the
links you can go to those web pages and read
what others have said on the issue.

But they don't address the point I was making:

"The time it takes to sling together a few algorithms and produce a
basic pre-designed game is insignificant. Even if Lisp were ten times
more productive in this regard, it wouldn't make any difference. [...]
Productivity in messing around with small programs that are not for
general release is not really an advantage."

- Gerry Quinn
 
E

Espen Vestre

Gerry Quinn said:
But they don't address the point I was making:

"The time it takes to sling together a few algorithms and produce a
basic pre-designed game is insignificant. Even if Lisp were ten times
more productive in this regard, it wouldn't make any difference. [...]
Productivity in messing around with small programs that are not for
general release is not really an advantage."

What /is/ your point here? You seem to imply that Lisp doesn't have
an productivity advantage for anything larger than a small toy program.
If that's what you mean, you're wrong.
 
G

Gerry Quinn

Will the C interface do? Can do. Corman Lisp offers a nice set of
bindings so you Just Call windows API as if it were in Lisp. Same with
AllegroCL.

No, it will not! MFC has its faults, but it is better than the Windows
API. Plus, you are now selling a mixture of Lisp and C, versus pure
C++. People talk about 'multi-language' programs, with the optimal
language used for each task, but I suspect this is making a virtue out
of necessity, except on very big projects...
I gather MS is moving to C++-only deals, which gets ugly since one needs
to develop C glue.

I doubt that will be an issue, at least for a long time - at worst there
will be a transparent compatibility mode for programs that call the old
API functions. Observe that 16-bit Windows software still works fine
for the most part.
By compact you mean "will fit on a CD"? Can do. :)

No I don't. Bandwidth is much cheaper than it used to be, but one
cannot blithely create demos that are tens of MB in size. A MB or two
overhead would be fine, so long as the installation can be made
transparent.
Agreed. I take it back. Lisp is like a Formula I racer (yeah!!
analogies!!). It does not pay off (much) until you have some interesting
driving to do. Concentration and, from what I can see, your games are
too simple to exercise a language. Not that they are bad games!

I was going to port Michael's version to Cells (my FRP hack) when I
realized it would have about three rules. Yawn. I do not need VisiCalc
to buy a six-pack of Bud and some pretzels.

Still, it only took us a couple of hours in Lisp and C++. You've a
captive audience of Lisp fans on this thread - maybe it would be
worthwhile! Actually (funny how these things grow on you) I was toying
with the idea of doing a 2-player Windows version - I think I worked out
an easy way to implement a realistic AI...
Well, no, the last bit is exactly the issue, and has not been
established by the Concentration shoot-out.

I propose we all toss off an air traffic control system, one in C++, one
in Lisp, and one in Lisp/Cells, then see. We'll have Michael go first
again. :)

That seems wisest!

- Gerry Quinn
 
G

Gerry Quinn

Quoth Gerry Quinn on or about 2004-11-11:

Someone looking to get flamed might suggest that this is in part because
the program is small -- there is no need for capabilities Lisp provides.

I'm a pretty new to Lisp, but I can immediately an advantage Lisp has
over C/C++: there are demonstrably things that can be expressed in Lisp
but not in C / C++.

But there are no *tasks* fitting that description (hello, Turing-
complete).

- Gerry Quinn
 
G

Gerry Quinn

That analogy would work perfectly if English lacked the expressiveness
to capture the semantics of the ancient Greek.

If that was the only problem with the analogy, it would be a killer
analogy. Because Fortran is Turing-complete. English might not capture
the *poetry* of a work in another language, but it can surely capture
the semantics [And please, folks, spare me the Sapir-Whorf
references...]. Likewise, Lisp might express an algorithm in a fashion
that Fortran can't, but both can program a task using the algorithm.

- Gerry Quinn
 

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

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top