Re: C++ sucks for games

From: Rahul Jain (rjain_at_nyct.net)
Date: 10/31/04


Date: Sun, 31 Oct 2004 00:00:04 -0400


"Mark A. Gibbs" <x_gibbsmark@rogers.com_x> writes:

>> Eh? The code Phillipa posted was exactly the same as the C++ code
>> exceppt
>> without explicit types. The syntax was maybe misleading -- the equality
>> operator in most functional languages is not assignment, but a definition
>> of a term. I.e. foo = 5 means that foo is, by definition, 5.
>
> and what is 5? an integer? a byte value? a floating point number? a
> bignum? all of the above (a variant type)?

5 is whatever it is. "A byte value" is nonsense: that's just a modular
integer, I suppose. In most languages, explicit notation is required to
make something FP (thank god). I don't know why the hell anyone would
use an implementation where 5 needed to be a bignum. An object can't be
of all kinds of types. It is of some specific type (in Lisp, actually,
this only applies to classes, which are a specific kind of type) which
has some set of supertypes. The mother of all types in Lisp is called T
(the name for cannonical true value, as well). All bindings in Lisp are
implicitly declared as being of type T. If the compiler can prove a more
stringent type declaration for the binding, it can, of course, use that
declaration intersected with any declaration explicitly given by the
programmer.

> things get even more muddled if you do "foo = b" where b is an object of
> some type. what type? who knows, you'll have to look elsewhere.

Yes, you look at where b's value comes from... What is so hard about
this?

> i realize the code she posted was the same, but it seems to be implying
> to me that foo is a new variable that's created without a type
> declaration. that is old school programming. modern languages require
> you to specify the type of a new variable.

Bahaha. You mean modern languages are designed for more primitive
compilation techniques and more fragmented type systems? I think not.

-- 
Rahul Jain
rjain@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist


Relevant Pages

  • Re: Syntax directed compilation
    ... seems to be "too much power, users write their own languages and then ... The declaration statements are executed ... compile time. ... is also a statement which is executed at compile time. ...
    (comp.compilers)
  • Re: C++ sucks for games
    ... Then it will figure out that foo has the same static type as b. ... > type declaration. ... modern languages ... Lisp is designed to permit type inference by the compiler; ...
    (comp.lang.lisp)
  • Re: C# Language Proposal for out Parameters
    ... Bruno Jouhier wrote: ... languages like Pascal and ADA support in/out parameters ... > and you only need to specify this in the function/procedure declaration, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why C?
    ... > C programs can be as fast as a compiler can make them, ... > programs in other languages. ... > lurking bugs and inappropriate data types in any existing C code. ... With only a different declaration syntax it would be much ...
    (comp.os.linux.development.apps)
  • Re: Non-declared Variables
    ... without declaring them in dynamic languages like Ruby. ... that typically occupy a small scope could be made. ... Declaration and assignment should be different things, ...
    (comp.lang.misc)