in reply to Thoughts on "Go"?

While glancing over the tutorial I saw that they stole one syntactic feature from Perl 6 (or maybe somewhere else, not quite sure ;-): no need for parenthesis around the condition in if statements, or around the statement list in for statements.

I also find the idea quite intriguing to use an operator := which automatically declares the variable on the LHS; I'm curious how that will turn out in practice.

But I guess the real killer app will be the concurrency support, and I'm neither qualified to comment on that, nor did I actually try it. If it provides Erlang-like good concurrency in an imperative programming language, it has a bright future ahead.

However the lack of exceptions make me think of the auld C style return type checking, which is always forgotten somewhere, and surely not state of the art for a modern programming language.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Thoughts on "Go"?
by punkish (Priest) on Nov 11, 2009 at 14:36 UTC
    If it provides Erlang-like good concurrency in an imperative programming language, it has a bright future ahead.

    I recently came across CouchDB, which promises good concurrency, and is written in Erlang. Am really liking it. See http://couchdb.apache.org/.

    This Erlang with its concurrency sounds good. Where can I subscribe to it? I know not much about it. Is this something that has to be designed from the ground up? How is it in Perl 6?

    --

    when small people start casting long shadows, it is time to go to bed
      Is this something that has to be designed from the ground up? How is it in Perl 6?

      It has to be considered from the start, at least. Perl 6 has various design decisions that aim at making concurrency as painless as possible, including soft exceptions, contextual instead of global variables, hyper operators and feeds as well as keeping as little mutable state as possible.

      However concurrency hasn't been the one and only design goal for Perl 6, so I'm not sure if one can expect the same level of concurrency support as from Erlang. We'll see.

      Perl 6 - links to (nearly) everything that is Perl 6.
Re^2: Thoughts on "Go"?
by Jenda (Abbot) on Nov 11, 2009 at 15:17 UTC

    Even if I switched to Perl6 alerady you'd not catch me skipping the parens. It just looks better with them. I don't have to put them around the condition in T-SQL either, but the only case when I don't is if the condition is a single exists (...). IMnsHO omiting the parents is just as clever as omiting the curlies in if statements in C or JavaScript. Something you can do, but sooner or even sooner it'll bite you.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      It's funny - lots of people have this reaction to the paren-lessness of Perl 6. "Yuck! I'd never leave them out!" Often with a rationale of some sort.

      A few weeks pass. The person gets comfortable with Perl 6. The scales come off; the parentheses go away.

      I've written a fair bit of Perl 6 code for 18 months now. I find the lack of parentheses easier to read and less cluttered than putting them in. After for, if, while et al., they simply don't have a purpose. They don't mean anything. The only reason other languages have them there is that they have things like braceless forms of those keywords, or that they cargo-cult C.

        The only reason other languages have them there is that they have things like braceless forms of those keywords, or that they cargo-cult C.

        Another valid reason is to prevent parsing ambiguities when the braces are optional, as in C. Making both parens and braces in an if statement optional feels like exaggerated liberty :-)

        Perl 6 - links to (nearly) everything that is Perl 6.
      It just looks better with them

      Can't agree with that, but taste is a personal matter.

      IMnsHO omiting the parents is just as clever as omiting the curlies in if statements in C or JavaScript. Something you can do, but sooner or even sooner it'll bite you.

      I can easily see the failure mode with omitting curlies in C or JS, but I don't see what could go wrong with ommiting the parens around the if condition. Care to elaborate?

      The only thing that might become confusing is when you use a map or grep with a block without additional parens. But that's only a rather rare case, and IMansHO not good reason to include visual noise in the general case.

      (I might also add that I've written a fair bit of Perl 6 code already and haven't been bitten by that)

      Perl 6 - links to (nearly) everything that is Perl 6.