Will C ever have OO (any) as part of the std?

B

Ben Pfaff

Tony said:
Will C ever have OO (any) as part of the std?

Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.
 
G

George

Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.

OO would be an uglification for C. It has been for fortran.
--
George

America must not ignore the threat gathering against us. Facing clear
evidence of peril, we cannot wait for the final proof, the smoking gun that
could come in the form of a mushroom cloud.
George W. Bush

Picture of the Day http://apod.nasa.gov/apod/
 
J

James Dow Allen

Will C ever have OO (any) as part of the std?

?!?!?!?! :) :) ... :-(

APL is a better language than Forth; why not make
Forth more APL-like? Oh, and please rewrite the
shell I use to employ a video game-like interface.

When a blind-tasting test found that 51% of
consumers preferred Pepsi, Coke took its product
off the shelves, replacing it with a Pepsi
taste-alike named "Coke"! (Admittedly this bizarre
ploy turned into a money-winner for Coke when
it reintroduced Classic Coke a little later!)

Call me an old fogey, but I found it simplest
to simply copy old 'nvi' and 'csh' binaries when
I bought a new computer recently. Sounds like
I'd better keep a Classic-C Compiler binary
around also. 1/2 :)

James Dow Allen
 
J

James Kuyper

Tony said:
Will C ever have OO (any) as part of the std?

You can already do OO in C; it's just that some other languages have
features that make OO easier than it is in C. If you want a C-like
language with features that support OO, there's several to choose from,
as you almost certainly are already aware of. If there's any point at
all in the continued existence of C after the creation of perl, C++, and
java, it must be to take advantage of the greater simplicity of a
language that does not support OO. That simplicity makes the language
easier to learn, easier to understand, and easier to implement.

OO has it's advantages, too. That's why there's more than one
programming language in the world - different languages are better for
different types of tasks, no one language is best for all tasks.
 
W

Walter Banks

Probably not. The primary mandate for WG-14 is to
document current practice. Most OO proposals would
shift the focus of the purpose of C. As other have said
there are many OO languages rooted in C.

w..
 
C

CBFalconer

Ben said:
Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.

Besides, it already exists. It just isn't as simple to use, and
requires (horrors) discipline. For example:

typedef struct thing {
readfn readop;
wrtfn writeop;
size_t gutsize;
char guts[MAXGUTS]
} thing, *thingp;

with readfn and wrtfn pointers to procedures, can be used to
implement many of the types of operations used in OO. Then
"thing.readop" might require coding:

if (err = *thingp.readop(*thing, stdin, 100))
handlerr(err, *thing);

and I don't use this, so ignore any silly errors above.
 
P

Pawel Dziepak

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yes. It's called Objective-C.

Objective-C extensions are no covered by any C standard. It's just
another programming language that is based on C.

Pawel Dziepak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkRnA4ACgkQPFW+cUiIHNq4IgCfQs2e7gjdcVQlg7gVNJVdEFtR
UpAAoJDhBDgbChAbpqwgvkx7DxKTwMZF
=45bY
-----END PGP SIGNATURE-----
 
C

CBFalconer

Pawel said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
.... snip ...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkRnA4ACgkQPFW+cUiIHNq4IgCfQs2e7gjdcVQlg7gVNJVdEFtR
UpAAoJDhBDgbChAbpqwgvkx7DxKTwMZF
=45bY
-----END PGP SIGNATURE-----

Please eliminate this useless gup.

I'll revise that - it has a purpose - to annoy.
 
L

Laurent Deniau

Will C ever have OO (any) as part of the std?

Tony

You can download the "C Object System" from sourceforge which is a
pure C library. The current release is 0.7 but it's already pretty
stable for the CosBase module which is the required module to do OO in
C. It requires a C99 preprocessor but a C89 compiler once preprocessed
(obviously a C99 compiler is ok). The CosStd module is still under
development (unstable).

The features provided by COS go far beyond to other framework (e.g.
GObject) and some languages (e.g. Objective-C):

- uniform object model (class, metaclasses) better organized than in
Objective-C
- multimethods (methods member of more than one class) with a
dispatcher faster than Objective-C and as fast as virtual function of C
++ (for single dispatch).
- fast message forwarding (about 50-80 faster than Objective-C)
- exception and contract
- ownership and memory management
- introspection
- closure
- thread compliant (use TLS if available, pthread otherwise)

I can send you some transparencies on COS as a (very short) manual,
but still enough since COS is rather simple for C programmers with
minimum OO knowledge.

regards,

ld.
 

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,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top