Jump to content
  • Advertisement
Sign in to follow this  
FlowingOoze

Fantasizing about the best general purpose language

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been programming for quite a while. Languages that I'm most familiar with are Java and C++, but I've got some experience with several other languages. While I'm fairly happy with C++ and I like a lot of it's features, I believe that as a general purpose programming language, it's not really as useful as it could be. Since C++ is based on C, it comes with a lot of Cs pitfalls and a large part of C++ programming is dealing with things like memory management, which is mostly trivial in languages with garbage collection. So basically I'm looking for a programming language that would have the following features, not necessarily in order of preference: - Portable, ie. there actually are compatible compilers and environments for different platforms. - Easy and efficient access from the language to libraries written in C. - Sufficient support libraries and hopefully already existing bindings for common libraries, like OpenGL. - Efficiency comparable to C++. Doesn't have to be as fast as C++, but shouldn't be an order of magnitude slower. - Garbage collection - Exceptions - Efficient generic programming, with all or most of the goodies that C++ has, including operator overloading. - Lambda functions - Clean syntax. (Rules out LISP with it's nasty prefix notation and excessive use of parentheses.) - Easy to make stand alone programs that don't require the user to install excessive amounts of support programs and libraries. - Typesafe - Low cost/free compiler. Free runtime environment. Optional features: - dynamic class loading or dynamic modules incorporated in the language of some kind. DLL's don't count. I'll add new features to this list, if I'll think of any. [Edited by - FlowingOoze on August 27, 2005 7:51:33 AM]

Share this post


Link to post
Share on other sites
Advertisement
You could always try D, which is a good improvement over c++, and if you are familiar with c/c++ you will have no problem coding in D. It has built in garbage collection and now a GCC front end, and is compatible with C libraries.

D Programming Language

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
C# covers (or attempts to cover) most of that list quite well.

Share this post


Link to post
Share on other sites
Quote:
Original post by Codemonger
You could always try D,

D vs Other Languages
That list looks quite good, though I'm slightly trouble with missing multiple inheritance and implicit function template instantiation. The former I rarely need, but the latter is pretty important, in C++ anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
C# covers (or attempts to cover) most of that list quite well.

I'm slightly skeptical about C#, but I guess I'll have to take a look at it. If the Mono runtime is easy to incorporate into a C++ program, then it might be worth taking a shot.

Share this post


Link to post
Share on other sites
Although I've never used them.

C# may work well. I don't think it really has lambda functions, though.

Ocaml is on my list of languages to learn, I think it has most (if not all) of the things your looking for.

On a side note I'm currently learning Lisp,I think Lisp's prefix syntax is really elegant while C's and java's post-pre-infix notion mix is nasty. And with a good editor and proper indentation the parentheses are only annoying to type, reading isn't really a problem.

Share this post


Link to post
Share on other sites
huh I never noticed that .. no multiple inheritance, that's too bad. heres a quote on the site about it that I found:

Quote:
"Multiple inheritance. It's a complex feature of debatable value. It's very difficult to implement in an efficient manner, and compilers are prone to many bugs in implementing it. Nearly all the value of MI can be handled with single inheritance coupled with interfaces and aggregation. What's left does not justify the weight of MI implementation.

Share this post


Link to post
Share on other sites
Quote:
Original post by Codemonger
huh I never noticed that .. no multiple inheritance, that's too bad. heres a quote on the site about it that I found:
Quote:
[quote removed]

I agree with the quote, though there have been times when I'd wanted to use multiple inheritance in Java to save me from code duplication. The lack of implicit function template instantiation might also be more of an annoyance than a real problem. Eg. writing max<int>(a,b) instead of max(a,b).

Share this post


Link to post
Share on other sites
Quote:
Original post by Cocalus
ng Lisp,I think Lisp's prefix syntax is really elegant while C's and java's post-pre-infix notion mix is nasty. And with a good editor and proper indentation the parentheses are only annoying to type, reading isn't really a problem.

I didn't think that the readability was that big of a problem, though LISP does look like garbage to me. The infix notation is more consistent with general mathematical notation and saves you from having to type all those redundant parentheses. I guess in the end it's a matter of style, but I really like the infix notation.

Share this post


Link to post
Share on other sites
By your description, could I suggest Python? It is built on C++ but offers much more elegant syntax. You can even extend the existing functionality with your own C++ code, if you already have your own libraries, or need speed-critical functions.

--random

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!