Jump to content

C++ is dying


bascule

Recommended Posts

I'll have a look at the links you posted when I get back. But I was wondering; what languages do you use, for what purpose (as in what do you mainly use it for) and why those languages? 'Cause I "finished" learning C++ about a year ago,I don't know any other major things in C++ that one can learn. In other words, I think I have all the knowledge I'll need for your basic problem.

 

 

And I confused two things in my head, I meant dynamic, not interpreted. As in, you type in the commands, and they execute now. I just can't even imagine how one would make, I don't know, a program that accepts an integer x and outputs the first x Prime Numbers.

Link to comment
Share on other sites

Well, my comments were specifically in response to the requirements of a hybrid functional/imperative/OO language as laid out by PhDP.

 

The resulting code will probably be slower than its C++ counterpart, but will be free of overflows of all types and will likely be shorter and more maintainable.

 

In certain cases it will be implicitly parallelizable too.

 

Thank you for clearing that up for me! :P

Link to comment
Share on other sites

I'll have a look at the links you posted when I get back. But I was wondering; what languages do you use, for what purpose (as in what do you mainly use it for) and why those languages?

 

We mainly use:

 

1) Ruby as our primary language, because it's extremely high level and allows us to get things done quickly

2) JavaScript as our third party developer language, because it's relatively high level and well-known

 

'Cause I "finished" learning C++ about a year ago,I don't know any other major things in C++ that one can learn. In other words, I think I have all the knowledge I'll need for your basic problem.

 

There's a wide gulf between being able to do what you want in C++ and being able to understand others' C++ code. Do you understand RTTI? Standard template libraries like Boost?

 

And I confused two things in my head, I meant dynamic, not interpreted. As in, you type in the commands, and they execute now.

 

I suppose the word you're looking for in that regard is "evaluated"

 

I just can't even imagine how one would make, I don't know, a program that accepts an integer x and outputs the first x Prime Numbers.

 

Like this:

 

sieve(N) -> sieve(lists:seq(2, N), []).
sieve([], L) -> lists:reverse(L);
sieve([Prime|T], L) -> sieve([X || X <- T, X rem Prime /= 0], [Prime|L]).

Link to comment
Share on other sites

I'll have a look at the links you posted when I get back. But I was wondering; what languages do you use, for what purpose (as in what do you mainly use it for) and why those languages? 'Cause I "finished" learning C++ about a year ago,I don't know any other major things in C++ that one can learn. In other words, I think I have all the knowledge I'll need for your basic problem.

 

 

And I confused two things in my head, I meant dynamic, not interpreted. As in, you type in the commands, and they execute now. I just can't even imagine how one would make, I don't know, a program that accepts an integer x and outputs the first x Prime Numbers.

 

Why the hell did you copy my posts? :D

 

I'll have a look at the links you posted when I get back. But I was wondering; what languages do you use, for what purpose (as in what do you mainly use it for) and why those languages? 'Cause I "finished" learning C++ about a year ago...

 

I don't know any other major things in C++ that one can learn. In other words, I think I have all the knowledge I'll need for your basic problem.

 

And I confused two things in my head, I meant dynamic, not interpreted. As in, you type in the commands, and they execute now. I just can't even imagine how one would make, I don't know, a program that accepts an integer x and outputs the first x Prime Numbers.

Link to comment
Share on other sites

It sounds like Scala or OCaml would fit your needs.

 

I would have to take a serious look at Scala one day, it does seem interesting. Mono might offer better support for F# now that it's pretty much a standard .Net language, so that's an option too.

 

OCaml on the other hand has some problems with portability, I'm on Linux so it's not an issue for me but it is for many collaborators.

Link to comment
Share on other sites

One of the key issues in the development of programming methods is the programmer. The acceptance of a particular technology is dependent on people's habits.

 

A successful language of the past was EDL. It offered people the chance to get off of the mainframe. It was a simple language with no bragging rights yet it went on to provide solutions to many large scale problems. There are still large hotel chains that use EDL based systems for their reservations.

 

The large number of programming languages today shows the experimentation being done to find not only useful methods, but methods acceptable to large numbers of people.

 

the traditional relational database disappearing and getting replaced by simple key value stores

Here is a good example of an old concept that made MUMPS work. It is simple to understand and easy to manipulate.

Link to comment
Share on other sites

How does either OCamel or Scala outperform or make the creation of Monte Carlo simulations any better/easier than when done in C++?

 

note: I am quite interested in these sorts of applications and despite any prior arguing on behalf of C++ am truly looking for all the facts.

 

The point is really not to outperform C++, but to make programming more elegant and less painful. I also tend to prefer languages that encourage functional programming.

 

It has been interesting to see the rise of high-level languages capable of competing with C and C++ in terms of speed. Haskell and Scala are good examples. So, why bother with memory, with pointers, with the ugliness of C++, when you can have good performance *and* a clean code ? I'm still not satisfied with any of these languages but I'm optimistic for the future.

 

Also, to be honest, I'm not even sure C++ is that fast in practice, Most benchmarks are done in unrealistic conditions, 100% of the scientists I know who rely on C/C++ are far from being expert in C++ optimization, in many cases they would be better off with Java/C#.

Link to comment
Share on other sites

It has been interesting to see the rise of high-level languages capable of competing with C and C++ in terms of speed. Haskell and Scala are good examples. So, why bother with memory, with pointers, with the ugliness of C++, when you can have good performance *and* a clean code ? I'm still not satisfied with any of these languages but I'm optimistic for the future.

 

The other advantage I noted earlier is that, at least in the case of Haskell, your code is abstracted in such a way that it can be compiled directly to the opcodes of data parallel architectures such as CUDA.

 

With C++, you're SOL. You'd have to rewrite the hotspots of your code specifically for each data parallel architecture you're interested in targeting.

Link to comment
Share on other sites

C++ is basic sub language of C.This is fully depends on object Programming language.There are four important pillar supported as like Inheritance,Overloading,overriding,Encapsulation.C++ is mother language of any high level language as like Java2ee,.Net Framework.

 

C++ is provide very simple tool for understanding very complicated Program

 

I think that it can never died.

Link to comment
Share on other sites

C++ is basic sub language of C.

 

C++ is, for the most part, a superset of C, however there are syntactic constructions that are valid in C which are not valid in C++.

 

In that regard, Objective C does better than C++. All C programs are valid Objective C programs. The same cannot be said for C++.

 

C++ is mother language of any high level language as like Java2ee,.Net Framework.

 

From a purely syntactic point of view you can try to argue that. However, there are more appropriate choices for the "mother language" of languages like Java and C#. The languages (and C++) are all descendants of Smalltalk, which is in turn a descendant of Lisp. I am reminded of Guy Steele's (author of the Java specification) quote:

 

We were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp.

 

C++ is provide very simple tool

 

C++ is quite likely the most complicated programming language ever created, or at the very least it's the most complex language which has ever seen mainstream success. This is due in no small part to the fact that it's really 3 different languages: the C preprocessor, a functional templating language, and the C++ language itself, which is in turn mostly a superset of C. Because of this the processing of C++ source code is in fact Turing Complete, where the processing of most programming languages is "context free" meaning that you cannot use the language processing to emulate a Turing machine. There's only one other language offhand I can think of that has a Turing Complete parsing stage, and that language is Perl.

 

The C legacy also duplicates a lot of concepts from C++. Should you use a pointer or a reference? While the answer should generally be "use a reference, dummy!" a lot of people with a C programming background will eschew that and use pointers, and in the process may inadvertently break things like the copy constructor.

 

Regardless, C++ is anything but "very simple"

 

I think that it can never died.

 

I don't think C++ will die, but it is anything but a growing language. Higher level languages will continue to erode mindshare from C++ and its popularity will continue to diminish.

 

C++ had its day. That day is over. Newer, better languages are replacing C++ and will continue to do so.

Edited by bascule
Consecutive posts merged.
Link to comment
Share on other sites

In my mind, you are mostly right. For the standard developer, C++ probably is dead - you give a pretty good list of reasons. However, I'm not a standard developer. The kind of programs I develop are very high-performance related, generally parallelized using an interface like MPI and need to be very efficient. C++ fills a niche in that, as far as I am aware, it is a high-performance object-oriented language - perhaps the only one. So for this reason I don't think the 'true' death of C++ will happen any time soon.

Link to comment
Share on other sites

What I find really surprising is that everybody seems to know that C++ is horrible, yet very little is actually done to improve it. There is a place for a statically-typed, compiled language with low-level features, but from my perspectives C++ could be made into a reasonable language just by removing a couple of features and by making the syntax a little more clear.

 

I'm not a computer scientist so I don't know much about compilers, but it would seem possible to create a language very similar to C++, with a clear syntax, that would be compiled using C++ as an intermediate (and that could generate C++ code if someone needs it). A lot of simple things could be done to improve C++: optional garbage collection, removing structs, removing the preprocessor, I would perhaps remove function pointers and go with the "everything is an object" philosophy to make everything even more coherent...

 

I think part of the success of Python is that is was made by a mathematician looking for a beautiful, coherent language with a nice syntax. Perhaps someone could do the same with C++ ?

Link to comment
Share on other sites

I'm not a computer scientist so I don't know much about compilers, but it would seem possible to create a language very similar to C++, with a clear syntax, that would be compiled using C++ as an intermediate (and that could generate C++ code if someone needs it). A lot of simple things could be done to improve C++: optional garbage collection, removing structs, removing the preprocessor, I would perhaps remove function pointers and go with the "everything is an object" philosophy to make everything even more coherent...

 

Yes, D or Java fit the bill here. Java is substantially more mature though. D is riddled with compiler bugs and two inconsistent standard libraries. Java is pretty much the "industrial strength" version of what you're describing.

 

The same could be said of C#. In fact the only execution strategy of the .NET CLR is to compile to native code. There is no interpretation whatsoever. Java uses a hybrid strategy of compiling to native code and interpreting JVM bytecode, which arguably allows it to perform more advanced optimizations of the compiled native code.

Link to comment
Share on other sites

Yea... But it's still very immature.

 

If it could go somewhere it would be great.


Merged post follows:

Consecutive posts merged
Yes, D or Java fit the bill here. Java is substantially more mature though. D is riddled with compiler bugs and two inconsistent standard libraries. Java is pretty much the "industrial strength" version of what you're describing.

 

The same could be said of C#. In fact the only execution strategy of the .NET CLR is to compile to native code. There is no interpretation whatsoever. Java uses a hybrid strategy of compiling to native code and interpreting JVM bytecode, which arguably allows it to perform more advanced optimizations of the compiled native code.

 

The truth is, as much as I want to get rid of C++ (but not Python), there are enough advantages to keep me writing C++ codes, especially since it's easy to cooperate with other scientists. Hopefully one day I'll find my dream language and I'll start evangelizing, but it would have to be a really great language for me to invest the time to master it and for now:

 

Java: I know it pretty well, it's a great language for teaching. I'll teach basic programming for scientists to a small group of biology students soon and I'll go with either Java (or Python). The tools are great, with NetBeans it's hard to make mistakes, JavaDoc is quite usefull, the debugger is great, good performance, ... Yet, very few people use it in science, it already feels like an old language (generics sucks), in terms of syntax it's actually not much better than C++, and in most programs I have to write it's often much worst thanks to the lack of operator overloading (a.multiply(b.add©....). Beside it's harder to use with Python, and there are surprisingly few librairies for scientists.

 

C#: Still an ugly C-like syntax. It's really much better than Java on nearly all counts: operator overloading, functional, you can write parts in F#, there are good librairies (dnAnalytics is great), real "generics", and the list goes on. But ! Mono is not mature enough, and unless Microsoft takes the issue of portability more seriously the mono implementation is always going to lag behind. Beside: it's still hard to use with other languages (except if they're translated to the CIL of course). Nevertheless I wrote a couple of things with C# and I liked it. I tend to prefer how .net languages are implemented to how the java world works, but I must admit i would have to read more about this.

 

OCaml: Just the opposite of C#/F#, it doesn't work well on windows... Beside I've heard bad things about nearly every aspect of the language (the syntax is ugly, the standard library has problems, ...).

 

Haskell: Very interesting, a fascinating language. Too pure for me, however ;) [and the typing discipline is ridiculously strong, to the point of being really annoying].

 

Scala: I like the "everything-is-an-object" philosophy, it's an elegant language and already manages to be nearly as fast as Java. As soon as I have more time I'm going to look closely at Scala, it really seems like the best option right now, but I have two concerns: it carries some of the problems of Java, like type erasure, and for some reasons it's really, really hard to get good tools to work with Scala, it's the exact opposite of Java.

 

F#: An immature language I would have to run on an immature implementation of the .net framework. It could very well become much more interesting than C# and Scala in the future.

Link to comment
Share on other sites

Those are all valid concerns. I think you may have been overly harsh on OCaml though. The syntax is ugly but the semantics are pretty nice, and I think it does a good job of mixing functional and imperative concepts.

 

Beauty is in the eye of the beholder though. I think Java is fairly ugly, and C++ is total garbage, especially when you start mixing in templates.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.