Suggest a language for me

Started by
16 comments, last by GameDev.net 17 years, 11 months ago
Thanks guys. Stackless Python sounds really interesting. I didn't really get much out of a quick look at the Erlang website - it seemed buzzword-compliant but short on details.

Why are all the new languages so in love with dynamic typing?
-Mike
Advertisement
Quote:Original post by Anon Mike
Thanks guys. Stackless Python sounds really interesting. I didn't really get much out of a quick look at the Erlang website - it seemed buzzword-compliant but short on details.


Python is the first thing that came to mind.

Quote:Why are all the new languages so in love with dynamic typing?


Because it's "easier".

Check out my new game Smash and Dash at:

http://www.smashanddashgame.com/

Quote:Original post by Anon Mike
Why are all the new languages so in love with dynamic typing?

Because it turns out that static typing isn't nearly as useful for catching semantic mismatches as everyone assumed it would be.
Quote:Original post by Anon Mike
I didn't really get much out of a quick look at the Erlang website - it seemed buzzword-compliant but short on details.

Actually the Erlang webpages are pretty good, there are various excellent online tutorials and manuals.
Some of which are specifically aimed at people who want to get started quickly, for example check out:

http://www.erlang.org/faq/t1.html
http://www.erlang.org/starting.html
http://www.erlang.org/examples.html
http://www.erlang.org/doc.html

Among the suggestions that were made so far, Erlang is definitely the only one that truly fulfills the majority of your requirements. A good basic overview about Erlang's most significant features can be found at: http://www.erlang.org/white_paper.html (check out only the first paragraph of that page for the overview). If you only want a quick introduction, make sure to also check out the wikipedia entry for Erlang: http://en.wikipedia.org/wiki/Erlang_programming_language

The wikipedia page also references a google video that illustrates some of Erlang's capabilities:
http://video.google.com/videoplay?docid=-5830318882717959520

Another basic introduction is available at: http://www-128.ibm.com/developerworks/java/library/j-cb04186.html?ca=drs-

So what other details are you specifically looking for?

Also, if you are interested in interfacing Erlang applications to C/C++, make sure to check out http://www.erlang-projects.org there are various useful extensions available that make creating bindings pretty easy and very elegant. In particular, you'll probably want to check out the "Erlang Plus Interface Framework (EPI)", as well as the "Erlang Driver Toolkit (EDTK)" which provide various ways to neatly integrate Erlang applications with C/C++.

And then there's of course also the so called "Erlang Interoperability Guide" which illustrate various different ways to interface Erlang with existing programs, CORBA was already mentioned-however there are many other less complex possibilities, too. For example, you can even use programs or scripts that are not aware of Erlang at all, (this works similar to CGIs, where STDOUT is redirected). So, there are really plenty of ways to connect Erlang applications with other programs, that is you do not even have to link any binaries or provide shared libraries-on the other hand, you can of course do so. Most of this stuff is covered in the Interoperability Guide: http://www.erlang.org/doc/doc-5.4.13/doc/tutorial/part_frame.html

Erlang's syntax is admittedly a bit weird for someone who isn't used to it (originally, its roots were in PROLOG), so having personally a background in C/C++, I found it initially quite a challenge to get used to the "weird" way the sources look, on the other hand the extreme functionality and compactness is very appealing. Also, most functional languages are usually quite a shock if you see them at first, in particular if you have a strong background in a different programming language.
Nevertheless, it's incredible how flexible and powerful Erlang is: given the excellent and comprehensive documentation available, you can get started pretty quickly anyway and you'll soon realize how you can write entirely convincing applications with extremely few lines of source, i.e. I rewrote an small C++ distributed server application in Erlang when I started learning it, while the original source tree had ~5000 LoC, the Erlang implementation could cope with <
sorry, the posting contained HTML characters that weren't properly escaped by the forum software, so it was cut off-here's the rest:
--
Nevertheless, it's incredible how flexible and powerful Erlang is: given the excellent and comprehensive documentation available, you can get started pretty quickly anyway and you'll soon realize how you can write entirely convincing applications with extremely few lines of source, i.e. I rewrote an small C++ distributed server application in Erlang when I started learning it, while the original source tree had ~5000 LoC, the Erlang implementation could cope with less than 500 lines and was admittedly much more stable and mature than the original C++ app.

On the other hand, it's really a very different way of thinking, but as soon as you've written a couple of small programs in Erlang and realize what's even possible without modifiying your sources, you'll also realize how much power you've got at your hands. Another handy thing while learning Erlang is the standalone shell that you can use to interactively enter, compile and run Erlang sources.

The underlying concept is indeed extremely powerful, Erlang is definitely one of the most interesting answers to the increasing concurrency and distribution demands, basically any Erlang program supports concurrency right from the beginning, and distribution itself is only a matter of adding an "-export" statement to the sources, so that you can export individual functions for use by other programs.
So, everything in Erlang can directly be made a concurrent and distributed "service" which can be used by arbitrary programs (Erlang or not!).

While I do have to admit that I still have to face occassional issues concerning Erlang's syntax (a more ECMA-like syntax would definitely make it more readable) and functional nature, it is also really amazing how much you can achieve in Erlang with VERY few code: you'll be able to appreciate this particularly if you have written any non-trivial applications before and try to port them over to Erlang, so that you can compare the code overhead and functionality.

I would definitely say that this is currently one of the most interesting programming languages, in particular due to the increasing demand for concurrency and distribution. In fact, it would be incredibly cool if GamdeDev.net would consider to eventually feature an introductory article (or maybe even a short column?) so that Erlang can be exposed to a wider audience!
The D programming language ( http://www.digitalmars.com/d/index.html ) has been growing on me. It supports the key features you seem to be after, and has familiar C++ style syntax. A comparison with other languages: http://www.digitalmars.com/d/comparison.html

I haven't used it for any large projects yet though, so I can't fully attest to its suitability.
Daniel
Ruby, Python and D are nice languages, but they aren't well tailored to your situation.

I can give another recommendation for Erlang. It has good support for concurrency, distribution and dynamic updating of code, and is in relatively common usage for apps that need these features. The only real problem I have with it is that it is dynamically typed.

Another really nice language which has good support for all these features is Alice. It is an extension of SML, which means you get access to a lot of existing libraries. It is also statically typed with good type inference. I'm not sure how it compares to Erlang performance-wise, but I definitely reccommend you try it out.
Quote:Original post by FBMachine
The D programming language ( http://www.digitalmars.com/d/index.html ) has been growing on me. It supports the key features you seem to be after

I would disagree on the latter part, however I guess that depends on what exactly are those features that the OP considers "key features" ;-)
So it might help to have the OP prioritize his requirements...

Quote:Original post by Rebooted
Ruby, Python and D are nice languages, but they aren't well tailored to your situation.

I can give another recommendation for Erlang. It has good support for concurrency, distribution and dynamic updating of code, and is in relatively common usage for apps that need these features.

Fully second'ed, if you are however looking for something less esoteric and more familiar (to a C/C++ programmer that is), you should probably really check out Ada which has also good support for lots of the stuff that the OP mentioned.

This topic is closed to new replies.

Advertisement