Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming Language to Replace C++

Name: Anonymous 2010-08-11 21:49

I think we can all agree that C++ is a terrible language. So why is it still around?

When talking to most C++ users (game developers, systems programmers), I've found that most seem to recognize C++'s faults, but they don't really care. They aren't even the slightest bit interested in a new language that might solve its problems, even one that gives them all the power of C++ with none of the downsides. You can't even get them to look at something new.

Why is that? Why does everyone just 'live with it' without wanting to improve the situation?

Name: Anonymous 2010-08-12 12:10

>>23
They allow "unsafe" raw pointers (in a futile attempt to woo C/C++ developers), which means the collector can't make bindings indirect, and so it can't move memory.

First of all, while indirect bindings were all rage in 1970, no one uses this approach anymore, you might want to refresh your knowledge of modern GC implementation techniques.

Then, the problem with pointers remains, but might be eased depending on the exact wording in the language specification. If they follow C in declaring that pointer arithmetic is defined only within the limits of one allocation unit (a single structure or an array in automatic storage, or a memory block returned by malloc) and additionally forbid reinterpret casts from pointers to integers and vice versa, then they can move memory all the way they want at small constant price in performance.

Another approach would be to follow C#, which also provides raw pointers, but to obtain a pointer to a managed object you must use the ``fixed'' construct which makes the object temporarily pinned, and also is lexically scoped which prevents leaking pinned memory.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List