Interesting languages

This post is postdated and not really organized. This is about me talking about things that I find amazing but don’t even have the time to get into.

If you take a look around, you’ll see that there are lots of languages seeing the day of light each year. I think they are three main reasons for that:

  • It’s not that hard to create a (scripted or compiled) language.
  • Development langages are made to reduce as much as possible the gap between computers and humans. And everyone has a special opinion about this. And a lot of people have special idea on how we could do that.
  • Languages requirements and possibilities evolve and are backed by previous languages.

I’d like to point out few of them. The best language I’ve seen so far is C#. It’s a almost complete rip-off from Java, and most of the other ideas go back to C++ (where the Java guys made some stupid choices). But it also tries to get the ease to get into of languages like VisualBasic. But there are also tons of great news ideas and syntaxes that makes this language very comfortable for a developer to use.

Some people seem to have understood that the Microsoft Search Labs aren’t so bad at creating languages and they are starting to take some ideas from C#. One of the most interesting ones is Vala.
Look how close Vala looks to C#:

1
2
3
4
5
6
7
8
9
10
class Sample : Object {
  void greeting () {
    stdout.printf ("Hello World\n");
  }
 
  static void main (string[] args) {
    var sample = new Sample ();
    sample.greeting();
  }
}

But, they are still a lot of differences compared to C#.

The really interesting thing is here is that Vala wasn’t created to be a simple C#-like language. It’s supposed to create light and high performances native programs with a simplified (simpler than C to write and simpler than C++ to learn) language. And the result is actually pretty good.

But wait, wasn’t the goal of java and C# creators to quit the native world to be in a complete managed world ? Yes, it is, and some people have even made some kernel level managed OS (Singularity (MS), SharpOS, Cosmos).

By the way, didn’t I already talked about a language like that? Yeah, that was the D language, but it looks a lot less like C# and it’s a lot more mature than Vala. Still, look at a D Language example of concurrency code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import std.concurrency, std.stdio, std.typecons;
 
int main()
{
    auto tid = spawn(&foo); // create an actor object
 
    foreach(i; 0 .. 10)
        tid.send(i);    // send some integers
    tid.send(1.0f);     // send a float
    tid.send("hello");  // send a string
    tid.send(thisTid);  // send an object (Tid)
 
    receive( (int x) {  writeln("Main thread receives message: ", x);  });
 
    return 0;
}
 
void foo()
{
    bool cont = true;
 
    while (cont)
    {
        receive(  // pattern matching
            (int msg) 	{ writeln("int receive: ", msg); },  // int type
            (Tid sender){ cont = false; sender.send(-1); },  // object type
            (Variant v)	{ writeln("huh?"); }  // any type
        );
    }
}

As you can see, it doesn’t look like any C syntax like language. But if you have some experience with other languages, you should understand what it does. And here again, the performances of the D language are pretty good.

And an other language that could become more and more important is The Go, from Google. This one is again compiled, native, fast has the particularity to be fast to compile.
Look at this concurrency sample code (found here):

1
2
3
4
5
6
7
8
c := make(chan int)  // Allocate a channel.
// Start the sort in a goroutine; when it completes, signal on the channel.
go func() {
    list.Sort()
    c <- 1  // Send a signal; value does not matter. 
}()
doSomethingForAWhile()
<-c   // Wait for sort to finish; discard sent value.

Hum, from my point of view, this code is quite disturbing. But don’t you feel it would be great to be able to make multi-threaded programs as simply as that? Would this be as simple as that in the real world. My guess is that we should see that pretty soon.

There’s just one little limitation to languages like Vala or Go, it’s the non existing IDE. Go has ACME which doesn’t look great, and Vala has a Monodevelop Plugin, but as far as I have tested not much (like auto-completion) is working yet.

These languages are really young. And the lack of good IDE make them a lot less comfortable to use than java and C#. But they might be the languages of your future.

One thought on “Interesting languages”

  1. Vala have future. Shotwell is a great program that is written in Vala and I believe is a good language to learn, just as Python and Ruby, and its a great substitute to Java which is quite similar.

Leave a Reply

Your email address will not be published. Required fields are marked *