Go - New language by Google

Discussion in 'Programming & Software Development' started by tr3nton, Nov 13, 2009.

  1. tr3nton

    tr3nton Member

    Joined:
    Oct 14, 2009
    Messages:
    1,281
    Don't know how old it is, but just came accross this from a slashdot article.

    http://golang.org/doc/go_lang_faq.html

    Anybody used? thoughts?
     
  2. Invicta

    Invicta Member

    Joined:
    Oct 23, 2007
    Messages:
    3
    Location:
    Melbourne
    I've been testing it out the last couple hours. Pretty solid language, easy to understand and very logical.

    Don't see any real reason to jump ship from other languages though, will have to wait and see what it's like in a full program though.
     
  3. Foliage

    Foliage Member

    Joined:
    Jan 22, 2002
    Messages:
    32,061
    Location:
    Sleepwithyourdadelaide
    Does it continue on with the C/C++/C#/Java style syntax?
     
  4. metamorphosis

    metamorphosis Member

    Joined:
    Feb 25, 2002
    Messages:
    1,781
    Bloody f*ing hell, I hope to god NOT.

    semicolons... is there anything more pathetic. Couldn't believe they were still in java. One of the things that put me off the language the most -
    what, you've designed a new language from scratch, and you're still using command terminators that AREN't newline? Statistically a missing semi-colon is still number one reason for compilation errors in all of the C languages.

    Not to mention the overcomplicated header system which requires external files just to figure out how the F one thing links to another. Etc etc.

    Bitch bitch bitch.
    M@
     
  5. DavidRa

    DavidRa Member

    Joined:
    Jun 8, 2002
    Messages:
    3,031
    Location:
    NSW Central Coast
    Disregarding the comment about error rates for missing semicolons, how will you handle multi-line statements? Escape with a backslash or single quote? If so, won't the idiots who can't compile C because they forgot the semi colon just convert into idiots who can't compile $LANG because they forgot the escape characters on the ends of most of their multi-line statements?
     
  6. malloc

    malloc Member

    Joined:
    Dec 15, 2005
    Messages:
    529
    Location:
    Adelaide
    The language looks very interesting. Some nice features (goroutines, simplicity, garbage collection) and some interesting decisions (no exceptions!).

    I think the real test will be the quality of the libraries that develop around it, which google is leaving up to the community at the moment. Languages these days can live or die by the available libraries.

    Being a google open source project it'll attract a lot of attention though, so I wouldn't be surprised if they develop quickly.
     
  7. flinchy

    flinchy Member

    Joined:
    Jan 18, 2007
    Messages:
    6,304
    Location:
    Northlakes
    interesting, i'll have to give it a spin when i get home.
     
  8. metamorphosis

    metamorphosis Member

    Joined:
    Feb 25, 2002
    Messages:
    1,781
    I guess so - essentially this is how python does it right?
    But multiline statements are much less common than single-line.
    And there's no real good reason to use multiline given the dearth of decent wordwrapping editors.

    The 'idiots' you speak of are everybody. There isn't a university professor who hasn't gotten into some intractable compilation error many, many times simply because of a missing semicolon.
     
  9. OP
    OP
    tr3nton

    tr3nton Member

    Joined:
    Oct 14, 2009
    Messages:
    1,281
    Is called making your code readable.
     
  10. SLATYE

    SLATYE SLATYE, not SLAYTE

    Joined:
    Nov 11, 2002
    Messages:
    26,830
    Location:
    Canberra
    Everyone forgets semicolons, but nobody actually has trouble with it. It's just like any other simple mistake in the code (like having a variable name mis-spelt) - you just go back and fix it.

    I don't see the harm in having semicolons. After a little while it just becomes natural to include them at the end of each line (I've even found myself doing that on paper). It allows a bit more flexibity, in that you can have one statement on many lines or many statements on one line (like the standard Java "int i = 0; i < x; i++").
     
  11. Luke212

    Luke212 Member

    Joined:
    Feb 26, 2003
    Messages:
    9,571
    Location:
    Sydney
    i think end of statements can be inferred with a smart compiler. there is probably no need for them.

    int x =1;
    int y =2;
    int z = x + y + 27 -12;
    Console.Write(z.ToString());

    or

    int x = 1
    int y = 2
    int z = x + y + 27 -12
    Console.Write(z.ToString())

    or

    int x
    =1
    int
    y
    =2 int z = x
    + y +27 -
    12
    Console.Write(z.ToString())

    the meaning is clear to us.
     
  12. Foliage

    Foliage Member

    Joined:
    Jan 22, 2002
    Messages:
    32,061
    Location:
    Sleepwithyourdadelaide
    Well header files are basically a thing of the past so that makes your only gripe semi colons?

    The reason I asked is most people do not want to relearn a new syntax, if they can jump in and paste snippets of their old code and have it work pretty much straight away with minimal changes they will love that.
     
  13. Luke212

    Luke212 Member

    Joined:
    Feb 26, 2003
    Messages:
    9,571
    Location:
    Sydney
    i never understood why C needed header files. it just always seemed like double handling to me. Are you saying there are no header files any more? that would be awesoem.
     
  14. Alex

    Alex Member

    Joined:
    Jun 27, 2001
    Messages:
    360
    Location:
    Perth
    I find it odd that you'd trash a language because of semicolons. Is it really that difficult? In my experience, semicolon related 'intractable compilation errors' are only a problem for absolute beginners. Everyone makes typos occasionally but a missing semicolon is hardly a show stopper.

    There are a number of things infinitely more important than trivial syntax conventions when deciding if a language is right for your application:

    - static/dynamic typing
    - interpreted/compiled/jit-compiled
    - concurrency support
    - platform cross compatibility
    - community support and 3rd party libraries
     
    Last edited: Nov 13, 2009
  15. SLATYE

    SLATYE SLATYE, not SLAYTE

    Joined:
    Nov 11, 2002
    Messages:
    26,830
    Location:
    Canberra
    This is true. MATLAB syntax is a lot like C, but it doesn't require semicolons (a semicolon just stops it printing the output of that line).

    Still, I find Java and C code a lot easier to read than MATLAB code. I think this is partly because the semicolons make it clear when a stament is finished.
     
  16. metamorphosis

    metamorphosis Member

    Joined:
    Feb 25, 2002
    Messages:
    1,781
    Whatever you think is right.
    *shrug*



    They're unnecessary, and having multiline breakers instead saves time.
    The java loop example you're using could be far more elegantly expressed, given that each statement is part of a whole statement, not singular operations.
    Anyway, I don't care. I think using semi-colons to terminate statements is fucking retarded. It does cause problems, and if you haven't looked into it, I suggest you do.
    Cheers,
    Matt
     
  17. malloc

    malloc Member

    Joined:
    Dec 15, 2005
    Messages:
    529
    Location:
    Adelaide
    An end statement indicator is really required. There are cases where the meaning can be ambiguous without one e.g.

    Code:
    int* a;
    int b;
    int c;
    int d;
    
    b = c;
    *a = d;

    Without an end statement indicator, the assignments could be interpreted differently e.g.

    Code:
    b = c
    *a = d
    or

    Code:
    b=c*a=d
    Both of which produce different results.

    Whether the indicator is a new line or a semicolon is really a matter of personal preference.
     
  18. Luke212

    Luke212 Member

    Joined:
    Feb 26, 2003
    Messages:
    9,571
    Location:
    Sydney
    thats in c. it only comes about because they reused the multiply symbol as a pointer, which was dumb. can you think of an example in a modern language, where symbols have a single meaning?
     
  19. killer65210

    killer65210 Member

    Joined:
    May 3, 2004
    Messages:
    304
    Location:
    Drummoyne, NSW
    soooooo..... anyone actually have something to say about THIS language???
     
  20. Foliage

    Foliage Member

    Joined:
    Jan 22, 2002
    Messages:
    32,061
    Location:
    Sleepwithyourdadelaide
    C is an old language, I don't think it is fair to use it as a base when discussing the merits of using the 'C style' syntax, I think Java or C# would be much more appropriate. Also re the above comment, any one know much more about this new language?

    They never did 'require' header files, you could put everything that was in the header file in the .c file itself. It is just considered neater to split them. In fact most compilers don't even need the definitions that are in a header file, it will spit warnings at you and stop detection of certain errors but the program will still compile and operate correctly.

    I agree though it is double handling as any of the newer compilers/interpreters eg C# and Java do not require them but still manage to use a very similar syntax.

    And that is your opinion, no need to get upset at everyone. Also I think you will find that the majority of programmers would rather adopt a language that uses a similar syntax to that of existing ones rather than learn a new one. You might not, and yes it might have its problems but everyone who has worked with it long enough knows how to write code efficiently using it.
     
    Last edited: Nov 13, 2009

Share This Page

Advertisement: