Slashdot Mirror


Go, Google's New Open Source Programming Language

Many readers are sending in the news about Go, the new programming language Google has released as open source under a BSD license. The official Go site characterizes the language as simple, fast, safe, concurrent, and fun. A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop. Ars Technica's writeup lays the stress on how C-like Go is in its roots, though it has plenty of modern ideas mixed in: "For example, there is a shorthand syntax for variable assignment that supports simple type inference. It also has anonymous function syntax that lets you use real closures. There are some Python-like features too, including array slices and a map type with constructor syntax that looks like Python's dictionary concept. ... One of the distinguishing characteristics of Go is its unusual type system. It eschews some typical object-oriented programming concepts such as inheritance. You can define struct types and then create methods for operating on them. You can also define interfaces, much like you can in Java. In Go, however, you don't manually specify which interface a class implements. ... Parallelism is emphasized in Go's design. The language introduces the concept of 'goroutines' which are executed concurrently. ... The language provides a 'channel' mechanism that can be used to safely pass data in and out of goroutines."

831 comments

  1. Build-in function library by sopssa · · Score: 4, Insightful

    One of the things I immediatly noticed is the lack of build-in libraries. The reason I've always preferred Delphi and C# over C/C++ and PHP over Perl is that they all come with a comprehensive build-in function library for wide area of things.

    Programming now a days tend to be mostly high-level, so you would expect that new languages would provide that. I personally hate to find tons of different libraries for C++ projects just to do a basic thing. And lets be honest, theres no sense of everyone of us to code the basic functions again (and probably in worse code than the regularly checked build-in functions)

    That is why I love PHP, and because it provides a great manual on its functions. That is also why I love Delphi and why I started using it as 10 year old, without internet too - the reference guide that came with it was comprehensive and the build-in libraries and components for different things allowed me to rapidly try out to code apps and games. Only time I needed to find some libraries/components was when I was looking for a more rapid and better graphics library to do the drawing in my games.

    That is what would be "fun" in a programming language. It comes a lot before "fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection."

    1. Re:Build-in function library by cptnapalm · · Score: 1

      According to the go page, it is supposed to be a system language. So the niche it is aiming at is, perhaps, lower level.

    2. Re:Build-in function library by Blakey+Rat · · Score: 4, Insightful

      Perhaps it's designed to be embedded, like LUA or Javascript? In that case, comprehensive libraries aren't necessary or even desirable.

      Or, more likely, they just did the fun part of designing the language, and are leaving the hard part of creating libraries to somebody else.

    3. Re:Build-in function library by Toonol · · Score: 3, Interesting

      If they could at least include a subset of OpenGL... or just an SDL wrapper, maybe with some high-level features for simple 2d-3d manipulation... this looks like it would be a great learning language. I see they have a DRAW library with a very limited number of features.

      They also have a "spacewar" directory, currently empty...

      Whenever Google announces something, you have to make the decision... jump on it immediately and get ahead of the curve, but risk wasting all that time if it doesn't take off? Or wait?

    4. Re:Build-in function library by Al+Dimond · · Score: 3, Insightful

      PHP? Where they dump all their million built-in functions into one namespace? Lame. In Perl you have a lot more control over what libraries you pull in and how you use them -- you have to search CPAN for packages sometimes, but then you have a choice on what packages to use. And every Perl module I've pulled from CPAN has been well documented.

      I can see wanting lots of libraries around in a default install back before the Internet was big. These days that stuff should be separate and the language's core should be its core.

    5. Re:Build-in function library by Anonymous Coward · · Score: 0

      Just means someone has to code in said libraries. They don't grow in trees, you know.

    6. Re:Build-in function library by palegray.net · · Score: 4, Insightful

      Perl developers know about this thing called CPAN. PHP doesn't even come close in this regard, and you really can't get a better language reference than perldoc. Honestly, if you can't write an app using Perl's built-in functions and the thousands of modules from CPAN, you probably shouldn't be programming. While choice in languages can vary widely according to the individual coder's personal preferences and particular suitability for a given task, the weakness you've cited is imaginary.

    7. Re:Build-in function library by DuncanE · · Score: 1

      It seems to have a number of packages already including a image package and http package? (http://golang.org/pkg/)

      Im sure it wouldnt be to hard to write a package that wraps sqllite or something for DB access.

      My question is, given that its so close to C what does it give me the C doesn't?

    8. Re:Build-in function library by sabernet · · Score: 2, Informative

      It's got garbage collection and limits as to what you can do with pointers for starters.

    9. Re:Build-in function library by adamkennedy · · Score: 1

      One of the things I immediatly noticed is the lack of build-in libraries. The reason I've always preferred Delphi and C# over C/C++ and PHP over Perl is that they all come with a comprehensive build-in function library for wide area of things.

      The release of Strawberry Perl Professional in January should resolve your issues then, as we're going to be rolling a ton of stuff into a single install, so it will come with comprehensive built-in function library for a wide area of things.

      Or at least, it will fix it on Windows...

    10. Re:Build-in function library by daniel_mcl · · Score: 1

      Not so. The point of standardized libraries isn't that they're better than third-party ones, but that there aren't competitors. That way all development goes into the same library which everyone is familiar with and there's no bizarre fragmentation to deal with.

      --
      I used to read Caltizzle. I was a lot cooler than you.
    11. Re:Build-in function library by palegray.net · · Score: 4, Interesting

      Didn't fail to read the parent. Perl has an immense amount of built-in functionality; I'd easily say it eclipses PHP in this regard (perusing the documentation site I linked bears that out). My points regarding CPAN is meant to point of the fact that it augments that built-in functionality in a very standardized manner, and even in cases where you might "use Foo;" a large number of those modules are distributed with Perl's core (in other words, they're installed by default).

      I have to agree with a couple of your points, however. It's an unfortunate truth, but a heck of a lot of programmers do qualify as dicks. I've worked with my fair share of them over the years, and I have to say I've never met a truly gifted coder with a CS degree. I'm not saying they don't exist, but I'll be damned if I've found one yet. Oddly, out of the "real asshole" crowd, many of them had a CS degree in addition to sucking at their jobs. The best coders I've worked with never even went to college, didn't finish, or graduated with a degree completely unrelated to computer science or IT.

    12. Re:Build-in function library by AuMatar · · Score: 3, Interesting

      I view this as a defect, not a feature. Without competition, bad ideas and poorly implemented libraries (see large parts of Java's IO library with its 1 billion inheritances and its slow migration from old windowing toolkits) get used because its standard, where with competition they would die and better ones would quickly be written. I prefer the C/Perl system- preferably with a site like CPAN or boost that aggregates the good ones.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    13. Re:Build-in function library by Anonymous Coward · · Score: 0

      How do you automate the pull for end user with CPAN?

    14. Re:Build-in function library by Anonymous Coward · · Score: 5, Insightful

      I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.

    15. Re:Build-in function library by michaelmuffin · · Score: 3, Interesting

      They also have a "spacewar" directory, currently empty...

      the documentation directory is empty, but the original pdp1 code is there as well as a pdp1 emulator to run it on: http://golang.org/src/pkg/exp/spacewar/

    16. Re:Build-in function library by Anonymous Coward · · Score: 0

      By your logic, we shouldn't build trucks because you drive a car.

      Now let's at the intent of GO, as listed in the FAQ:

      Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
      By its design, Go proposes an approach for the construction of system software on multicore machines.

      Go is an experiment. We hope adventurous users will give it a try and see if they enjoy it. Not every programmer will, but we hope enough will find satisfaction in the approach it offers to justify further development.

      The Go project was conceived to make it easier to write the kind of servers and other software Google uses internally, but the implementation isn't quite mature enough yet for large-scale production use. While we continue development we are also doing experiments with the language as a candidate server environment.

      Go was designed with an eye on felicity of programming, speed of compilation, orthogonality of concepts, and the need to support features such as concurrency and garbage collection.

      Gosh, it's not PHP, but the goal was not to build the next version of PHP. But you don't have to worry about that, since you clearly are never planning on learning anything new for the rest of your life.

    17. Re:Build-in function library by DerekLyons · · Score: 3, Insightful

      Or, more likely, they just did the fun part of designing the language, and are leaving the hard part of creating libraries to somebody else.

      They pretty much explicitly state that in TFA - the 'simple' and 'fun' stuff is done, now it's up to the [currently theoretical] community to dig in and do the hard stuff.
       
      Of course, being Google branded and Open Source (two of the top 'auto orgasm' buttons among a huge swath of geeks) there will be, at least in the beginning, a fairly large community. I'll be very surprised if there isn't a Wiki by morning, and I'll be there's half a dozen or more Waves about it by now.

    18. Re:Build-in function library by onefriedrice · · Score: 1

      Or at least, it will fix it on Windows...

      I'm not on Windows, but fortunately I've never considered perl's slim "built-in" library a deterrent. Actually, I'm glad it doesn't come with everything anyone might possibly need. If I need something, it's probably already on CPAN, and it will be installed in a couple of minutes.

      --
      This author takes full ownership and responsibility for the unpopular opinions outlined above.
    19. Re:Build-in function library by MemoryDragon · · Score: 3, Insightful

      Easy, make it compile java bytecode and you probably have the biggest library around on the planet. Why a language nowadays should provide its own libraries is beyond me. That is so 90s...

    20. Re:Build-in function library by larry+bagina · · Score: 2, Funny

      I guess you've never used PHP.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    21. Re:Build-in function library by Anonymous Coward · · Score: 0

      It's a Systems language. Not targeted at you.

      Furthermore, Go is a 2 years old language started by a couple of guys. It's young. And it's got enough libraries to get started with. High level libraries are for us to build.

      When java got out some years ago, the JDK didn't have much more. Yet it took off.

    22. Re:Build-in function library by dovgr · · Score: 1

      This claim is like the difference between Windows and Linux (and GNU and other animals). There are those that prefer a large set of suboptimal washed out solutions, one-size-fits all. Others prefer the freedom of being able to choose the components that fit them. By tying a library to a set of libraries you are in for the first choice. Personally I'm happy that I can choose a more optimal (and evolving) solution. The bundling also has the disadvantage that a new version (e.g. a bugfix) in a library is a new version of the whole system. No thanks.

    23. Re:Build-in function library by Anonymous Coward · · Score: 5, Insightful

      I've noticed a lot lately, especially here on Slashdot, that the most vocal opposition to degrees, education, certifications etc. come from people (not you in this case but it's relevant to this thread) who do not have this type of formal education in the first place.

      I wonder if this says more about the US (since Slashdot is US centric) education system, the people being educated or the people not being educated. No offense, but if you've never met a competent CS graduate, you're either working in some very strange bottom-of-the-barrel outfits or with some very strange people. The CS graduates I've worked with have universally been careful, methodical and not dickish in the slightest.

      Just about the only downside I've noticed is with fresh graduates who can be a little naive about business practices and real-world scenarios but they catch up far quicker than the "loner geek rebel" types whose best code at best qualify as clever but unstable and unscaleable hacks.

      I'm sensing a bit of projection from the uneducated crowd, tbh.

    24. Re:Build-in function library by mikael_j · · Score: 1

      While I mostly agree with your post I would like to point out that I've met a few CS graduates, especially from "famous" schools, who have been in the habit of treating everyone else, including people who graduated from the same school as they did (sometimes even with with a Master's degree compared to their own Bachelor's) as if they knew nothing at all. This, of course, can get a bit silly when it's obvious that the stuck up person in question has a fairly limited understanding of whatever subject is being discussed (as an example their understanding of the web may be entirely in the context of ASP.NET+IIS or they've never used another database server than MSSQL (and thus no other SQL dialect than T-SQL). Yes, I'm implying that a lot of those who fall into this category tend to know only MS software and solutions since that's the most common scenario that I've seen).

      The issue with this is of course that they tend to become "architecture astronauts" (as Joel Spolsky calls it) whenever they're trying to solve problems that the tools they know were never meant to solve, and this combined with the "well I've got a degree from $SCHOOL so I know more than you" attitude can cause some considerable friction.

      /Mikael

      --
      Greylisting is to SMTP as NAT is to IPv4
    25. Re:Build-in function library by thePowerOfGrayskull · · Score: 1

      Whenever Google announces something, you have to make the decision... jump on it immediately and get ahead of the curve, but risk wasting all that time if it doesn't take off? Or wait?

      That makes it sound like you're going to fall hopelessly behind "the curve" if you don't jump on a successful product.

      That woudl be a helluva frantic life to live. It's just technology in the end. There are thousands of new technological ideas, innovations, and products coming out every year. The choice you really need to make is this: a) figure out what you want to do, then look for the technology that best supports it... or b) focus on a couple of Big Names, learn the neat new technological toys they release, then begin searching desperately for something problem to solve with them.

      One of those two options nets you a solution to a problem at hand. The other nets you solutions in search of problems, with perhaps a bit more opportunity to play with fun toys along the way.

    26. Re:Build-in function library by Anonymous Coward · · Score: 0

      Point taken and there's an apparent cultural difference here.

      I was never taught any particular brand of software. The curriculum was focused mostly on the mathematics behind algorithm and datastructure design and, later, covered commonly used protocols in all layers. We universally used C, C++ and perl but never even touched any particular "vocational" training with Cisco routers or Sybase DBs.

      We were expected to pick that sort of thing up from the "elders" of whichever companies we started working for because, with a solid fundamental knowledge, implementation specific stuff comes more easily. It's an expensive way of going about things since you're doing all your training twice (one theoretical and one practical) but I think we're better off for it.

      I believe that has something to do with the culture of somewhat naive but humble graduates here.

    27. Re:Build-in function library by Anonymous Coward · · Score: 0

      Ninth grade dropouts make the best coders.

    28. Re:Build-in function library by coppro · · Score: 1

      A system language with run-time reflection is one of the worst ideas I've heard this year.

      And I've heard a pitch for a language where the compiler can be changed by a running program... retroactively.

    29. Re:Build-in function library by shaitand · · Score: 2, Insightful

      Well yes but not really. They built this for themselves and released it because they don't care. Google develops a lot of in-house server based internet stuff and they spend a lot of time waiting on compiles.

    30. Re:Build-in function library by jez9999 · · Score: 1

      And every Perl module I've pulled from CPAN has been well documented.

      What packages have you pulled in from CPAN? As much as I like Perl and as painful as this is to say, CPAN is a fucking abomination. There is basically zero quality control, anyone can put any module up they want and use any namespace. They don't have to offer ANY documentation and if they go AWOL and stop maintaining the module, it just stays there, festering.

    31. Re:Build-in function library by odourpreventer · · Score: 1

      > It's an expensive way of going about things since you're doing all your training twice I strongly disagree. It feels like you have to learn things more than once, because for each programming environment you will have to learn the *implementation* of said theories.

    32. Re:Build-in function library by Des+Herriott · · Score: 1

      There is basically zero quality control, anyone can put any module up they want and use any namespace. They don't have to offer ANY documentation

      Sure, but since you can check the namespace and browse the docs before you choose to install the module, is that such a problem? I admit the quality control is limited, but there is a review facility which is reasonably well-used -see http://cpanratings.perl.org/.

      if they go AWOL and stop maintaining the module, it just stays there, festering

      Just like any other open-source project then.

    33. Re:Build-in function library by nanospook · · Score: 1

      What $School did you go too?

      --
      Have you fscked your local propeller head today?
    34. Re:Build-in function library by Anonymous Coward · · Score: 0

      In other words, if you can't puke at the screen and call it code, you probably shouldn't be programming.

      No Thanks :-)

    35. Re:Build-in function library by arethuza · · Score: 2, Insightful

      Just like any other software project - not just open-source ones. Commercial software vendors end-of-life products all the time. At least with an open-source project you still have access to the source.

    36. Re:Build-in function library by WaywardGeek · · Score: 2, Insightful

      I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.

      Agreed. I don't see a case where Go would be useful to me, given the Java, C++, Python, Perl, PHP, and C that I currently use.

      My biggest rant about most of these new languages: garbage collection is useless! I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement. Worse, it takes away my most powerful speed optimization tool: careful memory layout for best cache hit rates. I can write simple graph traversal code that is 10X faster in carefully designed C/C++ than in any garbage collected language for large graphs.

      --
      Celebrate failure, and then learn from it - Nolan Bushnell
    37. Re:Build-in function library by dkf · · Score: 1

      Or, more likely, they just did the fun part of designing the language, and are leaving the hard part of creating libraries to somebody else.

      The easiest way is if there's already support for loading libraries (dynamically would be nice!) and calling functions defined in C. If there is, then there's huge numbers of libraries to leverage (not all of which are in C, of course; that's just the most common basic ABI by far). Wrapping them up into libs that feel native (or reimplementing if someone's feeling energetic) can be done piecemeal.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    38. Re:Build-in function library by daid303 · · Score: 1

      LUA is a pure C implementation that you can run on just about anything. With a C API to embed it in your own application. I cannot find anything like that in the GO documentation.

    39. Re:Build-in function library by dkf · · Score: 2, Interesting

      The easiest way is if there's already support for loading libraries (dynamically would be nice!) and calling functions defined in C. If there is, then there's huge numbers of libraries to leverage (not all of which are in C, of course; that's just the most common basic ABI by far). Wrapping them up into libs that feel native (or reimplementing if someone's feeling energetic) can be done piecemeal.

      Replying to myself. Meh...

      Of more concern is the fact that Go is a GCed language with a mostly implicit thread model. That means it is probably impossible to write libraries/modules in it that can be used from other languages (handling the integration of the threading and GC engines is... non-trivial). That means that the language designers probably think that they're going to be the most important and highest-level language in use in the application. Not very humble!

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    40. Re:Build-in function library by jez9999 · · Score: 1

      Yeah, but you can't pick it up and maintain it, thereby improving CPAN. You have to rename it and upload it as something else, leaving an orphaned, old, unmaintained module lying around for people to find.

    41. Re:Build-in function library by ardor · · Score: 5, Insightful

      I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement.

      Um, no. The whole point of a GC is that you don't have to explicitely deallocate something. RAII is a problems with GCs, but you didn't mention that. As for the cache hit thing, it sounds quite suspicious to me, more details please. Also, to get that last bit of performance, you have to go low-level, that is true. Note however that explicit memory management is unnecessary in 90% of a typical application's code.

      Now, since the ownership problem is passed over to the GC, things become possible that were previously hard to do. Try real closures for instance: C++0x is struggling with this, since they may extend the lifespan of a variable, which is bad if said variable was lying on the stack. Such problems simply go away with a GC. Note that C++0x rvalue references are in fact a solution to a problem caused by the explicit memory management in C++.

      There is a reason many people want an opt-in GC in C++0x..

      --
      This sig does not contain any SCO code.
    42. Re:Build-in function library by dkf · · Score: 1

      While I mostly agree with your post I would like to point out that I've met a few CS graduates, especially from "famous" schools, who have been in the habit of treating everyone else, including people who graduated from the same school as they did (sometimes even with with a Master's degree compared to their own Bachelor's) as if they knew nothing at all.

      Here's a hint: those people are commonly known as "Assholes".

      Having a bit of paper saying that you have indeed graduated does not make anyone a good person. It just makes them a person with a piece of paper. If the school is genuinely good, and the student was paying attention (hah!) then they'll know quite a lot about theory - that does help - but will need a lot more training in how to apply it. They should be able to pick up the practical parts rapidly; they damn well ought to have the conceptual framework to hang it off already. Whether they can actually do this... well, that's why they still start as noob developers, yes?

      I say this as someone with a CS degree from a famous school.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    43. Re:Build-in function library by dkf · · Score: 1

      Easy, make it compile java bytecode and you probably have the biggest library around on the planet. Why a language nowadays should provide its own libraries is beyond me. That is so 90s...

      You actually have a bigger library available if you can talk the C ABI (indeed, Java does this through JNI). But the general point - leverage someone else's set of libs instead of starting from scratch - is a very good one.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    44. Re:Build-in function library by Anonymous Coward · · Score: 0

      that's probably because "truly gifted coders with a CS degree" probably work in places you never know existed, for figures you never think possible.

    45. Re:Build-in function library by danieltdp · · Score: 3, Interesting

      From Go's FAQ

      There is a “foreign function interface” to allow safe calling of C-written libraries from Go code. We expect to use SWIG to extend this capability to C++ libraries. There is no safe way to call Go code from C or C++ yet.

      --
      -- dnl
    46. Re:Build-in function library by Anonymous Coward · · Score: 0

      I think the word you're searching for is "built-in" - not "build-in". There's a difference.

    47. Re:Build-in function library by grumbel · · Score: 2, Insightful

      Kind of. The problem however is that nobody else has written a low level system language in a long while and all the low level languages out there kind of suck when it comes to concurrency programming and network stuff. So Go is really doing something that no other language out there is doing and it seems to be doing what it does quite well.

    48. Re:Build-in function library by Viol8 · · Score: 2, Insightful

      Some of us prefer brevity and we don't or can't all use IDEs. If something like strcmp is too difficult for you to understand perhaps you should stick to VB.

    49. Re:Build-in function library by goose-incarnated · · Score: 3, Interesting

      I have to agree with a couple of your points, however. It's an unfortunate truth, but a heck of a lot of programmers do qualify as dicks. I've worked with my fair share of them over the years, and I have to say I've never met a truly gifted coder with a CS degree. I'm not saying they don't exist, but I'll be damned if I've found one yet. Oddly, out of the "real asshole" crowd, many of them had a CS degree in addition to sucking at their jobs. The best coders I've worked with never even went to college, didn't finish, or graduated with a degree completely unrelated to computer science or IT.

      My experiences are totally at odds with that - I've not yet found a truly gifted coder who doesn't have some degree - the best that I've worked with were the physics/maths graduates, the worst were the ones who had nothing but industry certification.

      --
      I'm a minority race. Save your vitriol for white people.
    50. Re:Build-in function library by Alex+Belits · · Score: 1

      kind of suck when it comes to concurrency programming and network stuff

      I can assure you that they are just fine for those purposes. Low-level languages (what actually means C because it's the only one) occasionally suck at being high-level languages.

      --
      Contrary to the popular belief, there indeed is no God.
    51. Re:Build-in function library by Anonymous Coward · · Score: 0

      this may be insightful, but dear god my eyes hurt after all the spelling and grammar errors here.

    52. Re:Build-in function library by hattig · · Score: 1

      Good luck with getting Perl more usable on Windows. I remember using ActiveState Perl back in the day...

      How would you say Padre compares with the Eclipse Perl Perspective? http://www.epic-ide.org/

      As for go, it looks interesting, but it's currently a language, not a platform. I can see that changing down the line as more people develop the necessary frameworks (I see some basic collections, basic xml, etc are done already). Hopefully people will take the best of breed in any given area and use that, instead of half-assed implementations (e.g., port JodaTime instead of Java's Calendar as a date library). I can see that go is trying to make things simple in the common use case, and it also appears to have nicely compact source code (esp. compared with Java and C#!).

    53. Re:Build-in function library by hattig · · Score: 1

      This makes sense. Jython makes very good use of this.

      I think a Java bytecode backend should be a rapid priority for the Go language programmers. I don't know how much of the Java runtime they can leverage to replace the minimal runtime they compile into the Go binaries at the moment though.

      Also, because it is Google, a Dalvik compiler would make sense (for Android). This would be very similar in many ways to the Java backend.

    54. Re:Build-in function library by Anonymous Coward · · Score: 0

      except that one of the people responsible was also responsible for the precursor to C, so doesn't need the recognition.

    55. Re:Build-in function library by ewg · · Score: 2, Interesting

      Which is the approach Scala and Clojure have taken: tight integration with the Java Virtual Machine. By definition this is the "layering" mode of software engineering Pike cites in the tech talk as a reason for starting over. Layering is easier to sell to management, at least outside technology companies.

      --
      org.slashdot.post.SignatureNotFoundException: ewg
    56. Re:Build-in function library by c00p3r · · Score: 1

      Hey, dude, have you ever compared CPAN and PEAR? And this word - 'Delphi'. http://freshmeat.net/ might give you some insights about usage of programming languages =)

    57. Re:Build-in function library by Vetruvet · · Score: 1

      I'll be very surprised if there isn't a Wiki by morning, and I'll be there's half a dozen or more Waves about it by now.

      There's already a wiki: http://en.wikipedia.org/wiki/Go_(programming_language) Provides hardly any info, but stil...

    58. Re:Build-in function library by Anonymous Coward · · Score: 0

      What's that noise? Oh, it's the sound of an ax grinding. What's this deep-seated problem you have with degrees? Perhaps you lack the ability to concentrate long enough to acheive one of your own.

    59. Re:Build-in function library by c00p3r · · Score: 1

      Nope. "Look! We made a C 2.0 - a programming language for Native Client" niche. Think about low-level (and much easier than C[++]) Javascript alternative.

    60. Re:Build-in function library by shic · · Score: 1

      Oddly, out of the "real asshole" crowd, many of them had a CS degree in addition to sucking at their jobs.

      Out of interest, how old are you, and at what level of seniority are you talking?

    61. Re:Build-in function library by WaywardGeek · · Score: 4, Interesting

      As for the cache hit thing, it sounds quite suspicious to me, more details please.

      BTW, I agree that > 90% of code doesn't need to run fast or memory efficiently. I am a fan of Python, but when I'm slinging around gigabytes of data, I use C. Very few programmers ever need this kind of efficiency. Anyway, check out this table half-way down. The "DataDraw" benchmark is still in C, but it uses carefully designed memory layout. The speed improvements are 100% due to cache hit rate improvements - 15X better than when using malloc for each object. Most slow memory-intensive programs waste most of their CPU time in L2 cache misses.

      You want all the fields that are accessed in inner loops to be together in memory in dense arrays, and the other stuff should be somewhere else. So, for binary tree traversal, you want left and right and maybe some key value in a small structure, and all the other bloat needs to be elsewhere. Ideally, you allocate these structures which are nearby in the tree also nearby in memory. That way, when you get an L2 cache miss, the extra data you load into the cache likely contains data that will soon be accessed in the inner loop.

      Garbage collectors typically don't bother allocating objects of the same type together. Careful management of memory can be a PITA, which is one reason I use the DataDraw tool for memory-intensive applications. It allows me to "cache together" fields, and puts wrappers around data access to hide the ugliness.

      --
      Celebrate failure, and then learn from it - Nolan Bushnell
    62. Re:Build-in function library by dkleinsc · · Score: 2, Interesting

      In fact, good accurate garbage collections could be considered the most important development in programming languages since OO (and some even think more important). For instance, without garbage collection, this will (eventually) destroy the universe (where Foo and Baz are some classes):
      return Foo(somearg).bar(someotherarg);

      Compare that to the non-GC'd version:
      foo = Foo(somearg);
      result = foo.bar(someotherarg);
      delete foo;
      return result;

      The second version is 4 times as long, but with no added benefit other than saving a bit of memory until the next GC run.

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    63. Re:Build-in function library by Raffaello · · Score: 0, Troll

      You don't need an IDE, just a decent editor that can do autocompletion. These sorts of editors have been widespread since the 1980s.

      A better reason for shorter names, and one I still heard seriously argued less than a decade ago, was the relatively narrow, 80 character screen width. Long names can eat this up fast, especially if your function bodies contain nested, indented blocks.

      However, we now live in an era where 80 character screens are unlikely to be a limit to working programmers, though, as I said, I've heard it argued that sticking to this 80 column limit allows multiple, side by side program text windows on a single monitor, and so should continue to be standard.

    64. Re:Build-in function library by Hurricane78 · · Score: 1

      Sorry, but you obviously chose to completely ignore PEAR and PECL. Which makes you nothing else than an ignorant troll.

      Yes, PHP's interpreter is a horrible piece of shit. (I had to work with it for 5 years!) BUT there is no language that is better for a real quick and dirty scripting to get you off the ground!!

      As they say: Every language has its purpose.
      I still use PHP to quickly try out new ideas. Throwaway code. And to, if needed, later develop real programs in a real language (Haskell in my case).
      It simply can't be done quicker in either Perl, Python, JavaScript, Lua, C, C++, Delphi, Java, OCaml or Haskell.
      Since I already know how to program properly, the ability to do nasty unclean stuff only comes to me as an advantage, not as a disadvantage.
      But I would never consider PHP or Perl for anything beyond a grown shell script or a small website logic. :)

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    65. Re:Build-in function library by Anonymous Coward · · Score: 0

      And that rant would mean something if CS == programming, which anyone who actually went to a university for CS would know is not true. Combined with the attitude of "if you can't write an app using $MY_FAVORITE_LANGUAGE, you probably shouldn't be programming", you're the one who comes off as the "real asshole".

    66. Re:Build-in function library by Anonymous Coward · · Score: 0

      Here's a simple one. How about the ABA problem with a concurrent linked list. GC takes care of it.

    67. Re:Build-in function library by Raffaello · · Score: 1

      and it's implicitly concurrent, which sidesteps a whole range of self-inflicted damage.

    68. Re:Build-in function library by WinterSolstice · · Score: 1

      Sorry, but you obviously chose to completely ignore PEAR and PECL. Which makes you nothing else than an ignorant troll.

      Yes, PHP's interpreter is a horrible piece of shit. (I had to work with it for 5 years!) BUT there is no language that is better for a real quick and dirty scripting to get you off the ground!!

      As they say: Every language has its purpose.
      I still use PHP to quickly try out new ideas. Throwaway code. And to, if needed, later develop real programs in a real language (Haskell in my case).
      It simply can't be done quicker in either Perl, Python, JavaScript, Lua, C, C++, Delphi, Java, OCaml or Haskell.
      Since I already know how to program properly, the ability to do nasty unclean stuff only comes to me as an advantage, not as a disadvantage.
      But I would never consider PHP or Perl for anything beyond a grown shell script or a small website logic. :)

      I mostly agree with this, though the 'speed' you refer to is probably due to your familiarity (unless you're strictly a web coder).
      I test probably 90% of my code concepts in Perl despite knowing PHP moderately well. I suspect this just has to do with time, since I have used Perl since the mid-90s and PHP only for a couple years (and for far fewer projects).

      So much of web code ends up being JS anyhow, so ASP/JSP/PHP all end up being a matter of preference. The smart money these days hides their page extensions to mask the language used anyhow and the rest can come down to using the right tool.

      What does this have to do with Go, though? I didn't see Go having any of these sorts of niches - it seems to be more like another what at C++.

      --
      An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.
    69. Re:Build-in function library by Anonymous Coward · · Score: 0

      Just to be pedantic, GC was around a long time before OO. And at least one of the languages that had GC also supported OO, but nobody had thought to use it yet.

    70. Re:Build-in function library by Anonymous Coward · · Score: 1, Informative

      wikipedia page != wiki

    71. Re:Build-in function library by augustw · · Score: 2, Informative

      I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.

      Since one of the three designers of Go is Ken Thompson (designer of C), I would doubt that.

    72. Re:Build-in function library by Panaflex · · Score: 1

      I don't think you can qualify it either way, gifted developers make it into their fields because they're passionate about it. However they got there is only a reflection of how good education is doing in terms of school and tracking people into professions they like.

      In the past, you saw gifted hackers from everywhere, but lately I have to agree that schools are doing a better job - and so I'm seeing more come with degrees from "good schools.

      That is all.

      --
      I said no... but I missed and it came out yes.
    73. Re:Build-in function library by hazah · · Score: 1

      C++ is not GC'd and the line "return Foo(somearg).bar(someotherarg);" works perfectly fine, with the added benefit of the compiler inserting the appropriate constructor and destructor calls as well as all the memory allocation house keeping. This doesn't necessarily mean excessive stack usage either, since there's nothing in that line of code that indicates how these objects are implemented.

    74. Re:Build-in function library by azav · · Score: 1

      Unclear. When you say "build-in" libraries do you mean "built in" libraries?

      --
      - Zav - Imagine a Beowulf cluster of insensitive clods...
    75. Re:Build-in function library by hazah · · Score: 1

      You make it sound like it's a deficiency with C. Many would disagree.

    76. Re:Build-in function library by cavemanf16 · · Score: 1

      Processing 1.0 fill your needs?

    77. Re:Build-in function library by Bill,+Shooter+of+Bul · · Score: 1

      My guess is that they didn't do that for a couple of reasons:

      1) Its a revolutionary language design ( at least in their opinion) which would suffer from not having all libraries written with its unique capabilities.

      2) JVM's can be cumbersome to use. (I've taken so called "Senior Java Developers" and had them stumbling around to try to compile, debug and run java programs from a command line).

      3) Its more fun to write your own (this project was probably someone's free hacking time), without any prior design constraints.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    78. Re:Build-in function library by friedo · · Score: 1

      Actually there is a procedure for taking over CPAN modules for which the original maintainer won't respond (or is dead, etc.) And if the original maintainer is responsive, but just no longer interested or too busy, they can add you as co-maintainer or transfer the distribution to you directly.

    79. Re:Build-in function library by Blakey+Rat · · Score: 1

      That's a terrible idea. They're going to end up with the PHP mish-mash. Dozens of functions that do the same thing, no organization, no standardized naming scheme-- it'll be PHP 4 all over again.

    80. Re:Build-in function library by MarkWatson · · Score: 1

      Actually, generational (or ephemeral) garbage collectors can often perform better at runtime than coding it yourself. I think this is because larger blocks of storage can be freed at one time for very short-lived objects.

    81. Re:Build-in function library by jekewa · · Score: 1

      One of the reasons I prefer Java and C/C++ over Delphi and C#, or Perl over PHP and the others is that they have an available selection of frameworks and libraries that can be added at my discretion, instead of compelling me to begin with the bloated collection of built-in junk that someone else has decided is best for me. Dozens or hundreds of ways to do most of the tasks we have to do, and not any one of them is the best in every situation, and frequently the one chosen to be included isn't the one that meets a need I may have at the time I need it.

      The flexibility is what's "fun" about a programming language, which is why we need overloading and reflection, which begs a system that has clean syntax.

      --
      End the FUD
    82. Re:Build-in function library by MikeBabcock · · Score: 1

      More importantly, Google has to write a lot of code that works in parallel across huge numbers of processors. A language that takes advantage of that situation and makes it easier for their engineers to write efficient parallelized code would be a huge boon.

      --
      - Michael T. Babcock (Yes, I blog)
    83. Re:Build-in function library by jekewa · · Score: 1

      I remember, way back when, when everyone had to make a programming language. Writing a compiler was part of almost any CSci coursework, and the syntax was up to the author. Sure, most of them ended up being clones of the first-pass language (the one you have to start writing your compiler in before it became self-compiling...not always a requirement), which was probably C, or whatever the author was comfortable with, but it gave an opportunity for all kinds of languages to sprout all over the place.

      --
      End the FUD
    84. Re:Build-in function library by feandil · · Score: 1

      so it's actually more limiting than helpful. I don't understand why people want garbage collection. it's a hindrance, you cannot allocate the memory the way you like, so there is no optimisation possible, in memory usage or in performance.

    85. Re:Build-in function library by MikeBabcock · · Score: 1

      To be fair, I'd go so far as to say that if you're writing a program and can't find it already 80% implemented in CPAN modules, you're truly ingenious.

      --
      - Michael T. Babcock (Yes, I blog)
    86. Re:Build-in function library by Anonymous Coward · · Score: 0

      And let's not forget the utterly dreadful naming standards used. So you get crappy "DOS" style abbreviated function names like "str_replace", "str_split" and "strcmp" instead of something meaningful like "StringReplace", "StringSplit" and "StringCompare".

      It's high time that programmers stop using crappy abbreviations for names in programming. We're not dealing with DOS systems with 8.3 filename limitations and there's no call for laziness.

      Function names have exactly NOTHING to do with DOS filenames. They were usually abbreviated because memory and disk space were tight, regardless of your OS.

    87. Re:Build-in function library by fulldecent · · Score: 1

      it is not embedded, and there are libraries.

      see the example web server in ~30 lines.

      --

      -- I was raised on the command line, bitch

    88. Re:Build-in function library by Skapare · · Score: 1

      Just because more programming is done at a higher level, that does not rule out the benefits of adding certain useful advantages to lower level programming. There are many cases where avoiding the bloat (and that's what it comes across as in many of these cases) of higher level language systems. I program in both higher level and lower level, and make language choices based on the specific needs. I've yet to evaluate the language Go, so I can't say if it really adds the benefits I could use at the lower level. But for programming at the higher level, I find the choices are plenty (even though more come along all the time), and I often focus on what NOT to bother using at that level. Anyway, the point is, just because you might need something at a high level, don't expect everything new coming along to specifically be trying to address your high level needs.

      --
      now we need to go OSS in diesel cars
    89. Re:Build-in function library by dkleinsc · · Score: 1

      Oh, right. put a "new " in front of both those and it will be a memory leak.

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    90. Re:Build-in function library by SanityInAnarchy · · Score: 0

      C is actually historically a "high-level language"; assembler is the real lowlevel language.

      But accepting C as a low-level language, it is "just fine" at doing concurrency in the same way that assembly language is "just fine" for doing application development.

      --
      Don't thank God, thank a doctor!
    91. Re:Build-in function library by sabernet · · Score: 1

      Different strokes for different folks. When your program attains a certain level of complexity, it becomes very hard to keep track of every single thing. Garbage collection helps with that. Your argument could be used to sell Asm over C. Asm gets you much closer to the metal allowing ridiculous amounts of optimization, but is it worth it considering the additional work involved?

    92. Re:Build-in function library by SanityInAnarchy · · Score: 1

      Please explain why it's a bad idea.

      Slashdot is making me wait, so I'm going to say: I'm guessing you're making a few assumptions, like that this makes things somehow less safe, or performs worth.

      And, for that matter, C supports run-time reflection, it just takes a bit of work.

      --
      Don't thank God, thank a doctor!
    93. Re:Build-in function library by stein.dagostini · · Score: 1

      Bad example. Because that is an example tough on the logic of people use donly to GC languages. Computers have 2 different memmories (on a proccess level memory concept) stack and heap. You do NOT need to put everything on heap! In fact 95% of EVERY object in a typical C++ code, specially all the temporaries will be at stack with ZERO chance of any overhead of malfunction. You can and you SHOULD usually write in C++ return Foo(somearg).bar(someotherarg). Because you are not LIMITED to heap objects.

    94. Re:Build-in function library by Anonymous Coward · · Score: 0

      Can't he do both. The only question is in which order.

    95. Re:Build-in function library by Al+Dimond · · Score: 4, Insightful

      Have you heard of TeX, the document formatting system? When you print onto 8.5x11 paper it leaves enormous margins by default. Do you know why? Because it's easier to read blocks of single-spaced text at around 60 characters per line than it is to read longer lines. The same applies to code.

      Meanwhile the culture around many languages encourages programmers never to split lines. At a former workplace where we used VB, one of my co-workers worked with the IDE maximized across two screens! I always kept my lines at least under 100 characters, but when people checked in code near stuff I'd written they sometimes would go through and join my lines together.

      At the same time, some of those really long lines are function calls where you don't always need to see all the arguments. Folding editors can collapse those into one line if you write them on multiple lines; it would be cool if there were anti-folding editors that could automatically break up long lines. It's similar for long formulas.

    96. Re:Build-in function library by Anonymous Coward · · Score: 0

      You lost me at "C# over C/C++". Then you double lost me at "PHP over Perl".

    97. Re:Build-in function library by Anonymous Coward · · Score: 0

      The problem with that is with the average CPAN module, the last 20% will often take more time to do than if you'd just written it from scratch.

    98. Re:Build-in function library by Anonymous Coward · · Score: 0

      I find your use of the term "uneducated" to be incorrect in this context, if you are willing to give any credence to his claim at all. You would of course have been less dickish to say "self-educated". I didn't finish high-school. In my job I now supervise people with degrees in agricultural engineering, computer science, and electrical engineering. I have done all of their jobs in the past. I may not be a degree holder, but I am very familiar with the systems I use. After 25 years in this field, I wouldn't consider myself uneducated. As you can imagine I don't put a lot of emphasis on education in my hiring practices.

    99. Re:Build-in function library by adonoman · · Score: 1

      , this will (eventually) destroy the universe (where Foo and Baz are some classes):

      return Foo(somearg).bar(someotherarg);

      In C++, you've just allocated a temporary Foo on the stack, called bar(someotherarg) on it, and returned that return value. As long as you returned by value and not reference, nothing bad is going to happen. When the function returns, a copy of result is made on the stack of the calling function, and the temporary Foo is cleaned up just fine (only, unlike the GC language, it's destructor is called upon leaving the function - meaning that if Foo holds onto some resource like a lock or DB connection, you aren't going to leak it like the GC version would, since you forgot to create it in a using{} block)

    100. Re:Build-in function library by jipn4 · · Score: 1

      I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.

      Given how hard it is to get language design right, we need a lot more people going into that niche.

      Otherwise, we continue to have crap like C and C++ succeed by default.

    101. Re:Build-in function library by Anonymous Coward · · Score: 0

      Uh, no. Anything C-style (which your syntax infers) will run that statement with no issue whatsoever. The object resulting from Foo will be created, the bar method will run, that value will be stored, the object's deconstructor will be called and then the stored value is returned.

    102. Re:Build-in function library by e2d2 · · Score: 1

      You hit the nail right on the head. I'm currently reading the book "Masterminds of Programming" (http://oreilly.com/catalog/9780596515171/) and this specific topic, concurrency, seems to be the biggest challenge out there according to the language creators they've interviewed. It's possible now to write code that runs across machines, but it's not so easy that it's pervasive in the industry. Maybe Languages like Go will help change that.

    103. Re:Build-in function library by cowdung · · Score: 2, Informative

      My biggest rant about most of these new languages: garbage collection is useless! I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement. Worse, it takes away my most powerful speed optimization tool: careful memory layout for best cache hit rates. I can write simple graph traversal code that is 10X faster in carefully designed C/C++ than in any garbage collected language for large graphs.

      Wow! Your obsolete 80s mentality is mind-boggling.

      GC is awesome.. it increases application throughput inmensely.. and removes the need for destructors (in most cases).

      For most server based applications, GC increases the time you do actual work and reduces the amount of time doing book keeping.

      But don't listen to me.. ignorance is bliss. Have a happy life in C++. The rest of the world has mostly evolved beyond that.

    104. Re:Build-in function library by adonoman · · Score: 1

      Which is why, in a non-GC language, you would never allocate a temporary like that on the heap. It's MUCH faster and safer just to allocate it on the stack, and let stack cleanup handle calling the destructor and freeing the memory.

    105. Re:Build-in function library by mypalmike · · Score: 1

      I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement.

      I don't know what you mean. In Java, for instance, you instantiate an object, pass it around, put it into a container or two, do stuff to it, etc. When you're done with it, you just stop using it (i.e. remove it from any accessible scope). When are you "forced to call a destructor as a function"?

      --
      There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
    106. Re:Build-in function library by jipn4 · · Score: 1

      Um, no. The whole point of a GC is that you don't have to explicitely deallocate something.

      GC has several functions. One of the most important ones is to make a language safe. A secondary one is to save some work in non-performance critical code. However, in performance critical code, you have to worry about memory management as much with a GC as without.

      There is a reason many people want an opt-in GC in C++0x.

      The primary problem with C++ is not its lack of GC, it's its lack of safety. That's not fixed by adding a GC.

    107. Re:Build-in function library by jipn4 · · Score: 1

      Too bad it's GPL rather than LGPL. Although I write a lot of FOSS, I'm not going to invest time in building on a library that only can be used for FOSS development.

      Just like GTK+ and other core libraries, in order to catch on, a library like this really has to be LGPL or GPL+linking.

    108. Re:Build-in function library by Pulse_Instance · · Score: 1

      The biggest reason I can think of to at least try out the new technology a little bit, is that it can help with your option a. That is knowing a little bit about the different technology options will allow you to make better decisions when you need to choose which technology will best solve your current problem.

      I do agree though that there is no reason to become an expert at every new technology for fear of dropping behind the curve.

    109. Re:Build-in function library by tb3 · · Score: 1

      I'm reading that book, too, after I finished "Coders At Work" by Peter Seibel. Ken Thompson is one of the coders interviewed in that book, so it's worth the read if you're interested in what he's working on at Google.

      --

      www.lucernesys.comHorizon: Calendar-based personal finance

    110. Re:Build-in function library by wytcld · · Score: 1

      The CS graduates I've worked with have universally been careful, methodical ....

      Yup. They make what should be a simple half-day project into two weeks of applying the careful methods they've learned while getting their degree. They are more than happy to describe the theoretical justifications of their plodding ways. Not that there's not a place for this. It fits quite well with large projects where everything should be maximally comprehensible to other programmers. But the overhead for small-scale stuff is amazing. And they have little capacity for reading existing code that's not built to the design patterns their particular professors taught them. So they end up trashing a lot of quite serviceable stuff to rebuild it so they can bring it within their narrow understanding.

      --
      "with their freedom lost all virtue lose" - Milton
    111. Re:Build-in function library by chip · · Score: 0

      // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.

    112. Re:Build-in function library by diablovision · · Score: 1

      GC has been around longer than OO.

      --
      120 characters isn't enough to explain it.
    113. Re:Build-in function library by lumpenprole · · Score: 1

      The only problem with this is that a huge amount of time web devs are working on servers they don't own and don't have install privileges to. That's why PHP wins.

      Sad but true.

      --
      Disclaimer: MINAA (Mummy! I'm Not An Animal!)
    114. Re:Build-in function library by adonoman · · Score: 1

      How do you release non-memory resources in Java?

      Statement stmt = conn.createStatement();
      try {
      stmt.executeUpdate( "..... " );
      } finally {
      stmt.close();
      }

      In C++ using RAII this would just be:

      scoped_ptr stmt(conn->createStatement());
      stmt->ExecuteUpdate("....");

      Not only is the memory guaranteed to be release, the non-memory resource is as well.

    115. Re:Build-in function library by Anonymous Coward · · Score: 0

      A-bloody-men. My colleague went through a phase of writing everything on one long line, including if { } else { } blocks, with no line breaks, arguing that it was easier if every statement was a single line.

      This was also the time he went through his CreateUserAccountAndThenSendEmailToNewUserUnlessToldOtherwise() method naming phase...

    116. Re:Build-in function library by palegray.net · · Score: 1

      You don't need administrative privileges to use most Perl modules; they can be installed under a normal user account or referenced from a website's existing directory structure.

    117. Re:Build-in function library by thetoadwarrior · · Score: 1

      While Java does allow you to send things to the GC yourself. I can only think of having to do that a handful of times because I was dealing with shit loads of data. If you find yourself having to clean up often then you're either writing bad code or just don't understand the concept of working with garbage collection.

    118. Re:Build-in function library by palegray.net · · Score: 1

      I've worked in places where programmers earn mid-six figure salaries. What was your point, again?

    119. Re:Build-in function library by palegray.net · · Score: 1

      If you knew anything at all about me, you'd already know I'm a huge fan of education and educators. You completely missed the point of my post.

    120. Re:Build-in function library by WaywardGeek · · Score: 1

      In fact, good accurate garbage collections could be considered the most important development in programming languages since OO (and some even think more important)

      Really? Who thinks GC is more important? GC is helpful only for simple classes with no relationships, like strings and vectors. For real objects in real databases, where all the real work is done, GC is useless. Here's the argument for why Java has GC. From the link:

      Garbage collection relieves you from the burden of freeing allocated memory

      Brilliant... instead of calling delete, I have to call a method that does the exact same thing as a destructor.

      Knowing when to explicitly free allocated memory can be very tricky.

      Seriously? You mean the line of code where I decide I want the object gone from memory isn't the right place to call the destructor? Somehow I'm better off not knowing whether or not an object in my database is still in use?

      --
      Celebrate failure, and then learn from it - Nolan Bushnell
    121. Re:Build-in function library by palegray.net · · Score: 1

      I'm 28, and I've been working in IT since 18. I've also had the privilege of working with military officers and some extremely talented employees of defense contracting firms on some pretty interesting projects, a couple of which I managed personally. At one point, I held joint responsibility for the ongoing operations of Bank of America's telephone banking system operations on the VRU side, working for the firm that developed the platform. My experiences have been diverse to say the least.

      Care to share your credentials?

    122. Re:Build-in function library by Anonymous Coward · · Score: 0

      Do you consider writing HTML "coding"? If so, then, sure I agree with everything you just said.

    123. Re:Build-in function library by WaywardGeek · · Score: 1

      GC is good for simple objects like strings and vectors that typically live on the stack. You never use new and delete with such objects, and instead treat them like integer values that go away when you leave scope. However, C++ handles these "value" objects without GC just fine.

      The other type of object is where you call new and delete because the objects represent things in your database, like employees or graphs. For these types of objects, GC buys you nothing at all.

      There's tons of room for improvement that's real, like automatically generating all my destructors for me, or analyzing my program and optimizing the memory layout for best cache performance. All GC does is turn an easy to find dangling pointer (segv in a debugger) into a hard to find memory leak.

      --
      Celebrate failure, and then learn from it - Nolan Bushnell
    124. Re:Build-in function library by baxissimo · · Score: 1

      Since one of the three designers of Go is Ken Thompson (designer of C), I would doubt that.

      According to Wikipedia C was designed by Dennis Ritchie. Ken Thompson worked on Unix and Plan 9.

    125. Re:Build-in function library by Hercynium · · Score: 1

      Just FYI...

      One of the goals of Parrot is to give any language running on it the capability of accessing functionality in libraries written in any other language. For example, a program written in Python could use CPAN modules written in Perl and libraries written in Lisp, presumably keeping a "native" python interface!

      Now, as far as I'm concerned, such a thing is practically magic, but I do recognize that it has been done before, and the Parrot hackers are some very smart folks.

      --
      I'm done with sigs. Sigs are lame.
    126. Re:Build-in function library by ukyoCE · · Score: 1

      In Perl you have a lot more control over what libraries you pull in and how you use them

      The flip side is that you have to pull things in to use them, and you often have several 3rd party modules with separate versioning from the core language. This is added complexity that CAN carry some benefits, but as with any complexity, carries a lot of headaches too.

      I've seen code deployed on a system with the same Perl version as the test system. A CPAN module for some ridiculously basic thing was on a different version on the production system, and had completely changed the functions and parameters in the update.

      Although having more built-in adds complexity in other ways - like adding security vulnerabilities in features your application may not even use.

    127. Re:Build-in function library by skeeto · · Score: 1

      I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement.

      You're doing it wrong. (The GC does all that for you.) The only reason you would write a destructor is when the object is tied to an external resource that the GC doesn't manage, and you still wouldn't call the destructor directly.

      Worse, it takes away my most powerful speed optimization tool: careful memory layout for best cache hit rates.

      "The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet." Find the bottlenecks later and rewrite them in C or something low level.

      Garbage collection (or its cousin, reference counting) is what turns a 5 hour programming task into a 1 hour programming task.

    128. Re:Build-in function library by HiThere · · Score: 1

      I think the real reason is that every time you add a layer of indirection, you slow things down. They are trying for a fast language.

      I haven't decided whether it would suit my needs, but it's certainly quite interesting. I haven't yet subscribed to their mailing list, but the link to do so is still open in a window. And I'm still reading through a manual.

      I find this language extremely interesting, largely because of it's focus around multi-processor systems, but also because of it's focus on speed. I'm having a bit of trouble with their language, and can't decide just how difficult it would be to do precisely what I need...but it's *very* interesting.

      Of course, now that it's been announced, the question is what will happen to it. If it's just going to lie there and estivate, then I'd be better off picking something else. If it's going to have lots of unfocused development, I'd also be better off avoiding it. If somebody steps up and becomes BFDL or equivalent, then it could really go places.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    129. Re:Build-in function library by BasilBrush · · Score: 1

      And he also created B, the predecessor to C. So whilst not right on the detail, the basic point the GP made is correct. This isn't the work of people who wanted to create a programming language for the sake of it, but rather the work of some programming gurus who know rather better than the average slashdot denizen what is needed for a next generation systems programming language.

    130. Re:Build-in function library by lewiscr · · Score: 1

      I come from both camps. I was self-educated for years before university, then got my CmpEng degree. I've been a part of several startups where the only goal is to ship it and damn the maintainability. Those companies (the ones that actually ship a product) eventually grow and need to bring on new/more engineers. At that point, maintainability starts to matter. You've got some income coming in, so missing the next release date won't put you out of business anymore.

      There is a curve to it. There's no sense in writing version 1.0 "well". No matter how you write it, you don't really understand the problem yet. It's not until it's done and you start to extend the code that you realize how badly it was designed. It doesn't matter how much effort you put into architecting it up front, you'll always over-generify parts that didn't need it, and tightly couple parts that need to be looser. You might as well just start hacking.

      I'm in the "version 2.0" phase of a start-up now. We've got some cash coming in, we've got a little more wiggle room in the timeline. And we're got more people. I can read all the old code, but damn, some of it is not easy. I've found (experience talking here) that when fixing one bug creates 2 new bugs (or recreates a previously fixed bug), it's time to refactor/rewrite the code to make it more maintainable. I might not refactor/rewrite today, but it still needs to be done. It doesn't matter who's code it is, or how it's architected. Several of my hardest to track down bugs were due to the too-flexible architecture I designed. Simplifying that architecture just removed the bugs.

    131. Re:Build-in function library by BasilBrush · · Score: 1

      Cocoa Bindings is made possible by run-time reflection. If you've never experienced the amount of glue code that is rendered obsolete by Cocoa Bindings, you've never lived.

    132. Re:Build-in function library by kestasjk · · Score: 1

      Zend framework, pear, namespaces. PHP has grown as the net has grown.

      --
      // MD_Update(&m,buf,j);
    133. Re:Build-in function library by lennier · · Score: 1

      "good accurate garbage collections could be considered the most important development in programming languages since OO"

      "Since"? Don't you mean "before"? Lisp and GC was around long before OO.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    134. Re:Build-in function library by BasilBrush · · Score: 1

      GCs are a matter of taste. But anyone that would argue that unbounded pointers are a benefit hasn't a frigging clue about common sources of bugs and security vulnerabilities. They should be drummed out of the profession immediately.

    135. Re:Build-in function library by Thuktun · · Score: 1

      Garbage collectors typically don't bother allocating objects of the same type together.

      Probably because garbage collectors don't allocate things, they collect the garbage that's no longer being used.

    136. Re:Build-in function library by Anonymous Coward · · Score: 0

      C++ has not suceeded unless you consider it's success being that it did indeed "get a lot more people into the language design niche". Sometimes (most times?) you need a bad example of something to spawn a better thing, and C++ fills that role beautifully. While C++ pretty much sucks, it's still better than anything else available (yes, including the purported "better C++", D).

    137. Re:Build-in function library by x2A · · Score: 1

      Or, that it's a different kind of language to C and therefore works in a different kind of way, eg, communication channels rather than function/call/return. After all, if the language is meant to be easy for creating highly concurrent applications, dragging in a load of "old style" libraries really isn't going to help... all of a suddent it's not going to know about what's going on on other cpu/cores.

      --
      The revolution will not be televised... but it will have a page on Wikipedia
    138. Re:Build-in function library by x2A · · Score: 1

      CPAN functionality is available from your perl code (you can issue commands to install/update modules etc without having to start the interactive CPAN shell)

      http://search.cpan.org/~andk/CPAN-1.9402/lib/CPAN.pm

      --
      The revolution will not be televised... but it will have a page on Wikipedia
    139. Re:Build-in function library by Anonymous Coward · · Score: 0

      Alternatively, it's a crutch for morons that can't handle what should be a trivial task - memory allocation. If you can't get that right you've got problems a GC won't fix.

    140. Re:Build-in function library by Bill,+Shooter+of+Bul · · Score: 1

      I would consider that to be covered in my reason #1, but yes I agree that is a legitimate concern. I'm also looking at it. It looks reasonable enough, until you try parsing the go routines and synchronization aspects.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    141. Re:Build-in function library by thePowerOfGrayskull · · Score: 1

      True, and the "fun factor" isn't to be underestimated -- it's definitely enjoyable to learn new stuff. It's just the attitude of "must learn because of who made it" that rubs me the wrong way.

    142. Re:Build-in function library by Anonymous Coward · · Score: 0

      i know!

      it's like most of the people dissing drunk driving have never driven drunk!

    143. Re:Build-in function library by jipn4 · · Score: 1

      Easy, make it compile java bytecode and you probably have the biggest library around on the planet

      Yes, and it's a library with Java semantics and Java's built-in inefficiencies. And while there are a lot of them, many of them do the same thing (e.g. XML-related stuff), while there are gaping holes in others.

      The crappy Java libraries are a big reason for me for not using Java in the first place anymore.

      No, any modern language needs easy ways of binding to C libraries. C++ would be nice too. Java? Irrelevant.

    144. Re:Build-in function library by jipn4 · · Score: 1

      C++ has not suceeded

      Are you kidding? On Ohloh, C, C++, and Java are even. On Tiobe, it's basically even with PHP, after C and Java.

      While C++ pretty much sucks, it's still better than anything else available

      Depends on your meaning of "available". There have been many good general-purpose programming languages developed, many far better than C++. But they haven't caught on, because C++ is so hostile to interoperating with other languages.

    145. Re:Build-in function library by jipn4 · · Score: 1

      Actually, neither of us is right.

      It's actually released under LGPL. I just misread it on the web page http://datadraw.sourceforge.net/

      DataDraw is released under the GNU Library General Public License, Version 2. It costs you nothing to use, and does not restrict your application in any way. Only the DataDraw program itself is covered by the license.

    146. Re:Build-in function library by Anonymous Coward · · Score: 0

      Get off your high horse. It is ridiculously easy for people with knowledge and experience (as opposed to your, ahem, education) to get a great paying job in the field. Especially in today's economy where grads have major debt to pay off and the tinkerers don't. From one AC to another, come off it. Yes there are very competent CS grads. And if they'd applied themselves without the 'rents footing the bill, maybe they'd have got that first CS job without being tens of thousands of dollars in debt. Yes, a degree acts as a filter. All that does is pacify a lazy hiring manager who chooses not to engage brain.

      To me, you sound like you're jealous because someone _without_ a degree is making more than you are in your chosen field.

      Or is that just gross generalization? You know, the same thing you are doing. Go away.

    147. Re:Build-in function library by Anonymous Coward · · Score: 0

      C is actually historically a "high-level language"; assembler is the real lowlevel language.

      Hmmmm...its designers evidently don't agree. From the Introduction of K&R:

      "C is a relatively ``low-level'' language. This characterization is not pejorative; it simply means that C deals with the same sort of objects that most computers do, namely characters, numbers, and addresses."

    148. Re:Build-in function library by shutdown+-p+now · · Score: 1

      My biggest rant about most of these new languages: garbage collection is useless! I still have to write destructors that clean up all the pointers to an object

      Wait. Are you saying that you're writing "destructors" that are simply a bunch of assignments like:

      this.foo = null;
      this.bar = null;
      this.baz = null;

      and you seriously believe that this is somehow required, or even beneficial, in a GC-enabled runtime environment?

    149. Re:Build-in function library by shutdown+-p+now · · Score: 1

      Frankly, this doesn't really help all that much. C FFI is the minimal common standard which any new language implementation has to support in some way in order to even be considered. However, there are still plenty of exotic languages out there with C FFI, but with a lack of libraries.

      The problem is that you have to spend time wrapping those C calls. You can do a direct one-to-one wrapper, which saves you time - but then coding against it is pretty much like coding in C, so you don't derive much benefit from a better language. Or you can wrap an API using idioms common for the language you're wrapping for, but this, more often than not, means creating a whole different new API, and dealing with "impedance mismatch" between expectations set by the language - e.g. it could be "safe lock-free threading" - and by the API you're wrapping. This is typically quite hard and time consuming, and doesn't happen all that often, especially for exotic languages with a tiny initial user base.

    150. Re:Build-in function library by shutdown+-p+now · · Score: 1

      I'm fully self-learned, and do not hold any degree (I do have a bunch of MS certs though, these are mostly there for HR to match against their requirement list to get to the interview). I do not hold modern education or certification to a high degree, either.

      I do not, however, consider myself a "loner geek rebel" type, and I do emphasize code readability and maintainability over clever tricks (which I do know aplenty, I just know when it's best not to use them... which is virtually any time while at work). This, as much as anything else, is also a learned skill, and it's not really something they teach you in the uni. Working with a good project manager (I know, I know... but yes, they do exist) helps understand such things, though.

    151. Re:Build-in function library by SanityInAnarchy · · Score: 1

      Interesting, because its major selling point was that, especially as system languages go, it's relatively high-level and portable.

      But you've got a source and I don't, so AC or not, I'll assume you're right.

      --
      Don't thank God, thank a doctor!
    152. Re:Build-in function library by shutdown+-p+now · · Score: 2, Informative

      Easy, make it compile java bytecode and you probably have the biggest library around on the planet. Why a language nowadays should provide its own libraries is beyond me.

      Compiling for JVM has its disadvantages, as it's a rather limiting VM with very tight sandbox. You don't get tail calls, for example, which throws a huge chunk of FP techniques out of the window right away. Or, say, re-invocable continuations (call/cc) - you can do that, but you have to effectively roll out your own heap-based locals/arguments stack for that, which hits performance hard. Etc.

      CLR is much more powerful in that regard, because it has more features even inside the sandbox - tail calls, value types, stack-based typesafe varargs and byref argument passing - but also lets you ditch the sandbox entirely, and work with raw data and function pointers if need be. Its feature set is large enough to support a fully conformant ISO C++ implementation in it. But then, of course, you run into the problem with implementations - .NET is fast but non-portable, and Mono is portable but slow.

    153. Re:Build-in function library by tibman · · Score: 1

      Those are commands, symbols for something. They don't need to be descriptive. You have to memorize what it is, autocomplete can't know what your intentions are. Really, it's faster to just type the command than scroll through autocomplete options.

      Gah, sorry, i'm frustrated with autocompleters. Take someone off their VC++ and they can't write a basic Cpp program. They don't remember the members/properties of the class they just wrote 5 minutes ago. They type 'Object.' *pause* "no autocomplete? How am i supposed to work under these conditions?!"

      Autocomplete is rotting programmer's brains!

      --
      http://soylentnews.org/~tibman
    154. Re:Build-in function library by chrome · · Score: 1

      Actually it has some decent libraries already, at launch. See http://golang.org/pkg/

      I wrote a multithreaded telnet talker without having to care about threads or mutexes or shared memory access or select() or poll() or whatnot. Some channels and a few goroutines, and it all works really, really nicely.

      THe syntax is a little weird, sure, but after a day of coding in it, its fine. You get used to it, and I find it easier to pick up than say, haskell.

    155. Re:Build-in function library by MemoryDragon · · Score: 1

      2) JVM's can be cumbersome to use. (I've taken so called "Senior Java Developers" and had them stumbling around to try to compile, debug and run java programs from a command line).

      Actually that is not really true, but many java developers dont use the command line at all nowadays. I personally revert to maven normally but the normal circumstances are that the devs use Eclipse and thats it.

      It is way less that they are cumbersome to use, compared to gcc and make/automake they are a breeze to use and mavens auto dependency resolution adds apt on top of that, but the main issue simply is that most java devs are not even slightly confrontanted with the command line and how to use javac which build systems to apply etc...

    156. Re:Build-in function library by Waccoon · · Score: 1

      I write distributable code for shared servers. Fun stuff. It's getting less fun now that much of the new PHP code is being put into PEAR modules, which must be installed on the server by a sysadmin. Yes, I know "serious" programmers have their own server, but I like making fun little things that ordinary people, primarily artists, can put on a cheap, shared server.

      I pray the PHP team doesn't make GDLib an optional module. GDLib may suck, but it keeps me from having to write an abstraction layer to do a direct system call for ImageMagik, which may not even be available, even on Linux hosts. Sometimes, it's nice to have a monolithic platform you can strip down, rather than a minimal platform you can build up.

    157. Re:Build-in function library by the_digitalmouse · · Score: 0

      ...PHP doesn't even come close in this regard

      ah so PEAR doesn't count? http://pear.php.net/

      --
      http://about.me/jimm.pratt
    158. Re:Build-in function library by Misagon · · Score: 1

      The whole point of a GC is that you don't have to explicitely deallocate something.

      The fallacy with that argument in this context is that in many times you want to manage other resources than just pointers and memory. For instance: database connections, network connections, file handles, user interface objects (windows, widgets etc.), and so on.
      To destroy an object which owns such an object, you still need an extra method call to clean it up, before the object is left as garbage.

      --
      "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
    159. Re:Build-in function library by Anonymous Coward · · Score: 0

      you mean like this http://golang.org/pkg ? Maybe not hundreds of libraries in there but surely a lot for a language that just got released.

    160. Re:Build-in function library by Bill,+Shooter+of+Bul · · Score: 1

      Well, the thing with any finished output of gcc is that its dead simple to run from the command line. Maybe I'm a bit old school, But I believe in knowing things form top to bottom. Everyone should have the experience of having written some language, some parser, some assembler, designed some basic calculating circuits. Or at least know how to find out how to do those things after a bit of googling.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    161. Re:Build-in function library by Anonymous Coward · · Score: 0

      Hear, hear. There are things a well-trained, well-educated computer scientist can do that no top-notch mere programmer could hope to understand without the same experience.

    162. Re:Build-in function library by WaywardGeek · · Score: 1

      Thanks for the ABA example. It made very interesting reading. I agree that GC is a good solution to this difficult problem. Do you feel there are any more common problems programmers run across where GC is also helpful vs the C++ mechanisms? I can't think of any.

      When I code, I use only two kinds of objects. "Value" objects typically live on the stack or as members of objects. These are things like strings and vectors. C++ deals with value objects more efficiently than GC. The other kind of object I call "database" objects. They live on the heap, and typically are involved in several relationships with other objects, like lists or hash tables. They are created with new statements, and freed with delete. GC does not help me here, since to remove an object from the database, I still need to call a method to clean up it's relationships. This method is nearly identical to a C++ destructor. In C++, when I have bugs in destructors, I get segvs due to dangling pointers, and usually I the debugger helps me find the problem quickly. In Java, memory just starts filling up. I'm not convinced one or the other is better.

      Is there any major hole in this analysis?

      Mostly I care because of efficiency, which of course is less of a problem for most applications over time. However, no GC I've seen comes close to the cache efficiency I get for most of my code. IMO, new languages should try to improve cache hit rates with clever memory organization. This is not possible in C++ because the memory layout is visible to the programmer. However, Java is so close...

      Here's what I would do in Java to make it the fastest language in the world for memory intensive applications:

      Each inner loop would be analyzed to determine what members where being accessed of what classes. I'd create a separate GC heap for each such set of members, and the other members of an class would live in a different heap. Rather than using 64-bit pointers, I'd use 32-bit indexes into these heaps to access data. That way, the same index can be used regardless of which heap contains a member - the organization of an object's heaps would all be identical. This would save a ton of memory, due to 32-bit indexes. It dramatically speeds up code due to cache performance gains. It's compatible with GC, though why the heck I want GC built-in to a language, I can't figure out. However, it does break casting a derived class to a base class. To access data, code has to know exactly the class type. This can also be dealt with, in various ways.

      Regardless of whether a language has GC, I'd also automatically create destructors for the user. This feature has been in relational databases for years, and I also use it in DataDraw-based C code. It rocks. It nearly eliminates the memory leaks and dangling pointers that are so hard to debug. It's way better than just adding GC, IMO.

      --
      Celebrate failure, and then learn from it - Nolan Bushnell
    163. Re:Build-in function library by ardor · · Score: 1

      Then you want to return an instance of a fairly complex class, and this nice line does a deep copy. Not good. 95%+ of all copies in a typical program are shallow, not deep.

      Solutions:
      - Allocate on the heap, which introduces smart pointers, or requirements to the coder to deallocate the result manually later
      - rvalue references; not here yet

      Note that popular patterns, especially the factory pattern, need to address this issue.

      The stackheap issue is a real pain if you want to automate object deletion, because if you then add an object allocated on the stack to such a system, and it then tries to delete said object, you have a nice segmentation fault. The only other option is to stricly require for the objects to be allocated in the heap.

      --
      This sig does not contain any SCO code.
    164. Re:Build-in function library by ardor · · Score: 1

      The primary problems with C++ are its hideous syntax, C legacy, and severe lack of standard library components. A C++ syntax with no C compatibility would be useful. To interface with C, reuse the extern "C" {} blocks.

      --
      This sig does not contain any SCO code.
    165. Re:Build-in function library by Haeleth · · Score: 1

      The best coders I've worked with never even went to college, didn't finish, or graduated with a degree completely unrelated to computer science or IT.

      My experiences are totally at odds with that - I've not yet found a truly gifted coder who doesn't have some degree - the best that I've worked with were the physics/maths graduates

      Allow me to paraphrase your post: "I completely disagree. I completely agree."

    166. Re:Build-in function library by bill_mcgonigle · · Score: 1

      The problem with that is with the average CPAN module, the last 20% will often take more time to do than if you'd just written it from scratch.

      Yeah, so ... upload it to CPAN, you freeloader.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    167. Re:Build-in function library by bill_mcgonigle · · Score: 1

      and can't find it already 80% implemented in CPAN modules,

      in at least three different ways, no less! Plus ThingToDo::Lite.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    168. Re:Build-in function library by DaVince21 · · Score: 1

      If there are two very different ways to do something, and there are groups of people who prefer one over the other, having this kind of fragmentation becomes sort of unavoidable.

      --
      I am not devoid of humor.
    169. Re:Build-in function library by mahadiga · · Score: 1

      JVM is CPU independent.
      CLR is LANGUAGE independent.

      --
      I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
    170. Re:Build-in function library by shutdown+-p+now · · Score: 1

      JVM is CPU independent.
      CLR is LANGUAGE independent.

      It may come as a surprise, but JVM is also "language independent" (whatever the hell that even means for a bytecode VM!) - ever heard of Scala, Clojure, Jython, JRuby, SISC, Armed Bear LISP?

      CLR is actually a specification, with numerous implementations, but the latter are also CPU independent (again, a surprise for a bytecode loading runtime, eh?) - .NET runs on x86/x64/IA64, a port exists on XBox 360 (for XNA) that runs on PowerPC, and then there's Mono which covers quite a bunch - Alpha, ARM, MIPS, SPARC.

      Or did you think that raw pointers are not platform and architecture independent? C programmers would be very surprised to hear that.

    171. Re:Build-in function library by stein.dagostini · · Score: 1

      There is no need to ANY copy to implement that on a well made compile. Move stack pointer (faster and cleaner than a NEW), execute constructor code (equaly necessary on both cases), call the method bar using that stack address as this pointer and with parameter someotherarg. The copy could arise if you return as COPY form the bar method something whose constructor is not trivial and have side effects. Returning anything complex by copy is by itself a bad practice in C++. Do not write code that needs to return anything complex by copy. That is why I said, C++ suck when you use the WRONG mentality alongside it. If you think and use it as it was supposed to be used... no issues .

    172. Re:Build-in function library by hazah · · Score: 1

      That is simply not true. Flexible use of pointers allows for very advanced in scope libraries. I'm arguing that the restriction should not come from the language, but from discipline. Application code should never use a raw pointer (other than converting a const char* literal to an std::string). We didn't stop building bridges when someone fell off. We put guard rails and relied on people's common sense. This never deterred a determined jumper.

    173. Re:Build-in function library by hazah · · Score: 1

      For the life of me I can't understand why you'd *want* to do that. Just to prove a point? You're deliberately pushing a round peg into a square hole here.

    174. Re:Build-in function library by ardor · · Score: 1

      It is in fact this mentality I'm arguing against. Again, if 95%+ of all copies in programs are shallow, why have deep copies as default?

      If headers are used in 99,99999% of all cases as module interfaces, why don't we have proper modules?

      As for your copy solution: this is called return value optimization, and depends on the compiler, which is really bad. As mentioned before, rvalue references exist for getting rid of unnecessary deep copies.

      --
      This sig does not contain any SCO code.
    175. Re:Build-in function library by jgrahn · · Score: 1

      The primary problems with C++ are its hideous syntax, C legacy, and severe lack of standard library components.

      That's an ironic statement, since the C legacy is what's giving C++ its vast library. If there's a C library for something, there's immediately also a C++ library.

      (OK, it's not a *standard* library, and you probably want to wrap it lightly to be safer ... but personally I like it when the language doesn't shove things down my throat. Not every library designer has the same good taste as the people who do Python's library.)

    176. Re:Build-in function library by BasilBrush · · Score: 1

      To follow your analogy, references (together with a GC) and bounds checked arrays ARE the guard rails. It doesn't mean you'll write bug-free and vulnerability free code. But it'll save a huge category of them.
      Discipline isn't working out to well in the world of C and C++ programming.

    177. Re:Build-in function library by hazah · · Score: 1

      The problem is that it is against the philosophy of the language. That being "Zero overhead: If you don't use it, you don't pay for it". If that was not in place, the language would not be in use today. The C programmers were the ones to pick it up, and they wouldn't have had it not been for this strict philosophy.

    178. Re:Build-in function library by BasilBrush · · Score: 1

      Typical computers are maybe 1000 times as fast and have maybe 30,000 times as much memory as when C was created. Maybe more. And software had multiplied in size too. So the balance of priorities has changed. Now bugs and vulnerabilities have a far higher cost than using a few extra bytes and a few extra cycles in order to check references and array bounds. C was a great language for it's day. But it's certainly time for a new a better systems language with contemporary priorities to replace it.

    179. Re:Build-in function library by MemoryDragon · · Score: 1

      So what are the holes, sure Javas domain is mostly server side computing and the libraries reflect that, but the only hole I see so far is scientific computing the rest is pretty much complete.
      Either within the RT itself or outside of it in many of the opensource projects from apache codehouse and java.net.

    180. Re:Build-in function library by shic · · Score: 1

      Care to share your credentials?

      I'm 34 - and have also worked in software my entire life. I've a CS degree and I make regular professional use of material I learned.

      I consider myself lucky never to have worked in the military, and I've managed to avoid working for banks so far, too. I prefer not to think of what I do as IT, either - that conjures visions of installing Microsoft products and fixing printers.... there's little need for an academic qualification in that field.

      I'm amused that you assumed I was criticising your standing - rather than asking about the seniority of the qualified people to which you purjoratively referred. While I've no evidence to suggest that qualified people are more competent or pleasant, I've none to the contrary either. I have encountered circumstances where over-qualified people feel undervalued - and wonder if this might explain. My suspicion, now, is that, possibly subconsciously, you're anxious about your own credentials - and this colours your views on the 'educated' demographic.

      I can only wish you all the best, and comment that - in my experience - acquiring a degree does not make someone less affable, competent or capable than they otherwise were.

    181. Re:Build-in function library by hazah · · Score: 1

      This isn't at all contrary to the zero overhead philosophy. You can get what you're talking about, and it does not have to be part of the language. You're talking about run-time routines. Those can be injected quite easily using that very same language (C++).

    182. Re:Build-in function library by BasilBrush · · Score: 1

      Here we go. Classic C type error in today's news. The kind of bug that's created thousands of times a day in C. In C, the compiler doesn't detect any difference between a signed int and an unsigned int. So you get bugs that don't appear during testing, but appear later when the user has been running the software for some time. Ouch.

      http://it.slashdot.org/article.pl?sid=09/11/18/1943209

      Go treats signed and unsigned numerics as different types. You can convert one to the other for cases when you need to do that and doing so makes you aware you are doing it. But without an explicit conversion, the compiler will give an error.

      Run time cost of type checking is zero. So your "zero overhead" excuse doesn't work. It's just a classic example of C not bothering to check. The run time cost of an explicit conversion from unsigned int to int or vice versa is zero in Go. Just as a cast is in C.

      Also this is the kind of thing that you can't fix in C. Because that would break so much existing code. It requires a new language.

      Just an example of one of the many improvements of Go over C. Computer engineers have had 37 years to learn what's wrong with C, so it's hardly surprising they can make something better now.

    183. Re:Build-in function library by hazah · · Score: 1

      What you've described has little to do with the "zero overhead excuse" that I had made for _C++_ (not C). You're describing decisions made on the computational model that is meant to be an abstraction over assembly. The compiler isn't checking this for C because of the mapping these constructs have to the hardware. Registers, in of themselves, have no sign. The meaning of a sign bit is determined by the operations applied. The flexibility allows one to use C (and C++) to generate the proper assembly instructions of their choice by carefully controlling the operations applied.

      That said, in C++ the use of the unsigned variants should be limited in the first place, and isolated to libraries, just like pointers. An exception being when you're dealing with strictly binary data, and all you are concerned with are bit patterns. In that case, use only unsigned and refrain from doing any unrelated to binary math operations.

      Not only will you help keep your concerns separate, you will also shoot yourself in the foot less. On top of that you won't cripple the expressive power of the language, making it a lesser tool for everyone.

  2. Sponsored by Inspector Gadget by Yvan256 · · Score: 5, Funny

    Go Go Google Language!

    1. Re:Sponsored by Inspector Gadget by el_tedward · · Score: 0

      Don't you mean, "Go Go Go Google Language!"

    2. Re:Sponsored by Inspector Gadget by CarpetShark · · Score: 1

      $ go
      No
      $

    3. Re:Sponsored by Inspector Gadget by Anonymous Coward · · Score: 0

      *Guitar riff* dun DUN dun dun dun.. dun DUN dun dun dun..

      *Cue background images of Google developers doing random gymnastics moves and changing into Google colored fighting suits*

    4. Re:Sponsored by Inspector Gadget by EspressoFreak · · Score: 1

      co-sponsored with the power rangers...

    5. Re:Sponsored by Inspector Gadget by Anonymous Coward · · Score: 0

      You know what's funny? Thay you have created two goroutines or whatever.
      This language should be awarded the most retarded language of the year award.

    6. Re:Sponsored by Inspector Gadget by protonics · · Score: 1

      Alt Title: Sponsored by Power Rangers

    7. Re:Sponsored by Inspector Gadget by evil_aar0n · · Score: 1

      Should it be "Go Google Go Language"?

      --
      Truth, Justice. Or the American Way.
  3. I suppose this is Windows-only once again... by Yvan256 · · Score: 4, Funny

    Go compilers support two operating systems (Linux, Mac OS X) and three instruction sets.

    Can somebody call hell to see if they can host the next Winter Olympics?

    1. Re:I suppose this is Windows-only once again... by TejWC · · Score: 3, Insightful

      I think it supports Linux and MacOS X only because the three main developers (Ken Thompson, Rob Pike, Robert Griesemer) seem to only have those two OSs between the three of them. I know Rob Pike is a Mac user and Ken Thompson loves Unix; I am guessing Robert Griesemer likes Unix as well.
      Its hard to support an OS when its not your primary computing platform.

    2. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Plus google doesn't use Windows internally -- all their desktops run Linux

    3. Re:I suppose this is Windows-only once again... by abdulla · · Score: 2, Informative

      That's not true. You have a choice as to what OS you want to run on your desk, and what machine you want to run it on. Mac OS X, Linux and Windows are officially supported - I haven't seen anything else.

    4. Re:I suppose this is Windows-only once again... by cheesecake23 · · Score: 2, Informative

      It almost certainly will be frozen over, so weather won't be a problem. But with a population of 352, I suppose lack of infrastructure could be a problem for having Winter Olympics in Hell.

    5. Re:I suppose this is Windows-only once again... by Temporal · · Score: 5, Informative

      Ken Thompson loves Unix

      Loves Unix? Ken Thompson invented Unix. Along with Dennis Ritchie. In 1969.

      So yeah. It would be kind of silly if he created something Windows-only...

    6. Re:I suppose this is Windows-only once again... by munctional · · Score: 1

      You speak of Mac OSX as if it's not a fully-certified Unix. It is: http://opengroup.org/openbrand/register/brand3555.htm

      --
      Functional programming... for real men!
    7. Re:I suppose this is Windows-only once again... by UnderCoverPenguin · · Score: 1

      Can somebody call hell to see if they can host the next Winter Olympics?

      As of this writing (2:34 AM EST, November 11, 2009), Hell is reporting -1.61 C (29.1 F).

      (http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=Hell%2C+MI&searchType=WEATHER)

      --
      Don't try to out wierd me, three-eyes. I get stranger things than you, free with my breakfast cereal. --Zaphod Beeblebr
    8. Re:I suppose this is Windows-only once again... by RocketRabbit · · Score: 1

      See, being open source, the idea is to _port_ it to your system or something clever like that.

      When Linux came out it was i386 only.

    9. Re:I suppose this is Windows-only once again... by ioshhdflwuegfh · · Score: 4, Interesting

      or created something non-C like...

    10. Re:I suppose this is Windows-only once again... by u38cg · · Score: 2, Funny

      Fan-boys, creating stuff just because it doesn't exist...

      --
      [FUCK BETA]
    11. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Only Leopard, a lot of people either still use tiger or now run snow leopard

    12. Re:I suppose this is Windows-only once again... by glwtta · · Score: 1

      Just because he created it wouldn't necessarily imply that he loves it. How do you think Dave Cutler feels? (I'm sure he loves VMS, I mean the other thing)

      Side-note: why do people always say 'invented UNIX'? Surely UNIX was 'designed'?

      --
      sic transit gloria mundi
    13. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Well it is a little warmer in this corner of hell.

    14. Re:I suppose this is Windows-only once again... by iris-n · · Score: 4, Insightful

      No, no, you're getting it wrong. Ken discovered UNIX. It was there since the begining of the universe.

      --
      entropy happens
    15. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Ken Thompson loves Unix

      Loves Unix? Ken Thompson invented Unix. Along with Dennis Ritchie. In 1969.

      Are you agreeing or disagreeing with GP's statement?

    16. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      In the beginning there was just the # and it was alone in the void....

    17. Re:I suppose this is Windows-only once again... by Raffaello · · Score: 2, Informative

      Actually, Snow Leopard is certified as well. You need to click on the link for the company, Apple, and it will show all their certified products. Here's the link

      Anyone still using 10.4 (i.e., Tiger) who wants certified Unix (for whatever reason) can upgrade to either of the two leopards. Tiger is two OS revs and 4 years old at this point. Having said this, Mac OS X has been Unix compatible from the very start, with a bsd subsystem available from the very first developer previews.

    18. Re:I suppose this is Windows-only once again... by Blakey+Rat · · Score: 1

      Well, yah, but it's not like it would be hard for them to talk to an intern or grab up a new hire and ask them to port it before release, right? And assuming they wrote portable C in the first place, porting it to Windows should be pretty damned easy-- it's not like there's a UI or anything.

    19. Re:I suppose this is Windows-only once again... by ImprovOmega · · Score: 1

      sudo let_there_be_light

    20. Re:I suppose this is Windows-only once again... by bhelpuri · · Score: 1

      any connection to sawzall ? it was developed by the same bunch of suspects.

    21. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Or created language keywords with more than 3 to 6 letters

    22. Re:I suppose this is Windows-only once again... by Anonymous Coward · · Score: 0

      Now that's really Insightful...

    23. Re:I suppose this is Windows-only once again... by Haeleth · · Score: 1

      Yes, OS X is Unix-certified. And Windows NT was POSIX-compliant. In both cases, it's largely irrelevant in practice, because the OSes heavily promote the use of their own proprietary APIs and discourage the use of standard interfaces.

  4. Attempting to install it... by cptnapalm · · Score: 4, Informative

    Not having much luck. It can't find /etc/passwd, /etc/group or /etc/hosts. All of which do exist. I'm inserting fmt.Fprintf statements to attempt to figure out why it is having problems.

    A novel idea: make people learn Go by requiring them to modify it in order to install it.

    1. Re:Attempting to install it... by Anonymous Coward · · Score: 0

      Learn Go? For that? Why, you always can strace it to find where it looks, and find this literal string in source to edit!. Well, they need to build "/etc/passwd" string in a nontrivial way in runtime..

    2. Re:Attempting to install it... by Jah-Wren+Ryel · · Score: 1

      Not having much luck. It can't find /etc/passwd, /etc/group or /etc/hosts. All of which do exist. I'm inserting fmt.Fprintf statements to attempt to figure out why it is having problems.

      Is there no debugger support? Printfs are PainAss.

      --
      When information is power, privacy is freedom.
    3. Re:Attempting to install it... by Anonymous Coward · · Score: 0

      I'm not sure if this is *whoosh* worthy for all the people who modified it insightful, but aren't those protected files? It's a bit odd that they don't appear to exist, but maybe it's just trying to open them for reading and failing, which with something like /etc/passwd isn't that surprising.

    4. Re:Attempting to install it... by michaelmuffin · · Score: 1

      i sincerely hope your post is a joke. and if so, i like it very much

    5. Re:Attempting to install it... by dbcad7 · · Score: 2, Insightful

      Permissions problem maybe ?

      --
      waiting for ad.doubleclick.net
    6. Re:Attempting to install it... by Anonymous Coward · · Score: 0

      It's actually a vast ARG. There isn't any real 'Go' at the moment, you're developing it for them. It's using the 'wet cloud' as a development system.

      Wait, that didn't sound right at all.

    7. Re:Attempting to install it... by Anonymous Coward · · Score: 0

      Are you using Fedora? I was just in IRC and saw people talking about how it has the wrong permissions on those files. One person said he changed them, and the Go compiler would work, but then any future logins would subsequently fail.

      I use Ubuntu, and it worked just fine there. I'd suggest that you get rid of Fedora.

    8. Re:Attempting to install it... by cptnapalm · · Score: 1

      Ubuntu 9.10

    9. Re:Attempting to install it... by MobyDisk · · Score: 1

      It can't find /etc/passwd, /etc/group or /etc/hosts

      Are you installing a programming language or a rootkit? :-)

    10. Re:Attempting to install it... by Anonymous Coward · · Score: 0

      lol. I almost spewed my water on my keyboard.

  5. Google search "Go" by sshore · · Score: 5, Funny

    It's a small complaint, I'm sure.. but couldn't they have given it a name that you could, you know, Google?

    1. Re:Google search "Go" by cptnapalm · · Score: 1

      You're having that problem too, eh?

    2. Re:Google search "Go" by TejWC · · Score: 5, Funny

      Perhaps we should abbreviate the "Go Programming Language" to "GPL"? That way, we can google for "GPL" and find Go code all over the place.

    3. Re:Google search "Go" by Anonymous Coward · · Score: 0

      Mod parent funny and I'll give you a dollar on monday.

    4. Re:Google search "Go" by cheesecake23 · · Score: 2, Interesting

      It's a small complaint, I'm sure.. but couldn't they have given it a name that you could, you know, Google?

      Yeah, why couldn't they use unambiguous names like all other programming languages, like C, Java, Python and Ruby?

      Sarcasm aside, I agree that the naming is unfortunate (although I love the Go Ogle debugger pun). The parent was probably referring to the common verb, but this will also make it much harder for Go players like myself to find books and stuff for the board game. This guy isn't happy either.

    5. Re:Google search "Go" by Animats · · Score: 3, Informative

      It's a small complaint, I'm sure.. but couldn't they have given it a name that you could, you know, Google?

      One could do worse. There was a language called "C+@" developed at Bell Labs. It's derived from C, with classes, dynamism, and safety, much like Java. It predates Java by a few years. Try to find it.

    6. Re:Google search "Go" by michaelmuffin · · Score: 2, Insightful

      the go authors have a decades-old practice of deliberately choosing annoying names "in the Bell Labs tradition of selecting names that make marketeers wince."

      http://plan9.bell-labs.com/wiki/plan9/FAQ/index.html

    7. Re:Google search "Go" by reSonans · · Score: 1

      And what's with their mascot? It's cute, but my first impression was an accelerating potato.

      --
      Light the blue touch-paper and retire immediately.
    8. Re:Google search "Go" by six6 · · Score: 0

      You're right, that would have helped, because looking in Google's issue tracker for "go" we find there is already a programming language called Go! The author of the Go! language has published a book and isn't OK with Google naming this new language "go"...

    9. Re:Google search "Go" by slysithesuperspy · · Score: 1

      Wow, its a fast language to code in alright. I can find 51,500,000 programs already!!1

    10. Re:Google search "Go" by Anonymous Coward · · Score: 1, Informative

      There's already a Go! programming language for that matter. You'd think Google would have Googled Go. http://portal.acm.org/citation.cfm?id=998367 http://www.lulu.com/content/paperback-book/lets-go/641689

    11. Re:Google search "Go" by thePowerOfGrayskull · · Score: 3, Funny

      No, no - "Go Open Source Programming e-Language" ... GOSPeL. That would not only make it easier to find in searches, but the occasional unrelated search result would most assuredly a topic loved by programmers everywhere!

    12. Re:Google search "Go" by w0mprat · · Score: 1

      GoL?

      (spanish: Goal)

      gol en propia meta! (spanish: Own goal!)

      --
      After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
    13. Re:Google search "Go" by howlingmadhowie · · Score: 1

      one small point. C, java, python and ruby were all invented and named before people started googling for stuff.

      this is something shuttleworth gets right with ubuntu development names. googling for 'karmic umts' is pretty likely to find results you want.

    14. Re:Google search "Go" by wvmarle · · Score: 1

      I have never heard such a complaint about certain other language's names... such as "C". So it doesn't seem to be too much of a problem.

    15. Re:Google search "Go" by vlm · · Score: 1

      GoL?

      (Conways) Game of Life?

      http://en.wikipedia.org/wiki/Conways_Game_of_Life

      As an industry, we've tried everything else as the magic bullet, why not a cellular automata based language? Draw yer turning machine and off you go...

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    16. Re:Google search "Go" by oodaloop · · Score: 1

      Well, it's new. Maybe Google's crawlers didn't find it yet.

      --
      Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
    17. Re:Google search "Go" by Sponge+Bath · · Score: 2, Funny

      "Og", so easy a caveman can use it.

    18. Re:Google search "Go" by hbr · · Score: 1

      Maybe "C", "D" and "C++" are not so bad, as they don't intersect with a very common word in plain english text.

      However, they are still pretty poor choices, I agree. And having symbols in the name is the work of the devil.

    19. Re:Google search "Go" by Blakey+Rat · · Score: 1

      This is a practical issue, it has nothing to do with marketing.

      Perl, Java, PHP, Lua are good names because they're easy to Google. (Java shares a name with something pre-existing, but is vastly more popular than it on the web, so it's not a big deal.) Python, Ruby, Obj-C not quite as much. C, C++, C#? Awful. Go unfortunately falls into the "awful" category here.

    20. Re:Google search "Go" by Blakey+Rat · · Score: 1

      The C variants, C, C++, C# etc, already have to get special-treatment by search engines. So yes, it is a problem, the only reason Google/Bing/etc work well with those is because they pre-existed Google/Bing/etc.

      There's no reason to create a *new* language with an unsearchable name, except general web cluelessness. And search engine providers shouldn't have special-case certain words/names just because they were coined by people who don't know how search engines work.

    21. Re:Google search "Go" by Anonymous Coward · · Score: 0

      C+@ is actually very easy to find - on a proper search engine that doesn't try to tell you what you *really* meant to search for. AltaVista handled it just fine.

    22. Re:Google search "Go" by Opyros · · Score: 1

      Which is why any web page about the board game Go ought to have the Korean name "Baduk" on it somewhere — it's unambiguous and makes googling much easier for Go players.

    23. Re:Google search "Go" by Jearil · · Score: 1

      Which really sucks because I already have problems when I try to search for "Go" the board game. Now I'm going to get results from a programming language mixed in as well.

    24. Re:Google search "Go" by frank_adrian314159 · · Score: 1

      Just be glad they didn't name it YAPL (Yet Another Programming Language) - although I'm sure that was already used sometime in the eighties.

      --
      That is all.
    25. Re:Google search "Go" by metamatic · · Score: 1

      Or try finding information about IBM's operating system for System i boxes.

      The OS is called "i".

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    26. Re:Google search "Go" by Deosyne · · Score: 1

      Damn, I may have to go back to using AltaVista. I'm getting kind of tired of having to preface everything with a + symbol because Google thinks that it knows what I'm looking for better than I do with many of my searches.

    27. Re:Google search "Go" by ZuluZero · · Score: 0

      I _swear_ that I used a very simple programming language in the late '80s called "GO"....but when I Google, all I get is _Google_ At least wikipedia gives you a bit more info. It was on some proprietary dumb network terminal system that came out of UoWaterloo, I think. Can't really remember grade 11, sigh. All the language seemed to be targeted for was drawing lines on the screen. Anyone?

    28. Re:Google search "Go" by Anonymous Coward · · Score: 0

      Crying again boy? I dun told you to man up. You bitchin' an' moanin' about some stupid gook game. I tell you what Big ol' Tyrone is gonna do for you. He's gonna stick his big ol' cock up yo' ass. It's be about that time that I gave you some a your medicine. Bend it over and bring tha tears boy. We gonna be in for a long ride.

    29. Re:Google search "Go" by Anonymous Coward · · Score: 0

      The P is implied and therefore unnecessary. There's no spoken Go language, so we can assume Go, the language is a programming language. What we can't assume is that it's open source, since there are plenty of languages that aren't. So we can abbreviate the Open Go Language as OpenGL, which should clear up any confusion.

    30. Re:Google search "Go" by AtrN · · Score: 1

      C+@ was essentially Smalltalk in C's clothing.

    31. Re:Google search "Go" by amRadioHed · · Score: 1

      Why not the Chinese name weiqi? It is a Chinese game, after all.

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    32. Re:Google search "Go" by shutdown+-p+now · · Score: 1

      It's interesting that Google (and others) do in fact tweak their UI and indexers to recognize those names as distinct keywords. Back in the day, searching for "C#" would really be a search for "C", and about as useful as you'd imagine. But for several years now, Google recognizes "C#" as a single keyword, either with or without the quotes, and will do decent searches on that - but e.g. "Z#" will still be treated as "Z", from which I conclude that they special-case them as they become popular.

  6. fmt by Duradin · · Score: 5, Insightful

    Vowels aren't nearly as expensive as they used to be back in the day.

    It'd be a nice touch if they'd add vowel support in package names.

    1. Re:fmt by Scott+Kevill · · Score: 1

      +1 nfmtv

      --
      GameRanger - multiplayer gaming service for PC and Mac games
    2. Re:fmt by rrohbeck · · Score: 2, Insightful

      I definitely prefer programming languages with concise syntax and function names. We don't need another Java.
      Maybe someone can write a preprocessor for the folks that want to bang out source by the megabyte.

    3. Re:fmt by Jonboy+X · · Score: 5, Insightful

      People will read a piece of code more times than they will write it, so it makes sense to optimize for readability. Besides, I end up autocompleting most type/method names in the IDE anyway.

      --

      "In a 32-bit world, you're a 2-bit user. You've got your own newsgroup, alt.total.loser." -Weird Al
    4. Re:fmt by Anonymous Coward · · Score: 0

      People will read a piece of code more times than they will write it, so it makes sense to optimize for readability.

      But reading is much quicker and easier than writing, hence the emphasis on making the writing easier.

    5. Re:fmt by shaitand · · Score: 1

      Speak for yourself, once it compiles and appears to run you never look at the source again and tell users that new features are impossible and bugs are the result of their other software conflicting.

      Every big software corp does this ;)

    6. Re:fmt by jez9999 · · Score: 1

      Agrd.2 much txt is bd,we nd 2 mk stf + concise,btr 4 usng storage.

    7. Re:fmt by dunkelfalke · · Score: 1

      wll, why d y thnk w nd nthr c?

      --
      "It's such a fine line between stupid and clever" -- David St. Hubbins, Spinal Tap
    8. Re:fmt by jabjoe · · Score: 1

      Many more people will run code many more times then they will read or write it. They won't care how readable the code is. Would you use software just because the code is readable? NOBODY does this for everything, bar those 100% free Linux distros (because only open is readable) and even then, how do you know each component has been chosen for its readability (beyond being readable at all because it's open) over its speed or functionality? Readability is important, but when the chips are down, it's less so then the running app, which is why great apps can have terrible code bases, but we all use them anyway.

    9. Re:fmt by ardor · · Score: 1

      But people who get to maintain a codebase written by someone else they don't know will be quite thankful for a readable syntax. This drives maintenance costs down, since it takes less time to fix issues. I take it you never had to fix some old perl code?

      --
      This sig does not contain any SCO code.
    10. Re:fmt by egr · · Score: 1

      That doesn't bother me much, what does is that some lines have semicolon and some don't.

    11. Re:fmt by jabjoe · · Score: 1

      All true. But you saying you don't use any software you know have a bad code base? We all use software with bad code bases, most of the time we don't even know the quality of the code base. If there comes a point where you have to decide about something nice for the code base or nice for the user, the user should win every time.

    12. Re:fmt by Chickencha · · Score: 1
      So just use

      import format "fmt"

      instead of

      import "fmt"

      and you can write

      format.Printf("Yay");

      to your heart's content.

    13. Re:fmt by Duradin · · Score: 1

      Doesn't help you know that "fmt" is supposed to be "formatted string" in the first place.

      You could just use import fmt "formattedString" and then you can write fmt.Printf("Yay"); to your heart's content.

    14. Re:fmt by SnarfQuest · · Score: 1

      People will read a piece of code more times than they will write it, so it makes sense to optimize for readability. Besides, I end up autocompleting most type/method names in the IDE anyway.

      Which is why I always program in forth!

      --
      Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
    15. Re:fmt by Anonymous Coward · · Score: 0

      except some java folks took it to the extreme...

    16. Re:fmt by equivocal · · Score: 1

      cnt was always my favorite of the unnecessarily de-voweled identifiers. How many others could get you fired if you said it aloud the way it's written?

    17. Re:fmt by Anonymous Coward · · Score: 0

      If there comes a point where you have to decide about something nice for the code base or nice for the user, the user should win every time.

      Either I am reading this wrong or very out of context, or you are so wrong that I can only hope that you don't actually code anything. No. No. No. No! The end user benefit comes from creating and being able to maintain a good codebase. If you think you have to sacrifice that for user needs, you aren't doing your job correctly.

  7. compiled in under 10 sec? by martin-boundary · · Score: 2, Funny

    I don't think so. I have an old Thinkpad 701C laptop which ain't compilin' this in under 10 seconds, if at all.

    1. Re:compiled in under 10 sec? by Bananatree3 · · Score: 1
    2. Re:compiled in under 10 sec? by Anonymous Coward · · Score: 0

      I have a Sega Genesis that won't compile it at all... damn you, Google!

  8. Not actually safe by jfjfjdk · · Score: 3, Interesting

    From a brief review of the language and implementation, this doesn't appear to use what we've learned about correctness over the last thirty years. Buffer overflows are just one bug class among dozens, and if you're going to create a language from scratch, why let integers overflow without making people explicitly request that behavior? Why ignore what we've learned about verification and formal languages? Microsoft has actually been far more responsible about this recently, thanks to the Java people they hired (Rustan etc); see Spec# for details.

    1. Re:Not actually safe by thePowerOfGrayskull · · Score: 4, Funny

      You're pretty bold giving MS any credit here. This is the home of the Google fanboi, for reasons I don't understand other than some people hope Google will take down Microsoft.

      I'm an AC because of companies like google.

      The most common five reasons for AC posting:

      • Too lazy to register
      • You have an account and overestimate how many people care about what you post;
      • You have an account and overestimate the importance of your slashdot karma score as pertains to real life.
      • You're a spy
      • You're cowboyneal
    2. Re:Not actually safe by miro+f · · Score: 3, Insightful

      Integer operations such as additions are incredibly quick, however you're going to be slowing your code down dramatically if you check for integer overflows with every single integer operation (unless you implement the check in hardware)

      --
      being vague is almost as cool as doing that other thing...
    3. Re:Not actually safe by CrashNBrn · · Score: 1

      You did forget one:
      You moderated, and wanted to post so you checked: Post Anonymously
      Not realizing that since you didn't manually log-out your moderation just got undone anyways.

      Oh, most common? mebbe not.

    4. Re:Not actually safe by SharpFang · · Score: 1

      Same about overflows. If you just dereference a pointer, it's 2-3 asembler instructions. If you dereference and check for legal range, you increase the size of the code about 20 times.
      I think it would be best if we were given a choice between safe/fast and unsafe/slow types.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    5. Re:Not actually safe by Anonymous Coward · · Score: 0

      The most common five reasons for AC posting:

      • Too lazy to register
      • You have an account and overestimate how many people care about what you post;
      • You have an account and overestimate the importance of your slashdot karma score as pertains to real life.
      • You're a spy
      • You're cowboyneal (One Vote)
    6. Re:Not actually safe by Anonymous Coward · · Score: 0

      You missed mine. I registered, but am too lazy to use/stash the credentials in a browser. I'm no longer sure what my username is and have not even a remote idea of what the password is.

      missing option 6
          o You have an account, but can't be hassled to use it

    7. Re:Not actually safe by catalina · · Score: 1

      The most common five reasons for AC posting:

      • Too lazy to register
      • You have an account and overestimate how many people care about what you post;
      • You have an account and overestimate the importance of your slashdot karma score as pertains to real life.
      • You're a spy
      • You're cowboyneal

      I tried clicking o those, but it won't let me vote!

    8. Re:Not actually safe by home-electro.com · · Score: 2, Informative

      Checking for CARRY flag is one instruction. Not exactly a dramatic slowing.

    9. Re:Not actually safe by metamatic · · Score: 1

      From a brief review of the language and implementation, this doesn't appear to use what we've learned about correctness over the last thirty years.

      Nor does any other language in common use. I remember during my CS degree skipping a bunch of denotational semantics and provability stuff, thinking "Pah, nobody's ever going to use this". And 20 years later, I've yet to see it in the real world.

      Sure, there are a few embedded systems and chip designs that are proven correct. But 99.99% of systems out there aren't even up-to-date with what we knew about correctness 20 years ago.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    10. Re:Not actually safe by Waffle+Iron · · Score: 2, Interesting

      Checking for CARRY flag is one instruction. Not exactly a dramatic slowing.

      Moreover, at least on X86, easily predictable conditional jumps (like overflow checks) are often almost free. They execute in different hardware units than ALU instructions, and often don't add to the overall clock count or latency at all.

    11. Re:Not actually safe by shutdown+-p+now · · Score: 1

      Same about overflows. If you just dereference a pointer, it's 2-3 asembler instructions. If you dereference and check for legal range, you increase the size of the code about 20 times.

      If you dereference a pointer on x86, it's one assembler instruction if it's stored in a register (which is normally the case), and 2 if it's stored in memory.

      I'm also skeptical about your "20 times" claim - a pointer range check would add two comparison and two conditional branching instructions, at worst. An array index check (which is what you probably run into in a language with no unsafe pointers) is one comparison/jump.

      Null reference checks do not require any comparisons at all. Since it's never a legal pointer value, it is perfectly safe to let it segfault, catch that in VM, and check if the segfault was for address 0 - if it was, then VM wraps it as a NullReferenceException. This is precisely what .NET does (it can be seen from the fact that any NULL pointer access in C++ code that you call from C#/VB will result in a NullReferenceException as well).

    12. Re:Not actually safe by SharpFang · · Score: 1

      You're skipping important parts like obtaining the pointer value from wherever it's found, storing the result where it will be used ( {*p;} alone is pretty much useless, you usually need some {x = *p;} - you could claim it's dereference plus assignment, I claim it's the smallest piece of code that makes sense).

      As for checking for overflow,
      1) look up which array this is - if it's local or statically linked, it could be done by preprocessor, but if it's dynamically linked, you need a lookup table. Symbol to pointer lookup - some 1-2 instructions.
      2) Find and retrieve its border conditions (increment pointers, store values in registers), 4 or so instructions.
      4) Compare with current index value, conditional jump. 2-4 instructions.
      5) branch A - check ok. Retrieve/store the value. 1-2 instructions. Done.
      6) branch B - handle the exception. Probably preparing the exception data alone will take some 10 instructions (where, which exception, all the metadata), then comes the generic code of the exception.

      Of course the optimistic case reduces the amount of instructions executed to 3-5 or so, but the actual code will be much longer than that, except just single branches of it will be executed, and the pesimistic case will have 20 or more instructions to run through.

      Nevertheless, even if little code gets executed on normal run, the exceptional condition will increase the size of the program including the whole 'failure' branch for every possible fault condition and while CPU usage will climb just a little, RAM and diskspace requirements skyrocket.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    13. Re:Not actually safe by shutdown+-p+now · · Score: 1

      You're skipping important parts like obtaining the pointer value from wherever it's found, storing the result where it will be used ( {*p;} alone is pretty much useless, you usually need some {x = *p;} - you could claim it's dereference plus assignment, I claim it's the smallest piece of code that makes sense).

      I'm not skipping anything. If both x and p in your examples are locals that are mapped to registers directly (quite likely for a small function), then it will be something like:

      mov eax, [ebx]

      If both variables are true locals on the stack, it would be something like:

      mov ebx, [ebp+12]
      mov eax, [ebx]
      mov [ebp+16], eax

      look up which array this is - if it's local or statically linked, it could be done by preprocessor, but if it's dynamically linked, you need a lookup table. Symbol to pointer lookup - some 1-2 instructions.

      I do not understand this at all. Why would I need to determine this kind of thing at runtime, and why in particular does it have to be done via some lookup table? Can you point out at any compiled language that actually does that?

      Find and retrieve its border conditions (increment pointers, store values in registers), 4 or so instructions.

      In most languages today you only have one border to retrieve, as the other one is 0 (and you already have pointer to start). If you have a pointer to array in a register already (in a loop over said array, you will), retrieving length is one MOV.

      Compare with current index value, conditional jump. 2-4 instructions.

      That's precisely 2 instructions (CMP/JGE), I've no idea where you get 4 here.

      branch A - check ok. Retrieve/store the value. 1-2 instructions. Done.

      If both array and index are in registers (again, highly likely in a loop over array), retrieving a value and storing in a register is a single MOV. Storing in memory is one more.

      branch B - handle the exception. Probably preparing the exception data alone will take some 10 instructions (where, which exception, all the metadata), then comes the generic code of the exception.

      Not really. This branch would just call a function that throws the exception, so it's a single CALL.

      On the whole, I would highly recommend actually looking at JIT assembly output for .NET (which is fairly easy to do) before making assumptions.

    14. Re:Not actually safe by SharpFang · · Score: 1


      I'm not skipping anything. If both x and p in your examples are locals that are mapped to registers directly (quite likely for a small function), then it will be something like:

              mov eax, [ebx]

      If both variables are true locals on the stack, it would be something like:

              mov ebx, [ebp+12]
              mov eax, [ebx]
              mov [ebp+16], eax

      You rarely need to use local pointer variables in small self-contained functions. Usually they will be on the stack or somewhere in the memory unless you just fetched one for current use and are reusing it a line below.
      [non-checking 3]
      Anyway, in a checking language variant you may need to fetch the pointer before you start retrieving its data or checking its validity. So, one likely MOV. [1]

      I do not understand this at all. Why would I need to determine this kind of thing at runtime, and why in particular does it have to be done via some lookup table? Can you point out at any compiled language that actually does that?

      Because you just loaded a chunk of code or data at runtime? Think loading and binding a .so/DLL file and calling its data structures from the parent program. Of course, in an optimistic and very common variant the compiler will do that for you at compile time.
      [2]

      In most languages today you only have one border to retrieve, as the other one is 0 (and you already have pointer to start). If you have a pointer to array in a register already (in a loop over said array, you will), retrieving length is one MOV.
      If you're checking for NULL... If you protect separate chunks of allocated space, you need both ends. If you use an array, you have the pointer to beginning and the index, you had to get both from somewhere earlier. You don't need to check for negative index but you still have to add it to the pointer for dereference if you retrieved length, or for comparison if you retrieved end pointer. [2]

      Compare with current index value, conditional jump. 2-4 instructions.
      That's precisely 2 instructions (CMP/JGE), I've no idea where you get 4 here.

      Ok, [2].

      If both array and index are in registers (again, highly likely in a loop over array), retrieving a value and storing in a register is a single MOV. Storing in memory is one more.
      - so we agree here. [2]

      So, the pessimistic count is 9 instructions in the branch that ends successfully vs pessimistic 3 and optimistic 1 in non-checking language. That is still assuming you didn't run short on registers and don't need to juggle some stuff out to stack - instead of 1 register we're using how many? 3? 4? And that may hurt our performance once again because we need to overwrite some unrelated variable stored in a register now and fetch it back again later, while it could have survived the whole operation in an unused register untouched.

      Not really. This branch would just call a function that throws the exception, so it's a single CALL.

      Abusing the stack by a CALL you never intend to return from to store the address of where it happened on the stack for later use? Okay... hackish but acceptable. Anyway, exception usually gathers some more info about where and why it happened to know how much has to be removed from stack from the context that just died. That info would have to be stored prior to the jump. I don't know exactly how much data is needed to collect all the leftover garbage resulting from interruption (in non-garbage-collecting language), but as I understand it, it's no trivial matter.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    15. Re:Not actually safe by shutdown+-p+now · · Score: 1

      You rarely need to use local pointer variables in small self-contained functions.

      I strongly disagree. In fact, you likely use local pointer variables in small functions all the time. Whenever you pass a string as an argument to a function (even if it's a wrapper class like std::string), you have a local pointer variable.

      Also, you very rarely repeatedly do dereferencing on a non-local pointer. If you do it in a loop, you typically copy it to a local before the loop (or the compiler will do it for you).

      Usually they will be on the stack ...

      Only locals (including arguments) are on stack; non-locals aren't. And for small functions that you've mentioned earlier, it is quite likely that all locals fit in the registers, especially on x86-64.

      Anyway, in a checking language variant you may need to fetch the pointer before you start retrieving its data or checking its validity. So, one likely MOV.

      If your pointer is on stack or heap, you'll have to fetch it into a register to dereference it regardless of whether the language is checking or unchecking (because there's no way to do double indirection in a single instruction). The only overhead for checking implementation are the checks themselves.

      Because you just loaded a chunk of code or data at runtime? Think loading and binding a .so/DLL file and calling its data structures from the parent program.

      I understand that symbols will have to be resolved when loading a shared library. But this happens regardless of checked/unchecked nature of the language used by the library or the calling code.

      So, I repeat the question: can you name a single language implementation with array bound checking that uses some kind of symbol lookup to determine when it needs to do the checks?

      If you're checking for NULL... If you protect separate chunks of allocated space, you need both ends. If you use an array, you have the pointer to beginning and the index, you had to get both from somewhere earlier. You don't need to check for negative index but you still have to add it to the pointer for dereference if you retrieved length, or for comparison if you retrieved end pointer.

      If you're checking an array index, why convert it to pointer and then check range of that pointer? It's much easier to just check the index against length - and that's one unsigned comparison, if your arrays are always 0-based.

      So, the pessimistic count is 9 instructions in the branch that ends successfully vs pessimistic 3 and optimistic 1 in non-checking language.

      It's not the most optimistic case. Compilers for checked languages are often smart enough to figure out when bounds do not need to be checked, because there's no way an index can be out of bounds at this point (e.g. it was checked earlier and not changed since; or we're in a loop with counter from 0 to array length).

      And that may hurt our performance once again because we need to overwrite some unrelated variable stored in a register now and fetch it back again later, while it could have survived the whole operation in an unused register untouched.

      It may, but in most cases when you index an array, you're using its length explicitly or implicitly anyway (e.g. when iterating over an array), so you have it loaded in the register already, and it's not wasted.

      In any case, my point was that it's definitely not 20x that you've originally implied. I'm not arguing that there is no perf hit from checks at all (that is obviously false), just that it's not as big.

      Abusing the stack by a CALL you never intend to return from to store the address of where it happened on the stack for later use? Okay... hackish but acceptable. Anyway, exception usually gathers some more info about where and why it happened to know how

    16. Re:Not actually safe by SharpFang · · Score: 1

      I strongly disagree. In fact, you likely use local pointer variables in small functions all the time. Whenever you pass a string as an argument to a function (even if it's a wrapper class like std::string)

      Agreed, I overlooked the cases where you don't use explicite 'int *x' but pointers hidden behind "" or std::string.

      If your pointer is on stack or heap, you'll have to fetch it into a register to dereference it regardless of whether the language is checking or unchecking (because there's no way to do double indirection in a single instruction). The only overhead for checking implementation are the checks themselves.

      Yes, but including identifying, finding and fetching the limits.

      Because you just loaded a chunk of code or data at runtime? Think loading and binding a .so/DLL file and calling its data structures from the parent program.

      I understand that symbols will have to be resolved when loading a shared library. But this happens regardless of checked/unchecked nature of the language used by the library or the calling code. So, I repeat the question: can you name a single language implementation with array bound checking that uses some kind of symbol lookup to determine when it needs to do the checks?

      Sure it does, but checking requires separate lookups or at the very least fetching extra metadata.

      As for languages... how is it done in Perl? As I understand it, it is compiled to C as an intermediate step, which doesn't support it natively, so it makes the checks way longer than a few ASM instructions...

      About everything that can do both eval() and the checking, will work in a similar way.

      If you're checking an array index, why convert it to pointer and then check range of that pointer? It's much easier to just check the index against length - and that's one unsigned comparison, if your arrays are always 0-based.

      Pointer in range:
      - obtain pointer
      - obtain bottom
      - obtain top
      - compare bottom
      - compare top.
      - dereference.

      Array in bounds:
      - obtain index
      - obtain pointer
      - obtain length
      - compare length
      - add index to pointer for dereferencing.
      - dereference.

      Same complexity, the extra steps just occur elsewhere.
      Of course in the array case, the addition is unskippable in case of non-checking.

      It's not the most optimistic case. Compilers for checked languages are often smart enough to figure out when bounds do not need to be checked, because there's no way an index can be out of bounds at this point (e.g. it was checked earlier and not changed since; or we're in a loop with counter from 0 to array length).

      Agreed, but Murphy Never Sleeps. You may argue the situation is better than I painted it, but you can't argue my points are completely moot.

      In any case, my point was that it's definitely not 20x that you've originally implied. I'm not arguing that there is no perf hit from checks at all (that is obviously false), just that it's not as big.

      I concede... in case of optimized compilers.
      If you take the Perl's example... sure it's not just the checking. There are the soft types, there is a lot of other stuff, but for my case it was about 30x slower than C. I'm pretty sure Java doesn't get it in 9 CPU instructions either.

      How large is the overhead? Well, I only know Win32 exceptions closely, and for those the record is really just two pointers, one of which is the handler function (which gets called on any exception, and handles all cleanup inside itself), and the second is a pointer to the next record. Setting that up is 3 instructions - two PUSH to create the record on the stack, and one MOV to store its pointer in a predefined thread-local variable where the OS can find it. Tearing it down is 2 instructions (POP old pointer and MOV it to thread-local).

      err... push-pop count doesn't match for me, what am I missing?

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    17. Re:Not actually safe by shutdown+-p+now · · Score: 1

      As for languages... how is it done in Perl? As I understand it, it is compiled to C as an intermediate step, which doesn't support it natively, so it makes the checks way longer than a few ASM instructions...

      Perl isn't compiled to C, never was. It's an interpreter.

      It's also a bad example, just as any dynamic language is, because there isn't even a simple "plain array" data structure there. I'm not sure what the default Perl arrays are, but I suspect they are array-backed lists. Add weak typing, and there's plenty of overhead there.

      It's best to stick to C vs Java/C#/D and the likes for comparison purposes here. At least then we're comparing apples to apples.

      Pointer in range:
      - obtain pointer
      - obtain bottom
      - obtain top
      - compare bottom
      - compare top.
      - dereference.

      Array in bounds:
      - obtain index
      - obtain pointer
      - obtain length
      - compare length
      - add index to pointer for dereferencing.
      - dereference.

      "Add index" is not a separate step, at least on x86 - you can do something like "MOV EAX, [EBX+ECX]", where EBX is the pointer to start of array, and ECX is the index. You can also do "MOV EAX, [EBX+ECX*4]" when elements are 32-bit integers, or *8 for 64-bit. Only for element sizes larger than 64-bit, you need 2 instructions.

      Also, when doing the same thing in a loop, it will be very different. You'd have to retrieve bounds for every new pointer value (if you e.g. increment pointer on every loop step), but for an array, you only need to retrieve its length once.

      I'm pretty sure Java doesn't get it in 9 CPU instructions either.

      Why? What else do you think it's going to be doing in there? Unlike Perl, it doesn't have the overhead of a weak, dynamically typed system. Java array is just a direct pointer to array data, same as in C - it's just that language restricts how you use it, and mandates certain checks when you do. But those checks are in practice implemented exactly the way we discuss here by the JIT.

      In any case, while I don't know how to look at the output of JVM JIT, I do know how to do the same for .NET, and they are similar enough that we can generally assume similar techniques. I've just looked at what it does to this code:

      a[i] = 0x111;

      Where a is a local variable of type int[], and i is a local variable of type long. Here's the disassembly on x86-64:

      mov rcx,qword ptr [rdi+8]
      cmp rbx,rcx
      jae 0000000000000074
      mov dword ptr [rdi+rbx*4+10h],111h

      RDI here is clearly "a", and [RBX+8] is where the length is. RBX is "i". There are no loads because both locals are directly mapped to registers, with no stack storage; if they weren't, you'd see two extra MOVs for that. JAE is "jump if above or equal", the bounds check. The magic number is the function that will throw IndexOutOfBoundsException - interestingly enough, it's a jump, not a CALL, but then it makes sense, because it will still have EBP to retrieve stack frame info for the exception. MOV is shift pointer by index, dereference, assignment all in one. All in all, as you can see, it actually does work how I predicted it would.

      err... push-pop count doesn't match for me, what am I missing?

      It's not supposed to match - you don't normally POP your locals ("allocated" via PUSH), you just restore the original stack pointer as it was on entry (saved via "PUSH ESP" on function entry) to clear the entire stack frame. POP here is to recover the old value only (presumably after the stack pointer is already adjusted). It could just as well be a "MOV [EBP+...]" in fact, it's just that POP is probably slightly faster.

  9. Named after the most difficult-to-master game ever by Culture20 · · Score: 4, Funny

    This bodes well.

  10. Wonder? by bongey · · Score: 1

    Does Go have goto statement ?

    1. Re:Wonder? by michaelmuffin · · Score: 3, Informative

      Does Go have goto statement ?

      why wonder when you can look it up? http://golang.org/doc/go_spec.html

      tl;dr yes, it has goto

    2. Re:Wonder? by Anonymous Coward · · Score: 1, Funny

      But disappointingly, they went with the well-worn keyword "goto" instead of following Common Lisp and calling the statement simply "go".

    3. Re:Wonder? by Anonymous Coward · · Score: 1, Funny

      Does Go have goto statement ?

      why wonder when you can look it up? http://golang.org/doc/go_spec.html

      tl;dr yes, it has goto

      It doesn't have comefrom though. Words alone cannot express my disappointment.

    4. Re:Wonder? by Anonymous Coward · · Score: 2, Insightful

      It doesn't have comefrom though.

      We'll have to wait for Google to independently rediscover it.

    5. Re:Wonder? by Anonymous Coward · · Score: 0

      So go has goto too...

    6. Re:Wonder? by Anonymous Coward · · Score: 0

      In keeping with the advanced nature of this new language, and as another example of how this language results in more compact source code than C to achieve the same result (did I mention more safety too?)

      the C language construct "goto" is spelled "go2" in go.

      The very experienced authors of Go have studied literally 10's of millions of lines of C code, and have discovered that the most frequent first letter for a label is "L".

      As a second improvement over C, if the first letter of the target of a go2 is "L", that letter can be omitted in the source code at the go2 site (but not the label site).

      Wouldn't have known this without the online docs.

    7. Re:Wonder? by StripedCow · · Score: 1

      yes, it has goto

      umm, but it appears to have a "go" statement too, with completely different semantics.
      "go" and "goto" ... this is too confusing!

      --
      If Pandora's box is destined to be opened, *I* want to be the one to open it.
    8. Re:Wonder? by CrashNBrn · · Score: 1

      From some of the design specs. It makes sense for it to have Goto [label], as it's similar functionality to Break and Continue which likewise support labels:
      ContinueStmt = "continue" [ Label ]
      BreakStmt = "break" [ Label ].

    9. Re:Wonder? by Odinlake · · Score: 1

      no, just white and black stones.

    10. Re:Wonder? by shaitand · · Score: 1

      I'd prefer a gohome statement. That way I only have to write one line of code each day.

    11. Re:Wonder? by Narishma · · Score: 1

      Because "go" is used for something else (to declare a goroutine).

      --
      Mada mada dane.
    12. Re:Wonder? by arhhook · · Score: 1

      Don't do it! I've /seen/ the raptors! I had a friend in the lab...he made that terrible mistake.

      http://xkcd.com/292/

        Carry on.

  11. Intolerable by Anonymous Coward · · Score: 1, Funny

    I don't like how this language uses "func" instead of "function", therefore this language is terrible and everyone who uses it or thinks about it in any way except for about it sucking is also terrible.

    1. Re:Intolerable by Javaman59 · · Score: 1

      Congratulations, you just saved yourself the trouble of reading past the first 4 lines of the language's home page. I trust you've put the time you saved to good use :)

      --
      I'm a software visionary. I don't code.
    2. Re:Intolerable by sammyF70 · · Score: 1

      I think a "wooosh" is needed here

      --
      "DRM is like the Ford Pinto: it's a smooth ride, right up the point at which it explodes and ruins your day."-C.Doctorow
    3. Re:Intolerable by Anonymous Coward · · Score: 0

      Yeah, it clearly should use fun in order to brighten up the programmer's day and make them think that work is fun.

      I'm sure we all loved our functional programming in ML courses because of this!

  12. "Systems" language? by TopSpin · · Score: 4, Interesting

    They're billing Go as a "systems language." If by "system" they mean "application server in a Google data center" then I suppose that's correct. Previously the term "systems language" referred to languages suitable for operation system implementation, including device drivers, virtual memory management and other persnickety low-level software. Lack of pointer arithmetic and explicit memory management probably precludes any attempt to use Go as a "systems" language by that definition (although there are exceptions to that thinking.)

    There is too much competition from other fresh and well regarded "new" languages for yet another new entrant to gain much headway without something really novel to attract attention. Not that trying is bad; by all means keep at it. Can't afford the mental bandwidth to jump on more new bandwagons, however.

    --
    Lurking at the bottom of the gravity well, getting old
    1. Re:"Systems" language? by michaelmuffin · · Score: 2, Interesting

      Lack of pointer arithmetic and explicit memory management probably precludes any attempt to use Go as a "systems" language by that definition (although there are exceptions to that thinking.)

      inferno is another exception to your definition of systems language. much of it is written in limbo, a direct ancestor of go. it too has automatic memory management and no pointer arithmatic and it works just fine

      http://en.wikipedia.org/wiki/Inferno_(operating_system)
      http://en.wikipedia.org/wiki/Limbo_(programming_language)

    2. Re:"Systems" language? by Anonymous Coward · · Score: 0

      corrections:
      - the language is called "limbo"; the system is called "inferno".
      - the kernel was not written in limbo; it was written in c.

    3. Re:"Systems" language? by cheesecake23 · · Score: 1

      There is too much competition from other fresh and well regarded "new" languages for yet another new entrant to gain much headway without something really novel to attract attention.

      Personally I think that with C-like syntax, Javascript-like garbage collection, closures and general simplicity, ridiculously straightforward concurrent programming constructs, a novel relaxed approach to Object Orientation and backing by Google, this will be a language to keep an eye on.

    4. Re:"Systems" language? by michaelmuffin · · Score: 1

      the language is called "limbo"; the system is called "inferno".

      well they're both exceptions to op's definition whichever way you phrase it, right? yes

      the kernel was not written in limbo; it was written in c.

      like i said, much of it is written in limbo. there is more to an operating system than a kernel, especially in an os such as inferno which tries to do as much code as possible in userspace

    5. Re:"Systems" language? by shmlco · · Score: 1

      "...a novel relaxed approach to Object Orientation..."

      No inheritance? Yeah, that's a "relaxed" approach all right...

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    6. Re:"Systems" language? by Animats · · Score: 4, Insightful

      Actually, you don't need pointer arithmetic for a "systems language". Neither Ada nor the Modula family had it, and those languages have been run on bare machines with no other OS underneath. You need the ability to explicitly place arrays in memory as a form of privileged hardware access, but it's not something that's used in most code.

      Garbage collection, though, implies there's a layer of software underneath your code. Garbage collectors either freeze the whole program, or need some help from the MMU to track pages altered while the collector is running. Hard real time and reference counts do not play well together. Reference counted systems don't inherently have that problem, and if the compiler optimizes out reference count updates they can be efficient. But most reference counted systems are slow and dumb.

      It's sad to see yet another C++ alternative that can't actually replace C++. We need a C++ replacement. C++ has stagnated. C++ is the only major language to have hiding ("abstraction") without memory safety, a bad combination never tried again. Strostrup is in denial about this being a problem, and the C++ standards committee is of in template la-la land, fussing over features few care about and fewer will use correctly.

      The previous poster is right, though. This is a language for writing applications to run on servers. Google needs something less painful than C++ and faster than Python. (Python is a reasonably good language held back by an archaic naive-interpreter implementation. Making Python fast is hard, though, because the compiler has to do type inference to figure out the variable type information the user isn't asked to provide. ShedSkin shows that can work, but that project only has one person on it.)

    7. Re:"Systems" language? by mister_dave · · Score: 1

      Is it backed by Google? I thought it was an engineer's "20%" project.

      Objective C, which has recently introduced many of the features you admire in Go, is backed by Apple, but has never taken off outside the MacVerse.

    8. Re:"Systems" language? by DerekLyons · · Score: 1

      There is too much competition from other fresh and well regarded "new" languages for yet another new entrant to gain much headway without something really novel to attract attention.

      Open Source.
      Google branded.
       
      It doesn't need anything novel when it hits two of the top orgasm buttons among many geeks, techies, and wanna bees. All that's missing for a grand slam is a connection to Apple.

    9. Re:"Systems" language? by ClosedSource · · Score: 3, Funny

      "Neither Ada nor the Modula family had it, and those languages have been run on bare machines with no other OS underneath"

      Or customers above either.

    10. Re:"Systems" language? by Anonymous Coward · · Score: 0

      there is more to an operating system than a kernel,

      But there is nothing more to a traditional "systems language" than a kernel. Other uses may be possible, but they don't fall under the traditional definition of systems language.

    11. Re:"Systems" language? by Toonol · · Score: 4, Insightful

      "Open Source" for the geeks, "Google Branded" for the techies, and "Apple" for the wanna bees?

    12. Re:"Systems" language? by iluvcapra · · Score: 1

      SNAP! In Ada's case though, the US government is a market unto itself.

      --
      Don't blame me, I voted for Baltar.
    13. Re:"Systems" language? by oldhack · · Score: 1

      Just going by the comments here, it sounds like another tweaked C. Purpose-built for Google?

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    14. Re:"Systems" language? by dumael · · Score: 1

      Nitpick, but reference counting isn't the ony form of garbage collection out there. Reference counting is actaully fairly attractive as you get very incremental collection , not simply your application freezing dead while you examine the entire heap (as android does currently, and Go's current collector).

      Also, IBM's Recycler which they are proposing was designed by David Bacon. Some of his more recent work is on hard-real time collectors for Java.
      http://domino.research.ibm.com/comm/research_projects.nsf/pages/metronome.index.html

      Finally, using the MMU on a cpu to assist with garbage collection is generally a disaster. Your program needs to be able to inspect and modify it's own page tables, or you're using the memory fault mechanism to allow the collector to progress. The first is a security + OS nightmare, and the second tends to be very slow.

    15. Re:"Systems" language? by Vintermann · · Score: 2, Informative

      You can get pointer arithmetic in Ada, as long as you sign the proper disclaimer of warranty forms and send them to the DOD in triplicate.

      Seriously, you can get pretty much anything in Ada, it's just that you need to be very, very verbose about the things you really shouldn't be asking for.

      --
      xkcd is not in the sudoers file. This incident will be reported.
    16. Re:"Systems" language? by ardor · · Score: 2, Interesting

      You cannot shoehorn a GC into C++. Explicit memory management is so tightly coupled to C++ that most attempts at introducing something automatic automatically impose significant restrictions on what you can do. This is OK for specific scenarios, not OK for a core language component.

      Also, generic programming and template metaprogramming are one distinct advantages of C++ over other languages. The ability to metaprogram and use structural typing there is priceless, and some forms of metaprogramming are quite common in languages like Javascript, Lua, Python, Ruby, Lisp, Haskell. Without such features, C++ becomes little more than a Java without GC. No wonder the C++ committee put their focus on them.

      I do agree however that a replacement is needed. Compile times are awful, memory usage while compiling goes through the roof, compiling errors fill several pages, the syntax is an abomination (especially in metaprograms), and it does not even have an optional GC.

      --
      This sig does not contain any SCO code.
    17. Re:"Systems" language? by cptnapalm · · Score: 1

      It started off as a %20 project. It is now a full time thing, apparently.

    18. Re:"Systems" language? by SharpFang · · Score: 2, Interesting

      I could see it as a 'system' language as in 'write applications in it'.

      Not scripts, not embedded functionalities, not CGI, and no, not servers.
      Just a typical "double click to start" applications that you install on your desktop computer, which serve a thousand various purposes. The kind of stuff you write in Delphi or Visual C++. Fast and easy to write, fast and easy to run. Not too far from the OS to require squeezing through 50 abstraction layers, not too raw to bother with kernel routine calls to do basic stuff. Not too abstract and high level to slow it down to a crawl like Ruby, not too low-level to be overly dangerous like C.

      It's placed somewhere between C and C++ on the "level highness" scale, doing some things that were long overdue in C++ natively, but not compromising performance for stuff like advanced inheritance, exception handling and such.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    19. Re:"Systems" language? by Anonymous Coward · · Score: 0

      You're an idiot on two counts:
      1. Ada DOES have pointer arithmetic. 2. C++ is NOT stagnant.

    20. Re:"Systems" language? by Anonymous Coward · · Score: 0

      No, GC is EASY to do in C++, and without forcing restrictions. The thing people need to learn is that, in C++, construction and allocation are separate animals. People wrongly assume that a constructor allocates memory. It does not (except, of course, if done explicitly for sub-objects, but we are talking about the object itself). They also wrongly assume that operator new does construction. It does not. Its only job is to allocation memory. The point is that in C++ you construct/destruct separately from allocate/deallocate. By this, I mean, constructors/destructors must have NOTHING to do with garbage collection (i.e., they must be decoupled from it). Using this philosophy, I have written deterministic allocators for real-time systems and garbage collectors that easily handle cycles (no stupid reference counting!). Neither of these implementations require any changes to how you write code in C++. The code was oblivious to it!

    21. Re:"Systems" language? by ClosedSource · · Score: 1

      It was briefly. A lot of projects got permission from the military to use other languages because Ada wasn't feasible for them. Eventually the government dropped the requirement completely.

    22. Re:"Systems" language? by fulldecent · · Score: 1

      the main benefit is simple concurrency.

      --

      -- I was raised on the command line, bitch

    23. Re:"Systems" language? by Animats · · Score: 2, Interesting

      You cannot shoehorn a GC into C++.

      Actually, you can. See Microsoft Managed C++. But it's not happy. Destructors and garbage collection do not play well together. Calling destructors from the garbage collector introduces a kind of concurrency which leads to difficulties if the destructor does something non-trivial, like close a window or a file.

    24. Re:"Systems" language? by bonch · · Score: 1

      Apple geeks are busy with Objective-C, an existing alternative (or addition, if you want to get semantic) to C that has its own fans.

    25. Re:"Systems" language? by RAMMS+EIN · · Score: 1

      ``I could see it as a 'system' language as in 'write applications in it'.

      Not scripts, not embedded functionalities, not CGI, and no, not servers.''

      But that would make it an application programming language in my book.

      Of course, many people these days use systems programming languages like C and C++ for application programming - with all the bugs and security vulnerabilities that results in.

      --
      Please correct me if I got my facts wrong.
    26. Re:"Systems" language? by grumbel · · Score: 1

      In Go you just have to confirm to an interface, you don't have to inherit from it. Which removes most cases for which you would need inheritance for in the first place. The rest can be handled by good old composition. You are also able to include an interface in another interface.

      No idea how that will work out in practice, but it certainly sounds a lot more clean and simple then what Java and friends are doing.

    27. Re:"Systems" language? by HiThere · · Score: 1

      Objective-C appears to have it's points, but all the texts on it I've been able to find are very heavy into Apple specific libraries, and so useless.

      (Yeah, there's some old stuff from the 1980's -- but it's atrociously written. Google go is already ahead of Objective-C on the documentation front. It's not good, but it's better.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    28. Re:"Systems" language? by Abcd1234 · · Score: 1

      Objective-C appears to have it's points, but all the texts on it I've been able to find are very heavy into Apple specific libraries, and so useless.

      Huh? This sure doesn't look that Apple specific to me...

    29. Re:"Systems" language? by Abcd1234 · · Score: 1

      No inheritance? Yeah, that's a "relaxed" approach all right...

      You *are* away that inheritance isn't a requirement for object orientation, right? Or do you not consider Javascript or Self object oriented?

    30. Re:"Systems" language? by HiThere · · Score: 1

      It does look like they've redesigned the GnuStep page recently, and added a new news item. I haven't followed the development much (only look in sporadically) so I can't say for sure that the linked pages are still the same as they were.
      The documents, however, advertising blurbs, and not very informative to someone interested in learning how to program in Objective-C.

      Besides, while GnuStep is an essential library for using Objective C, it's not the langugage. Even if that had been a good tutorial on GnuStep (I didn't even notice a bad tutorial there), it wouldn't answer what I was asking for. The "User Guides" contain small amounts of essential information, but far from what is needed. Look at the documentation of any successful language (except C and C++, which are successful because of the grandfather clause) and you may get an idea as to what I mean. (Python is a particularly good example.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    31. Re:"Systems" language? by Abcd1234 · · Score: 1

      Even if that had been a good tutorial on GnuStep (I didn't even notice a bad tutorial there), it wouldn't answer what I was asking for.

      That's why you read Apple's docs. After all, if you were working with Mono, you'd read Microsoft's documentation, right? Apple's is no different. Their documentation describes OpenStep, and that's what GNUStep implements. As such, that documentation is perfectly useful, even if it was originally written with Mac developers in mind.

    32. Re:"Systems" language? by shutdown+-p+now · · Score: 1

      Actually, you don't need pointer arithmetic for a "systems language". Neither Ada nor the Modula family had it, and those languages have been run on bare machines with no other OS underneath.

      Modula-2 has both pointer arithmetics, and unsafe (e.g. bit-preserving integer-to-pointer) casts. The fact that POINTER is a keyword in the language kinda gives a clue:

      VAR p : POINTER TO INTEGER;
      p^ := 123; (* segfault *)

    33. Re:"Systems" language? by shutdown+-p+now · · Score: 1

      Unfortunately, good GC means "generational mark-compact" these days, and that means moving objects around. Which is something you cannot do for C++ without severe restrictions on how you code things. Conservative GCs can be done, but they're already outdated.

    34. Re:"Systems" language? by shmlco · · Score: 1

      True object oriented systems include features such as data abstraction and encapsulation, polymorphism, and inheritance. Lose one and you may have objects of some sort, but you've also lost one of the fundamental building blocks of OOP and design.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    35. Re:"Systems" language? by shmlco · · Score: 1

      "In Go you just have to confirm to an interface, you don't have to inherit from it. Which removes most cases for which you would need inheritance for in the first place. The rest can be handled by good old composition. "

      Which prevents you from doing any kind of framework that provides core functionality that you then extend. Worse, there's no delegation either.

      And "conforming" to an interface requires that you implement all of the interface's methods. ALL of them. From scratch.

      This is basically the OLE Component/Interface model. A component model, not an object model.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    36. Re:"Systems" language? by Abcd1234 · · Score: 1

      True object oriented systems include features such as data abstraction and encapsulation, polymorphism, and inheritance. Lose one and you may have objects of some sort, but you've also lost one of the fundamental building blocks of OOP and design.

      Might I suggest you don't know as much about the area as you think you do. Object oriented development, as a methodology, is far more broad than your narrow vision of it. For example, delegation can take the place of inheritance as a method of composing functionality (and, in fact, for most applications, delegation is superior to inheritance as it reduced coupling between components).

    37. Re:"Systems" language? by HiThere · · Score: 1

      No, I wouldn't. Being dependent on Microsoft is a very good reason to continue to stay clear of Mono. (I didn't know that I was expected to depend of MS documents to learn Mono. I was staying clear of it for other reasons. I'm not certain that I yet know that this dependency exists, but I acknowledge the possibility.)

      I don't feel quite as untrusting of Apple as I do of MS, though the changes that they made in their EULA about 3 years ago mean that I will no longer buy or recommend them. Or trust them connected to the internet. (I *can't* agree with the EULA that they tried to slip into a security update...so the one Mac I still have is no longer in active use.)

      If your suggestion for learning to use Objective-C is that I use Apple's guides, then that's a reasonable reason to avoid Objective-C. If that were a supplemental text that covered some particular points, this objection would be less significant, but Apple has proven that they aren't trustworthy. The language that they tried to slip into the EULA that I'm objecting to allowed them to (paraphrase, probably)"Add, copy, delete, remove, or modify any file on your computer". Sorry, but I can't accept that, and to try to sneak it into a security upgrade means that I can't trust Apple, or anything dependent on them.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    38. Re:"Systems" language? by Abcd1234 · · Score: 1

      If your suggestion for learning to use Objective-C is that I use Apple's guides, then that's a reasonable reason to avoid Objective-C.

      Please, that's idiotic. Do you avoid Java because you're afraid of using Sun's docs?

    39. Re:"Systems" language? by shmlco · · Score: 1

      Too bad the language doesn't support delegates either. (As does Objective-C.)

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    40. Re:"Systems" language? by Abcd1234 · · Score: 1

      Too bad the language doesn't support delegates either. (As does Objective-C.)

      Umm, I never said "delegate". I said "delegation". ie, the design pattern, not the language feature. As in:

      In software engineering, the delegation pattern is a technique where an object outwardly expresses certain behaviour but in reality delegates responsibility for implementing that behavior to an associated object in an Inversion of Responsibility. The delegation pattern is the fundamental abstraction that underpins composition (also referred to as aggregation), mixins and aspects.

      I'm hoping that was just a misunderstanding, and that you really do know the difference.

      And Go absolutely supports delegation through it's mechanism of dynamic interfaces. Specifically, a type can be defined as implementing some set of methods (thus conforming to an interface), but can then dispatch those calls to a contained object which actually implements that interface.

      Though, as an aside, I don't know where you get the silly idea that Go doesn't support something akin to delegates as they're defined in C#... anonymous delegates are a superset of delegates in general, and are nothing more than statically typed closures, which Go absolutely supports.

    41. Re:"Systems" language? by HiThere · · Score: 1

      Sun hasn't given me any reason that I've noticed to distrust them. (Outside, that is, of being a large corporation, and therefore inherently untrustworthy. Policies are subject to change with the board of directors and/or general manager.)

      Apple has. After that trick with the EULA I wouldn't put it past them to intentionally lie about important features if that lie were to the benefit of Apple.

      P.S.: I *don't* depend only on Sun for my Java info. I didn't seriously consider Java until after Sun released it under GPL. Since then I've seriously considered it, and it does look very nice. But I didn't depend on Sun for my information. I used Sun information, but my primary sources were independent. (I eventually decided that Java was too slow for my primary use, but VERY interesting. I'll wait for awhile now to see how the dealing with Oracle turns out before investing any more time with it, though.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    42. Re:"Systems" language? by bonch · · Score: 1

      I don't feel quite as untrusting of Apple as I do of MS, though the changes that they made in their EULA about 3 years ago mean that I will no longer buy or recommend them. Or trust them connected to the internet. (I *can't* agree with the EULA that they tried to slip into a security update...so the one Mac I still have is no longer in active use.)

      Oh, god, you're one of those online no-lifers for whom EULAs have become a matter of life and death.

      If your suggestion for learning to use Objective-C is that I use Apple's guides, then that's a reasonable reason to avoid Objective-C.

      Apple has a fantastic Objective-C programming guide online, but if you want to be paranoid and untrusting over freakin' online documentation, then feel free to remain ignorant about the language, you spergy nerd.

  13. Re:Named after the most difficult-to-master game e by cheesecake23 · · Score: 3, Insightful

    The game may well be the most difficult to master of all games in history, but it is simultaneously one of the easiest to learn and to enjoy. Which actually does bode well for the language. If Go (language) is to C as Go (game) is to chess, then they nailed it.

    But, as I just posted in another thread here, there are other problems with the naming.

  14. Who programs on Windows, anyway? by Anonymous Coward · · Score: 1, Interesting

    Besides people who work at Microsoft, that is.

    1. Re:Who programs on Windows, anyway? by palegray.net · · Score: 1

      People who write software that runs on Windows. Thankfully, I'm not one of them anymore; it's all Linux and MacOS X for me these days.

    2. Re:Who programs on Windows, anyway? by onefriedrice · · Score: 1

      I target Windows even though I don't run it, just because it's so easy. The mingw32 toolchain is fantastic. Otherwise, yeah, I probably wouldn't bother...

      --
      This author takes full ownership and responsibility for the unpopular opinions outlined above.
    3. Re:Who programs on Windows, anyway? by Anonymous Coward · · Score: 1, Funny

      Botnet authors?

  15. C++ incomplete. C# windoz. Java slow elephant. by upuv · · Score: 4, Insightful

    I've been around for a long time.

    C great language did exactly what it was designed to do. But carries a lot of burden.
    C++ come on it didn't even have a string class. Thus pointer math hell.
    C#, Ok it learned a lesson and found the joy of a string class. But really it's a windows only lang.
    Java. Excuse me web apps that take 8Gig of ram spread across a farm of servers. This slow elephant remade the hardware business.

    All of the above never really understood concurrent / multithread / parallel. ( Sorry Java devs still have issues with the concept. GC & log4j come to mind as things that forgot they were in a threaded env. )

    So the "Go" lang it just might deserve a look. Clearly web centric. Clearly built for tons of concurrent comms. Recompiles in a blip thus useful for real time compiling alla jsp. I'm very performance centric. If I can replace my J2EE bloat ware with a trunk full of tiny Go apps I will.

    I'm definitely watching this space for developments.

  16. Not Google Branded by M3gaBight · · Score: 0

    One thing that suprises me about this is that there's no reference to this being a Google project on the front page. Is this a deliberate move to seperate it from normal Google activities? To give it more of a chance as something other than the latest Google fad? Any ideas? It doesn't even look like it's geared specifically towards web apps.

    1. Re:Not Google Branded by exley · · Score: 1

      They should have called it Go Beta; then we would know without it being explicit.

    2. Re:Not Google Branded by palegray.net · · Score: 1

      without it being explicit

      What, Go supports naked data structures?

  17. use Microsoft then... by tjstork · · Score: 1

    and have the pleasure of intellisense adding stuff like String.Format...

    I'll take fmt any day of the week.

    --
    This is my sig.
    1. Re:use Microsoft then... by Anonymous Coward · · Score: 0

      Will do.

    2. Re:use Microsoft then... by nschubach · · Score: 1

      Honestly, I still love how StringBuilder is a separate class from a String. Why is it so hard to make String blah; blah.Append("goo");? Recently reading through Code Complete (published by Microsoft) touches on this subject in Chapter 6.4 if I remember right...

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    3. Re:use Microsoft then... by jrumney · · Score: 3, Insightful

      It's hard because in most cases you want strings to be efficient in terms of both memory and performance, so it is best if they are fixed size - easiest if they are immutable. So you have a separate class (StringBuilder in C#, StringBuffer in C++) which is a mutable string with all the inefficiencies of having to reallocate its storage as the string grows, and an efficient conversion into an immutable String object for when you've finished building it and want it to be efficient in terms of storage size and operations carried out on it.

    4. Re:use Microsoft then... by jrumney · · Score: 1

      StringBuffer in C++

      Doh! I meant Java

    5. Re:use Microsoft then... by gbjbaanb · · Score: 1

      If you want to be efficient in terms of memory, the last language you'd choose is C#.

      There's no reason why you can't have a fixed-size string class that can grow its buffer if anyone calls the appending methods. In any case, the StringBuilder class provides everything you'd want in a string - including preallocating the size, but without being a string that everyone uses daily, leaving you to convert to and from it all the time.

      I'm not even sure if there are efficiencies in performance from using a resizeable string class (if you don't resize the buffer, that is)

    6. Re:use Microsoft then... by Jesus_666 · · Score: 1

      That's why I like Apple's approach: You have NSString and NSMutableString, which inherits from NSString so nobody expecting a NSString cares if you use the mutable version of it.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    7. Re:use Microsoft then... by Jane+Q.+Public · · Score: 1

      You don't do that in garbage-collected languages anymore. A string has a header, including its length (none of this null-terminated string crap that was the source of endless problems in the past). If you want to append a character to a string, you allocate memory space for it, move the existing string there, append the character. Garbage collection takes care of the rest.

      Of course, if you are a programmer worth your salt, you still don't go about willy-nilly appending single characters to a string 100,000 times in a row, unless you have no choice. But there are always tradeoffs.

    8. Re:use Microsoft then... by Matrix14 · · Score: 1

      On the other hand, if you are actually implementing strings for a programming language these days, I hope you are not implementing them as arrays of characters, but as a rope or some other type of advanced data structure that allows fast concatenation.

    9. Re:use Microsoft then... by Jane+Q.+Public · · Score: 1

      Well, yes. Ideally, in most cases, there would already be space available, so no need to allocate more memory. My main point was that if allocating more memory is necessary, garbage-collected languages just do it, rather than requiring the programmer to worry very much about whether the memory space is flexible or immutable.

    10. Re:use Microsoft then... by hattig · · Score: 1

      Java has StringBuilder (since 1.5, but as that release is now unsupported because it's so old I guess its a moot point).

      But yes, SB is optimised for appending efficiently, and String is optimised for space and immutable operations.

      Go appears to use += for String appending. I would hope that behind the scenes it is compiling to a StringBuilder type construct, rather than allocating a new string like with Java +=.

    11. Re:use Microsoft then... by tjstork · · Score: 1

      Yeah but this is something the compiler can fix behind the scenes for you. I mean, if they can have WCF built on top of a few attributes, they can have a string that you can just use.

      --
      This is my sig.
    12. Re:use Microsoft then... by Aceticon · · Score: 1

      Also immutable objects are 100% safe in multi-threaded environments which means they require no mutexes/locks/semaphores or any other such thread access control tricks. This makes using them much speedier.

    13. Re:use Microsoft then... by BZ · · Score: 1

      I hope if you're implementing strings in a programming language then you think about how they will typically be used in the domain your language is addressing. Are large strings going to be common? Will indexing (something ropes are significantly worse at) be common? Will there be substring searches performed on the strings? Regular expression matches?

      It's no use having better order-of-growth if in practice your N is small and your constant factor huge....

    14. Re:use Microsoft then... by Waffle+Iron · · Score: 1

      There's no reason why you can't have a fixed-size string class that can grow its buffer if anyone calls the appending methods.

      Yes there are. Compilers can make a lot more assumptions when optimizing code for immutable objects than for mutable ones. Immutable objects are more idiot-proof when used as hashtable keys. And memory layout requires an extra layer of indirection (2 allocations for each string) for variable-length vs. fixed length unless funky hacks are used under the hood.

      I do agree that the mutable string API should be a strict superset of the immutable string API. This is something many existing languages fail at. (You can't make the mutable an actual subclass of the immutable without messing up the invariants guaranteed by immutability, however.)

    15. Re:use Microsoft then... by shutdown+-p+now · · Score: 1

      Yeah but this is something the compiler can fix behind the scenes for you.

      Like many such things, it looks obvious at the first glance, but quickly falls apart when you start investigating corner cases.

      Let's start with this simple transform, which is what you presumably want. So this:

      s += "foo";
      s += "bar";
      ...

      should automatically be translated to:

      StringBuilder sb = new StringBUilder();
      sb.Append("foo");
      sb.Append("bar");
      ...
      s += sb.ToString();

      Yes, this is a safe transform, and easy to detect and handle, too... except what if "s" is a property? If so, invocation of its property settor is an observable side effect (simply put, you can put a counter in your settor code, and you have a right to expect it to have a certain specific value after running the above code). So we cannot do that transform if "s" is a property. Well, we could check if its implementation is as simple as { this._s = value; }, and then optimize it away, but that involves further complications. And note that C# compiler at present doesn't do any inlining, because it's a job for CLR JIT. So this is something that would have to be added.

      Okay, so what if it's not a property? Well, it could also be a field. In the code above, this doesn't pose any problems. But what if you actually have this:

      s += obj1.Property;
      s += obj2.Property;
      ...

      This still doesn't look like it's problematic, because if we move those property accesses inside sb.Append(), there's no observable difference. Problem is, property gettor can throw an exception - it could be explicit, or it could be something like a null reference or out-of-bounds array index, or it could be thrown by something that the gettor itself calls. Someone - and we don't know who exactly - might be catching that exception below us on the callstack, and if it holds a reference on our object, it can observe the value of field "s". So if obj2.Property throws, it should observe the value of obj1.Property in "s". And this isn't something we could do with a StringBuilder version.

      Even if "s" is a local, there are things to watch out for. First of all, it may not actually be a true local even if it looks like one in C# source code - if it's a local inside an iterator block, or a variable captured by a lambda, the compiler turns it into a field on a closure object to let it outlive the lifetime of the function call.

      Closure object can be retrieved from a delegate using Delegate.Target, and field can be accessed of it using Reflection, so it's still observable, and everything said about fields above applies.

      If "s" is a true local, there's still a possibility for an intermediate value to escape. Say, this:

      s += "foo";
      Foo(s);
      s += "bar";
      ...

      If "Foo" is going to store the reference to "s" in some field, we'll have to make a copy for it if we do a StringBuilder transformation. Of course, after we do it, it may even be the case that the transformation is no longer an optimization after that, and is actually slower. Detecting which one it is when the code is more complicated, and involves, say, a bunch of loops, can be tricky.

      All of the above can in some cases be detected by using cross-method escape analysis to fully figure out what can and cannot happen for a given piece of code. For exceptions, this would also mean doing the same to figure out when a reference can never be null etc. The compiler cannot reasonably do it, because it cannot assume that code living in other assemblies it's compiling against will be the same at runtime (e.g. you can compile against version 3.0, and then run against 3.5). The runtime/JIT has all information, but the problem is that it's supposed to be fast, and whole program optimizations rarely are that, so y

  18. Fixes problems misguided people think C++ has. by pslam · · Score: 5, Insightful

    Go has garbage collection and lacks pointer arithmetic. So... it won't replace C++, then?

    Why was that so easy and quick to say? I really don't understand the repeated banging-head-against-wall that language inventors are doing. There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic. C++ is a static, explicit language. Go is not. It will not replace C++, and no language will until that is understood.

    The problems C++ need fixing are elsewhere. The syntax needs cleaning up. The ABI needs rationalizing between architectures. Multiple inheritance needs some taming (ditch 'virtual' multiple inheritance - it's insane), but not removing. Interface-only classes need promoting to a full type rather than inferred from being 100% pure virtual (and even then there's usually a non-pure-virtual destructor for stupid foot-bullet-avoiding reasons). There needs to be saner syntactic sugar for repeated operations (like python's 'with' keyword). Templates syntax needs to be less verbose and more automatic (already being worked on for C++0x but at this rate will be C++1x, keyword 'auto').

    Stop trying to replace C++ with a language that does not fulfill every aspect C++ covers. If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

    1. Re:Fixes problems misguided people think C++ has. by Toonol · · Score: 1

      This language may not be intended to replace C++. Still, though, I mostly agree with you. Pointers and other such tools need to be available; not ubiquitously, like they tend to be in C++, but not removed completely. They are powerful and useful in a limited set of circumstances... kind of like a GOTO. Have the compiler spit out warnings whenever they're used, and recommend against them in the style guides; but don't remove the functionality and expect to compete with C++.

    2. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 1, Insightful

      >>There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic.
      bzztt WRONG!!! C++ is in popular use despite having explicit memory management and pointer arithmetic. Unless you're talking about people who write operating systems and device drivers. Which is not insignificant...but hardly a majority of the software developed today.

      I don't get the hate about garbage collection. How much time do you spend writing and maintaining constructors, copy constructors, assignment operators, destructors, etc? God forbid if you want to make them exception safe. All that just goes away with garbage collection. Sure, if you're writing Doom 8 you probably need to squeeze every cycle out of your PC...but if you're writing e.g. desktop productivity software, does it really matter that you spend 3% of your application time in the GC? Oh the horrors!!(but we shipped 5 months earlier because we didn't have to deal with bullshit memory errors)

      The first problem C++ needs fixing is the insane preprocessor copy/paste mechanism for header files. That alone would probably make every c++ dev 2x more productive, given that their build process would stop being an O(N^2) operation. I mean, when there are books(Large Scale C++ Software Design) and design patterns(PIMPL) about how to physically structure your code to make it compile faster, you know you're in trouble.

    3. Re:Fixes problems misguided people think C++ has. by Stuntmonkey · · Score: 1

      There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic. C++ is a static, explicit language. Go is not. It will not replace C++, and no language will until that is understood.

      Why do you say Go is not a statically typed language? It says quite directly in the language spec that it is, and that type safety was an important design goal.

      The lack of explicit memory management is clearly one of the big things here, and in the video at golang.org they explain their rationale. Part is the volume of bugs that explicit memory management creates, especially in threaded code. Another part is the belief that modern GC technology is efficient enough to not impose much of a performance penalty. Yet another part is that modern compilers are good enough at optimizing array indexing that there isn't any longer much efficiency benefit from pointer arithmetic.

      The lack of pointer arithmetic seems to be a requirement in a language that supports garbage collection, if there is to be any guarantee of safety. Otherwise an object might be marked for deletion by the GC because no references to it exist, but then later you may come along and "recreate" a reference through pointer arithmetic from a reference to a nearby object. This combination would be inherently unsafe.

      The other interesting feature here is the "interfaces" idea, in particular how you don't have to explicitly declare that type X implements interface Y. It does so automatically, if you have defined the methods required by Y. I think this could reduce some of the subclassing shenanigans and huge type hierarchies you can get into with C++, and do it in a type-safe way.

      IMHO it's too early to form a judgment here, but I appreciate the fact that the designers have a restrained design aesthetic. C++ is frankly an ungodly mess at this point, on par with Perl. The success of Python shows that these things matter. Also the fact that Google is backing it means it could see enough development to become usable as a production language (clearly it's got some way to go).

    4. Re:Fixes problems misguided people think C++ has. by TheTurtlesMoves · · Score: 5, Insightful

      If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

      Because if you can't do that then you can't do anything right?

      Heres a novel idea. Use a language as a tool, and use the right tool for the job. If you are writing an OS perhaps you need *explicit* access to pointers, or if you are doing something with MMU you would need a asm{} section (thats not C++ either). But when i want to write a application server then that requirement is lame and garbage collection and better memory models frees the developer and compiler (escape analysis etc) to do a lot more of the relevant work.

      We are not all writing an OS, so why the hell do we all need to be using a language that can write an OS? Just like all welders are not all welding Aluminum so they don't all need fancy TiG welders (just like we don't always need to use car analogies).

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    5. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      No but C can.

      C++ is a bastardized monstrosity that will take years for new features to be available in all compilers. Adding features to its already complex featureset is a losing proposition.

      The world is still missing a simple easy to use/read, fast, native and cross platform programming language, I'm not saying this is it (although looks like a decent first attempt) but it has a lot more potential than forking with C++ to get there.

      As long as its rich enough to be able to write 95% of the programs out there as well as being able to call into C libs should you need to, then I'd be happy to ignore C++ completely.

    6. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      Hahaha writing an interrupt handler in C++ .... you've got to be kidding, surely.

    7. Re:Fixes problems misguided people think C++ has. by gpuk · · Score: 2, Interesting

      Have you considered the D Programming language?

      From http://www.digitalmars.com/d/ "D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. Special attention is given to the needs of quality assurance, documentation, management, portability and reliability.

      The D language is statically typed and compiles directly to machine code. It's multiparadigm, supporting many programming styles: imperative, object oriented, and metaprogramming. It's a member of the C syntax family, and its appearance is very similar to that of C++. "

    8. Re:Fixes problems misguided people think C++ has. by fnj · · Score: 3, Interesting

      The garbage collection haters and garbage collection lovers will never see eye to eye. Your parent is NOT wrong. He's probably just doing things you're not (and vice versa in all likelihood).

      Smart pointers basically trivialize the so called "problem" of memory management and exception safety in C++. Simply put, it's NOT a problem. Before the boost library came into use it took SOME discipline, but nowadays it's just dead straightforward. A real time embedded programmer wants control over memory management. He can't tolerate garbage collection compromising his execution scheduling deadlines. It's a lot more than just Doom 8. It's your car. It's the airliner you ride in. It's process control.

      Couldn't agree more with your last paragraph. These are the REAL places C++ falls flat on its head.

    9. Re:Fixes problems misguided people think C++ has. by bbn · · Score: 2, Insightful

      If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

      So there is zero assembler code in the Linux kernel because C can do it all? Not so.

      You do not need explicit memory management or pointer arithmetic to do these things. To write a device driver you might need the ability to access memory directly, but that could easily be done by mapping the memory region to an array.

      There are incremental garbage collectors that guarantee real time performance.

      It would probably be a huge benefit if the OS was written in a better language than C. One that takes a whole host of bugs out of the equation by not allowing manual memory management and pointer arithmetic.

    10. Re:Fixes problems misguided people think C++ has. by rusty · · Score: 3, Insightful

      > Stop trying to replace C++ with a language that does not fulfill every aspect C++ covers.

      Err, no (how did this get +5?) C++'s entire problem stems from the attempt to Be All Things. A far better approach is to design something that does one part of things well, and interoperates with C like everything else so you can glue stuff together.

      They've subtracted, not added. This is the Right Thing to have done.

      Rusty.

    11. Re:Fixes problems misguided people think C++ has. by dkf · · Score: 1

      Go has garbage collection and lacks pointer arithmetic. So... it won't replace C++, then?

      For some uses, it will. Those will typically be the uses where writing it in C++ is not that good a solution anyway, and where trading off a lack of low-level access for a lower bug rate is worthwhile. As is usual with programming languages, the exact balance between restrictions and power comes out differently in different situations; removal of sharp tools from the toolbox can even sometimes be an enabler.

      You're not much of a programmer if you only have one programming tool to work with. That's like being a joiner who only uses a hammer...

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    12. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      How about FreePascal?

    13. Re:Fixes problems misguided people think C++ has. by Wildclaw · · Score: 1

      Those will typically be the uses where writing it in C++ is not that good a solution anyway

      That doesn't really narrow it down though.

    14. Re:Fixes problems misguided people think C++ has. by RAMMS+EIN · · Score: 1

      Your post makes it sound as if all language designers are ever trying to do is replace C++. As a language designer, I can tell you first hand that this is not the case, at least not for all of us. There are different kinds of programming, and it is perfectly possible for multiple programming languages to coexist, each in their own niche, without there being a question of one replacing the other.

      As you yourself say:

      If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language?

      This kind of system programming is a niche that is filled by very few programming languages. Go probably isn't one of those. I don't think C++ is, either. Python? Not even close. Does this mean the designers of these languages need to go back to the drawing board, as you say? I beg to differ. Just because you can't access low-level hardware features in them doesn't mean they aren't perfectly fine application programming languages. In fact, I would go as far as to say that, just as there are many good application programming languages that aren't suitable for systems programming, a good systems programming language usually doesn't make a great application programming language.

      And there you have it. As a language designer, I design languages for particular niches. I am not trying to replace C++ or any other language so much as designing what I think will make a better language for some particular purpose. If you still want to program in C++, that's great. And maybe it is the best choice for what you are doing with it. That doesn't mean it isn't a good idea for me to design a new language.

      --
      Please correct me if I got my facts wrong.
    15. Re:Fixes problems misguided people think C++ has. by Vintermann · · Score: 1

      "A real time embedded programmer wants control over memory management. He can't tolerate garbage collection compromising his execution scheduling deadlines. It's a lot more than just Doom 8. It's your car. It's the airliner you ride in. It's process control."

      But you know what he really should use in these spaces anyway? That's right, Ada. I do not want my life to depend on low-level C++ !!
      Ada is, to date, the only non-academic language capable of supporting formal verification of hard real-time systems (SPARK and RavenSPARK).

      --
      xkcd is not in the sudoers file. This incident will be reported.
    16. Re:Fixes problems misguided people think C++ has. by RAMMS+EIN · · Score: 1

      ``All that just goes away with garbage collection. Sure, if you're writing Doom 8 you probably need to squeeze every cycle out of your PC...''

      and even then, you shouldn't assume that foregoing garbage collection is the way to go.

      After all, manual memory management means code needs to be run every time the last reference to a chunk of allocated memory is lost. With automatic memory management, there is no such requirement. And indeed, some studies have found automatic memory management to actually outperform manual memory management.

      --
      Please correct me if I got my facts wrong.
    17. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      Heres a novel idea. Use a language as a tool, and use the right tool for the job.

      Now, now, don't be perfectly reasonable. If you don't have your one language to rule them all then how can you have a good religious war.

      On the other hand, Go is Yet Another General Purpose Language, we already have a billion of those and none of them are significantly better than each other. What we really need is to make that "tool" argument really apply — ie. stop making more damn general purpose languages, what we really need are special purpose languages like SQL, eg. a special language that only does GUIs (but really cleanly and easily) but otherwise is only barely Turing Complete.

    18. Re:Fixes problems misguided people think C++ has. by tepples · · Score: 1

      There are incremental garbage collectors that guarantee real time performance.

      Are they patented in major markets that allow software patents?

    19. Re:Fixes problems misguided people think C++ has. by smcdow · · Score: 1

      ... And, can we PLEASE have a thread-safe STL? Please, please, please?

      --
      In the course of every project, it will become necessary to shoot the scientists and begin production.
    20. Re:Fixes problems misguided people think C++ has. by AReilly · · Score: 2, Insightful

      What on earth do you need multiple inheritance, virtual functions and templates for if you're writing a memory management system or interrupt handler?

      The problem with C++ is that it keeps C++ programmers from moving on to more productive languages with more support for real abstractions, by having them believe that they should use it to write the tiny amount of code that would be better written in C.

      Get over it: you've got a perfectly useful set of interrupt handlers and memory management in your favourite OS and runtime. Write the useful code in something that will *leverage* that, rather than re-inventing it over and over again.

      --
      -- Andrew
    21. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      LOL! TheTurtlesMove is, no doubt, an "internet programmer".

      Clue: If more "internet programmers" understood how operating systems worked and why those "useless features" exist, then computers wouldn't be so fucking slow despite having blazing fast CPU's and gargantuan amounts of ram.

    22. Re:Fixes problems misguided people think C++ has. by smellsofbikes · · Score: 1

      For the record, you can weld aluminum perfectly well with an oxy-acetylene torch or a mig welder using shielding gas, but at the end of the day, tig is almost always the best way to weld any metal.

      --
      Nostalgia's not what it used to be.
    23. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 1, Interesting

      We are not all writing an OS, so why the hell do we all need to be using a language that can write an OS

      Because at some point you *do* have to interface with the operating system, and if you're using the same language used to write the OS, it's a lot easier to do, not to mention being faster. Look at all of the hoops Java has to jump through with the JNI interface to execute native code.

    24. Re:Fixes problems misguided people think C++ has. by dargaud · · Score: 1

      If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

      Well, easy solution: make sure your new language interfaces easily with C and write the interrupt handler in C. Why would you want to use C++ in an interrupt handler anyway ?!?

      --
      Non-Linux Penguins ?
    25. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      More silliness from someone who knows all programming languages but couldn't program himself out of a paper bag in any one of them, no doubt. The "multiple tools in the toolbox" are those things you build with the GP language (like a garbage collector if you need/want one, for example). If you need more than one language, then there is inadequacy in your GP language or your programming skill.

      (Aside: their hasn't yet been a true GP language. Google directly targeted the most purported "GP language" as their supposed competition. I'm a C++ developer and am not going to use Go. I know that most all other C++ developers won't either, because it misses the mark entirely).

    26. Re:Fixes problems misguided people think C++ has. by lennier · · Score: 1

      "the so called "problem" of memory management and exception safety in C++. Simply put, it's NOT a problem"

      Then all these buffer overrun security exploit patches which come down monthly through my WSUS and apt-get are just figments of my imagination?

      Memory safety IS a problem in C/C++. It's probably the #1 reason why botnets exist.

      A language which allows these coding errors on such a massive scale is simply not acceptable for use on the Internet.

      Explicit pointer, memory and thread management is HARD. We have computers to do these things automatically. But our programmers refuse to use languages which let the computer do these things automatically, thinking they can do it better. But the evidence shows, apparently they can't.

      Every C/C++ programmer thinks he's smarter than average and will never make mistakes. But we've got hundreds of thousands of botnetted machines which say otherwise. Let's just take the ego out of it and fix the problem.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    27. Re:Fixes problems misguided people think C++ has. by lennier · · Score: 1

      "eg. a special language that only does GUIs (but really cleanly and easily) but otherwise is only barely Turing Complete."

      And that will work well right up until you realise that you need to do some computation to display your form.

      At which point the language designer's response will probably be to shovel half of C or Lisp or Smalltalk, piecemeal and reinvented badly, into the language, and voila! Yet another general purpose language, except one that's inconsistent with itself.

      Win!

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    28. Re:Fixes problems misguided people think C++ has. by godrik · · Score: 1

      The point of GP is that Go is claimed to be a system programming language. Then if you can not write an OS with your system programming language then it is not a system programming language. But I suspect the Go team was not thinking of that when they characterized it as "system".

    29. Re:Fixes problems misguided people think C++ has. by Anonymous Coward · · Score: 0

      C++ is a static, explicit language. Go is not.

      Just to be clear, Go is statically typed. It just happens to use inferred types a lot in the syntax (though the use of inferred types is up to the programmer -- you can choose to be explicit in your variable types).

    30. Re:Fixes problems misguided people think C++ has. by shutdown+-p+now · · Score: 1

      Because at some point you *do* have to interface with the operating system, and if you're using the same language used to write the OS, it's a lot easier to do, not to mention being faster. Look at all of the hoops Java has to jump through with the JNI interface to execute native code.

      You don't need the same language; you only need type systems which map directly. For example, I can easily call any OS C function from C# with no "JNI hoops", and, in fact, no wrapper boilerplate code at all. I just declare a function as a static extern method with annotations, let the runtime hook it up, and call that:

      [DllImport("libc")]
      public static extern void* fopen(char* s, char* m);

      The above is going to be pretty much as fast as a native call (because in the end, after JIT does its job, that's what it is going to be). And it's possible because C# has raw pointers, structs and unions, so I can directly map anything a C library might be using.

      At the same time, I hope I don't have to explain why writing an UI frontend (which does a bunch of such OS calls in the end) in C# is going to be much faster and easier than doing the same in C...

    31. Re:Fixes problems misguided people think C++ has. by npsimons · · Score: 1

      The problems C++ need fixing are elsewhere.

      How about a standard name-mangling scheme, can we fix that please? Now I know I'm probably about the bazillionth person to bitch about this, but how fucking hard can it be to say "everyone will decorate their names this way so we can link against libraries made by other compilers."? I mean, this wouldn't bother me so much except that Stroustrup actually *encourages* different name mangling in the standard. All props to the man, and I love C++ above C, but WTF was he thinking? I know, I should just get the source/release the source, but sometimes I don't always have that option.

    32. Re:Fixes problems misguided people think C++ has. by fnj · · Score: 1

      Please do not use the meaningless term "C/C++." They are two different (though related) languages. Stroustrup did not develop C++ just to pass the time.

      First, my comment was specifically about C++. If they have memory management problems and exception safety problems when working in standards compliant C++ with working std::string and std::tr1::shared_ptr or boost::shared_ptr, they are not using the language competently. std::string, used properly, CANNOT overflow. The RAII[*] (Resource Allocation Is Initialization) pattern is rigorously safe and practically indispensable.

      C is another thing altogether. It is a good deal more difficult, but still possible, with fully up to date compilers; certainly not in K&R C. I daresay, considering only C and C++, 95% of buffer overflow exploits arise in C code, and the other 5% arise from using C++ in a less than expert manner.

      Those who cannot exhibit competency in these matters may use nanny languages; but that is not good enough for some classes of programming jobs. For the rest, C++ and even C can be used very safely. Would I choose C++ to write a business app? Probably not, but I would most certainly use it for a real time embedded job.

      ~~~~~~~~~~

      [*] http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    33. Re:Fixes problems misguided people think C++ has. by Baki · · Score: 1

      Use C for that, you can link C to many languages for the low level stuff. Most kernels as far as I know are also written in C, not C++).

      You can hardly link C++ to other environments, even not mix binaries from different C++ compilers :(. We had to stick with outdated options of the sunpro compiler w.r.t. partial template specialization because we link to 3rd party C++ binaries we do not have source code from.

      C is fine (for its purpose), but C++ has so many problems (being responsible for a 1mio lines of C++ business application I can say that) that I don't know where to begin.

  19. Maybe C really is "it" for now... by cgenman · · Score: 2, Interesting

    Despite the large amount of enthusiasm for language design, modern mainstream programming languages don't fall far from the C tree.

    Perhaps, like Qwerty, our C-based languages have evolved to be "good enough" for programming needs for the foreseeable future. Make objects, make functions, operate between the two.. sure DVORAK might provide 20% faster typing if you work at it for 3 years, but that's not really enough to warrant the switch. We're unlikely to see a jump again of the size from C to C++ before we hit a major structural change. I had thought the web might be that structural change, but that was well absorbed by extending existing ideas.

    Personally, I just want to see programming languages that are more programmer fault-tolerant. I can type "pizza" into my phone and have Chuck-E-Cheese offer to bake one while I drive over, but if I accidentally type "plaeyrArray" instead of "playerArray," the whole world is clearly on fire and everyone is going to die. Why can't compilers be more intelligent about the types of errors they encounter in routine usage? For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

    1. Re:Maybe C really is "it" for now... by Delwin · · Score: 1

      massively parallel systems may be that structural change... but things like CUDA are filling that gap so maybe?

    2. Re:Maybe C really is "it" for now... by ClosedSource · · Score: 1

      "..sure DVORAK might provide 20% faster typing if you work at it for 3 years, but that's not really enough to warrant the switch."

      Sure, if you're typing code, but if you were typing documents it would be a big advantage. I don't know where you get the 3 years idea - DVORAK is much easier to learn than QWERTY.

    3. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      Why can't compilers be more intelligent about the types of errors they encounter in routine usage?

      Ummmm... I don't think it's a good idea to let the compiler "fix" misspellings in my code. Will it change "plaeyrArray" to "playerArray" or "payerArray"? I don't see anything wrong with just reporting an error.

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      Aren't you confusing elements of language syntax with visual formatting? I think some languages use indentation for defining functions and whatnot but it seems like a bad idea. to me. Would 6 spaces mean the same thing as a tab and 2 spaces? Would the program change operation if I format it to print the source differently? Yikes!

      PS. Isn't using var names like "xxxArray" considered poor form? It brings back bad memories to me of 1980's Windows programming, heheheh!

    4. Re:Maybe C really is "it" for now... by Rockoon · · Score: 1

      "playerArray,"

      I for one welcome our new Dyslexic Hungarian overlords.

      --
      "His name was James Damore."
    5. Re:Maybe C really is "it" for now... by Toonol · · Score: 3, Informative

      why are we still defining code chunks via brackets instead of the indentation that's already there?

      Because enforcing strict rules about indenting and how it's interpreted is more oppressive and error-prone than using brackets? I agree with your FIRST paragraph...

    6. Re:Maybe C really is "it" for now... by Rockoon · · Score: 1

      Indeed.. sometimes its best to also indent based on non-language semantics, such as resource allocation and deallocation. Open and Close, Alloc and Free, and so on.

      --
      "His name was James Damore."
    7. Re:Maybe C really is "it" for now... by Imagix · · Score: 3, Informative

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      Are you insane? Have you ever written a parser? And being dependent on particular whitespace is really asking for trouble. Now, are those tabs or spaces? How many spaces? One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

    8. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 2, Insightful

      if I accidentally type "plaeyrArray" instead of "playerArray," the whole world is clearly on fire and everyone is going to die.

      I know what you're saying, but I think the answer is broadly that you might have meant plaeyrArray. Every so often xkcd nails one, and there's one that says "You'll never find a programming language that frees you from the burden of clarifying your ideas." It's because computers will do anything that you ask them to that you have to be so specific. And I'm sure you know that, but it's worth pointing out. Language designed to be easy, like VB, end up being almost unusable for certain tasks because their treatment of basic stuff creates lots of little edge cases. Is this a zero or a null? I don't know...what does the language think it should be in this context?

      PHP is pretty tolerant of little faults, but it's also a huge mess. I haven't used it a whole lot and just recently found out my program's been logging warnings like crazy because I didn't initialize a variable, but PHP only warns you over this. Not the end of the world, but I find it annoying. It's more important for a language to be consistent, I think...when you try to make it "intuitive" you end up with a subjectivity problem. Everyone has a different mind and they all want you to read them. Then the next guy (probably me) says "why in the hell would it work like THAT?". But consistency can be quantified.

      Why can't compilers be more intelligent about the types of errors they encounter in routine usage? For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      I'm not being facetious when I suggest that you immediately play around with Python. It's not just the whitespace thing, but it happens to be indicative of why Python's such a joy. You're already delimiting spaces with an LF character, so aren't you just repeating yourself with a semi-colon? Of course you are. Taking it further: in Python you can still put two lines of code in one line of text, just like any other language, and you can also break one line onto two. But it's treated as the exception (which it is), rather than the rule, and for things not already enclosed in parentheses, you break them onto two lines by (wait for it...) escaping the LF! I dunno, there's something about that that just makes me smile. Python is full of neat little things like that.

      Not to mention an extensive standard library with the documentation baked in, built-in debugging and profiling tools, and an interactive prompt for testing out one-liners and reading the docs. It doesn't seem like it at first but you end up missing the prompt dearly when you code in other languages.

      Obviously language syntax isn't, or shouldn't be, a dealbreaker, and Python already gets too much press for being a language where whitespace matters when that's not a big deal, so please don't misunderstand my reason for bringing it up. I just find that it's representative of the whole picture: Python makes things simple that should be simple, but not by being inconsistent.

    9. Re:Maybe C really is "it" for now... by 4D6963 · · Score: 1

      What? You're main problem is typos?? I code in almost nothing but C and love it, the C specification is great, but the implementation not so much. What I mean is that my debugging consists mostly of trying to improvise ways to catch memory corruption, things written where they shouldn't be written. Nothing will warn me that I'm writing outside the bounds of an array, and the few tools that are supposed to do this do this awfully unreliably. Why can't some tool just throw some warnings my way when I free an array twice, when I forgot to free an array but dereference it, go out of bounds or catch a SIGFPE?

      So yeah, C is lovely, but I'd REALLY love it if things were made easy to systematically find out what's wrong with your code, instead of waiting until you get enough sufficient crashes that you often cannot even catch with your debugger, and when you do that's of no help because your program called a function it really shouldn't have right out of nowhere becomes at some point earlier (God knows where) the program wrote something where it shouldn't have.

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      Again, hardly my main complaint with C, I know what you mean, but I can see an issue with that. I often copy chunks of code from a place to another and don't fix the indentational offset, so if things worked like this that'd wreak havoc. Plus, everyone has their own indentation style, so it's best if these thins don't matter to the compiler.

      --
      You just got troll'd!
    10. Re:Maybe C really is "it" for now... by shaitand · · Score: 2, Insightful

      Not if you already know QWERTY... or use computers you don't own on a regular basis.

    11. Re:Maybe C really is "it" for now... by Roy+van+Rijn · · Score: 1

      What you are describing isn't really a language thing, its more the IDE or compiler. Sure we could use smarter compilers and/or IDE's. For example when you forget a semi-colon in Java the compilers are smart enough to point out the exact location... but it doesn't fix it. Probably because it wants you to learn and correct your code...?

      I'd rather have very smart tooling which gets to know me and corrects me. A bit like Spring Roo works in Java, a genie which just assists you. But I imagine something even smarter, like you said, on the fly typo-correction, but also using the knowledge other tools have, like FindBug, detecting (possible) coding-errors while writing them. Maybe auto-generate certain structures that are used a lot.

    12. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      It's probably not the one you're thinking of, but Occam uses indentation to mark out blocks. Two spaces, to be precise.

    13. Re:Maybe C really is "it" for now... by glwtta · · Score: 1

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      For someone who's apparently half way through his first "Intro to Programming" class, that's a pretty bold leap into the Holy War.

      (for the record: some of us like brackets - get over it)

      --
      sic transit gloria mundi
    14. Re:Maybe C really is "it" for now... by rfreedman · · Score: 2, Insightful

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      Like in Python?

      The reason that I still like my curly-braces is that I don't want the meaning of my code to change just because somebody (me?) changed the whitespace.

    15. Re:Maybe C really is "it" for now... by gbjbaanb · · Score: 1

      1. run it through valgrind of purify.

      2. use a C++ compiler and change your code to be 'better C' using it - ie use a few pieces of C++ that provide a benefit. Once you've used the STL containers you'll be happier and you'll have far less memory corruption issues.

      3. Change your programming style, pointers and direct memory access isn't a good style to use in the first place.

    16. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      Yes, I've written a parser.

      Why are we still defining code chunks via brackets? Because we're fucking idiots, apparently.

    17. Re:Maybe C really is "it" for now... by WuphonsReach · · Score: 1

      One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

      FORTRAN (GOD is real)

      Which was (and is) an interesting language for doing math and fractals. I learned how to use and abuse the VAX scheduling system to batch up my fractals for late-night when nobody was online.

      --
      Wolde you bothe eate your cake, and have your cake?
    18. Re:Maybe C really is "it" for now... by wideBlueSkies · · Score: 1

      I wonder how many times Guido has had to bear listening to that complaint about Python...

      Not that I disagree, I dislike the tab based definition too..brackets defining blocks just works.

      --
      Huh?
    19. Re:Maybe C really is "it" for now... by parkrrrr · · Score: 1

      That'd be Fortran. Code generally had to start in column 7. But that had nothing to do with loops or conditional structure. Fortran code isn't generally indented to show structure. After all, it was hard to write; it should be hard to read. (More reasonably, since code is limited to columns 7-72, there's not much space to be wasted on frills like indentation.)

    20. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 1, Informative

      That's strange. In the 5 years of Python coding I've never ever had problems with indentation.
      So I think it's just prejudice.

    21. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      >One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

      You're talking about glorious Fortran, the language of the old Gods

    22. Re:Maybe C really is "it" for now... by Just+Some+Guy · · Score: 1, Interesting

      The reason that I still like my curly-braces is that I don't want the meaning of my code to change just because somebody (me?) changed the whitespace.

      The reason that I now like my whitespace is that I don't want the meaning of my code to change just because somebody (me?) changed the curly-braces. In other words, it's nothing but personal preference.

      --
      Dewey, what part of this looks like authorities should be involved?
    23. Re:Maybe C really is "it" for now... by schnablebg · · Score: 1

      Personally, I just want to see programming languages that are more programmer fault-tolerant. I can type "pizza" into my phone and have Chuck-E-Cheese offer to bake one while I drive over, but if I accidentally type "plaeyrArray" instead of "playerArray," the whole world is clearly on fire and everyone is going to die. Why can't compilers be more intelligent about the types of errors they encounter in routine usage?

      Try an editor with auto-completion.

    24. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      I'am using DVORAK, you insensitive clod! And I don't do it because it is fast, but because I'm lazy like hell! (and like to avoid RSI).

    25. Re:Maybe C really is "it" for now... by pwfffff · · Score: 1

      COBOL

    26. Re:Maybe C really is "it" for now... by gbjbaanb · · Score: 1

      I'd rather have very smart tooling which gets to know me and corrects me

      really?

      Hi. you seem to be writing an application. Would you like help with that?

    27. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      IBM's RPG language was fixed format columns until version IV offered a "free format" option. If you never had to experience this kind of programming then be very thankful.

    28. Re:Maybe C really is "it" for now... by ClosedSource · · Score: 1

      Actually, I know one person who can go back and forth between them successfully.

    29. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 1, Informative

      Python has significant whitespace, I love it, the only problems I ever have with it are if I have a clause that is too long (and should really be made its own function) that I have to 'unindent' correctly, python recognizes the difference between 3 and 4 spaces as significant, so it can be annoying at times.

      Personally, I like that the language forces me (and others) to indent properly, I do just wish that the IDEs for it tended to allow for changes of indentation (our work standard is 3 spaces, the official python standard seems to be 4, it is a pain to switch manually, and I just haven't wanted to build a converter myself).

    30. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      Having have to use whitespace for code blocks in python is one of the most hated feature i have to tolerate when writing python. It takes away my freedom NOT to use whitespace, when i want to have compact, generic, easy to copy-paste code chunks which are not worth creating a library.

      Other features which I hate, are non-assignable expressions and vaguely defined locality of variables.

    31. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      python...

    32. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      FORTRAN.
      1-5 are statement labels for GOTOs & Co, 6 is line continuation, 7-73 is for code, 73+ is ignored (can be comments).

    33. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      Ever looked at python?

    34. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      python does this:
                      I do not want to start another war
                    I won't state my opinion

    35. Re:Maybe C really is "it" for now... by fph+il+quozientatore · · Score: 1

      You know, I am desperately trying to forget about FORTRAN too.

      --
      My first program:

      Hell Segmentation fault

    36. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      *cough* Python *cough*

    37. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

      That would be FORTRAN 77, which also limited lines to a total of 80 characters although line continuation was supported. This restriction was removed with Fortran 90 which supports free form code.

    38. Re:Maybe C really is "it" for now... by T.E.D. · · Score: 1

      Ah yes. That language was called Fortran, children.

      Gather around the campfire now, and I'll tell you a really scary story about computed gotos.

    39. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      Cobol, young grasshopper

    40. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      That makes one ;)

    41. Re:Maybe C really is "it" for now... by 4D6963 · · Score: 1

      Valgrind only works on Linux, I only dev for Windows and Mac OS X. And it has its shortcomings, it doesn't always work right.

      --
      You just got troll'd!
    42. Re:Maybe C really is "it" for now... by codecore · · Score: 1

      Fortran IV

    43. Re:Maybe C really is "it" for now... by gbjbaanb · · Score: 1

      That's why I suggested Purify too...

    44. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      Lots of older languages were "fixed form", most notably probably Fortran. It made some level of sense at the time since the formatting was designed for punch cards.

      Indentation-delimitted code is not hard to parse. Python, for example, is actually extremely easy to parse, and the rules for how indentation works are quite simple and consistent. There are some problems (as lots of systems do dumb things to your whitespace), but it's not going back to Fortran 77 and it's not hard to parse.

    45. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      FORTRAN has to start on column 7 if that's what you mean. (Also columns 1-5 are for line numbering used with GOTO, column 6 is for the line continuation marker, and columns 73-80 were used to label your punch cards so if you dropped them it wasn't the end of the world -- columns 85+ didn't exist since the punch card is only so large).

      One of the biggest problems I've encountered with this is that if you use tabs, then it depends on your compiler to decide how many columns tab is. Some compilers will treat it as 6 at the start of the line then 7 elsewhere, then you load it in another compiler which interprets them all as 8 and suddenly you need to rewrite your whitespace -- not fun.

    46. Re:Maybe C really is "it" for now... by PeanutButterBreath · · Score: 1

      Like in Python?

      The reason that I still like my curly-braces is that I don't want the meaning of my code to change just because somebody (me?) changed the whitespace.

      Put a tiny amount of time into configuring your code editing environment and this is a practical non-issue. Its not like curly-brace languages are impervious to sloppy coding.

    47. Re:Maybe C really is "it" for now... by lennier · · Score: 1

      "For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?"

      Because even in 2009, there *still* isn't widespread, pervasive standardisation - to the point where you can absolutely, totally, 100% guarantee that your code won't get mangled in translation - of what the codes for 'indentation' are. Indentation is whitespace - and by definition, in many coding guidelines and Internet transfer protocols, whitespace is fair game for destruction. Until or unless this situation changes, you simply can't guarantee that whitespace is totally system-portable.

      Snap exam time: how many spaces in a tab stop? If I type that many spaces, is it the same as a tab or different? Does it look visually different? Does it look different on a printout? If I type it from eye from a magazine or a textbook, will it compile and parse EXACTLY the same?

      Is CR the same as LF?

      And is that always the case?

      On Linux? On Windows? On MacOS? On a mainframe? On an iPhone? On a Palm? On a CE device? On a set-top-box? In SMTP email? In a GUI text box widget? After copy-paste? After In a HTML browser? In XML? In WhateverFancyGadgetDuJour 2030? 2050?

      You quite sure about that?

      Brackets, however, are always and forever brackets, unmangled in translation, until the end of the Net. Amen.

      There's your answer.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    48. Re:Maybe C really is "it" for now... by lennier · · Score: 1

      "One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment"

      FORTRAN and COBOL both did this.

      In the days of punched cards with strict columns and no proportional bitmap fonts, it was a bit easier to manage, I think. But still evil.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    49. Re:Maybe C really is "it" for now... by 4D6963 · · Score: 1

      I'll make sure to try that.

      --
      You just got troll'd!
    50. Re:Maybe C really is "it" for now... by Anonymous Coward · · Score: 0

      For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

      One example: The syntax for defining function literals on-the-fly (e.g. as parameters to another function) is much easier to define.

  20. GoLibs? by Anonymous Coward · · Score: 0

    Or maybe we should drop the term "Library". M$ probably has it trade marked. I vote GoNads!

  21. Instant Language Build-O-Matic by Tablizer · · Score: 4, Funny

    Joy, yet another programming language :-) Programming languages are personal. We all have our favorite way to do things and most of the choices are subjective preferences. At c2.com we played around with the idea of a Build-To-Order form to generate a compiler/interpreter for a language with the combination of features you ask for. Below is a rough re-creation of the form:

    -----INSTANT CUSTOM LANGUAGE FORM-----

    (Features in each group are mutually-exclusive if they have round brackets, but not if square brackets. )

    Compile Level

    * (__) Compiled: product of language targeted to direct run by a machine (possibly a virtual machine) or operating system.
    * (__) Interpreted: language is processed as data by a process called an interpreter, especially in some sort of ReadEvalPrintLoop. May support a hidden JustInTimeCompilation, but that should be considered an implementation detail rather than a language detail.
    * (__) Both but select on Program: language allows programs to be written for scripting or written for compilation, but programs written for compilation might not work for interpretation (e.g. due to late-binding dependencies) and programs written for interpretation might not work for compilation (e.g. due to top-level commands). This provides a lot of flexibility. However, it also partitions the user community because sharing will be difficult.
    * (__) Both for any Program: language ensures that every program is suitable for both compilation and interpretation. Supporting interpretation requires abandoning a model of external linking and requires ensuring the syntax is suitable for one-pass reading (i.e. preprocessors are a bad thing). Suitability for compilation implies abandoning (or at least distinguishing) imperative commands at the toplevel: those that are to be executed at compile-time vs. those that are to be executed at runtime.

    Model for Linking and Modularity

    * (__) No Linking: product is always fully declared from a single page or file. No linking occurs. There is no model for modularity. Many EsotericProgrammingLanguages have this model. Support for CompileTimeResolution may provide an interesting workaround.
    * (__) Includes: product may 'include' other pages, which are linked in place. There might be a system to selectively avoid duplicate includes. All pages are effectively parsed with each compile or execution.
    * (__) Single Page, Modular: language semantics allow 'importing' or 'loading' of other components. Allows useful optimizations such as compilation of components... or at least preprocessing and pre-parsing, of language components, because the semantics of the 'import' are held independent of the page into which it was imported.
    * (__) External Linking: a linker can combine a product by pulling multiple components together, but does so from outside the language. This model is incompatible with interpretation, and offers no real benefits over the 'Single Page, Modular' model except that it can be hacked into a language that doesn't have a concept of modularity (as was done for CeeLanguage).

    Modularity and Linkage Features

    * [__] Resolution of Circular Dependencies: the language or linker will correctly handle circular dependencies, ideally with minimal reliance on forward declarations.
    * [__] Provisionals and Overrides: the language allows you to override global objects, values, or procedure that are declared in other modules in a manner such that those other modules use the overrides, too. Ideal form would be as though they had always used the override, but this ideal form is somewhat difficult to reconcile this feature with interpretation.
    * [__] Inverted Constructs: one can automatically bui

    1. Re:Instant Language Build-O-Matic by 5pp000 · · Score: 1

      Wow, that's a great list! I multiplied out all the options (under the assumption that all combinations are valid (*)) and got 2.8e40 possible languages that could be specified using this form. That's a lot more than Peter Landin's 700!

      (*) Except that I noticed two options in the Collections category -- the fourth and the last -- that appear redundant; so I counted only one of them.

      --
      Your god may be dead, but mine aren't!
    2. Re:Instant Language Build-O-Matic by 5pp000 · · Score: 1

      got 2.8e40 possible languages

      The exact number is 28038403036088069194064680177788518400000. This reminds me -- arbitrary-precision integers should be an option in your list!

      --
      Your god may be dead, but mine aren't!
  22. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    C++ standard library has string class. Somehow most C/C++ coders has this strange fixation to write everything from scratch. Thanks to them it data type conversion hell every time when you use two or more libraries in your project.

  23. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 1, Informative

    C++ come on it didn't even have a string class. Thus pointer math hell.

    I'm not going to suggest you should use C++ but seriously, can you at least use real criticism? What is std::string then?

    And no, "that was only added in 1995" doesn't count as a criticism since C++ was not defined as an ISO standard until 1998 and std::string has been there ever since.

  24. Holy Shitbags Binaries Are Static And *Huge* by FrankDrebin · · Score: 4, Interesting

    $ cat hello.go
    package main

    import "fmt"

    func main() {
    fmt.Printf("hello, world\n")
    }
    Size of resulting binary: 581054 bytes on x86 Linux.

    --
    Anybody want a peanut?
    1. Re:Holy Shitbags Binaries Are Static And *Huge* by michaelmuffin · · Score: 1

      Holy Shitbags Binaries Are Static And *Huge*

      but they fork faster. try it: http://9fans.net/archive/2009/02/422

    2. Re:Holy Shitbags Binaries Are Static And *Huge* by Anonymous Coward · · Score: 0

      Did you check if the compiler inserts debug code by default into the executable?
      Anyway, being this one a new language I guess they still have to do some work on code optimization, let's hope one year from now the binaries get smaller.

    3. Re:Holy Shitbags Binaries Are Static And *Huge* by Anonymous Coward · · Score: 0

      Doesn't beat C @ Size:8294 Bytes

    4. Re:Holy Shitbags Binaries Are Static And *Huge* by Cthefuture · · Score: 4, Informative

      Uh, so they don't have a dynamic linker yet. Consider this:

      $ cat hello.c
      #include

      int main(int argc, char* argv[])
      {
            printf("Hello, world!");

            return 0;
      }

      $ gcc -O2 -static hello.c

      a.out is 688272 bytes (x64_64 Linux)

      Until they have a dynamic linking system, who knows.

      --
      The ratio of people to cake is too big
    5. Re:Holy Shitbags Binaries Are Static And *Huge* by hansamurai · · Score: 1

      In Java it was 519 bytes.

      public class Hello
      {
          public static void main(String... args)
          {
              System.out.println("hello, world");
          }
      }

    6. Re:Holy Shitbags Binaries Are Static And *Huge* by Logic · · Score: 1

      And how big was the runtime you needed to actually execute it?

      --
      -Ed Felix qui potuit rerum cognoscere causas.
    7. Re:Holy Shitbags Binaries Are Static And *Huge* by roydeboer · · Score: 1

      But your a.out still contains symbols, try running strip and (in my case) the size of a.out went down from 626K to 554K. Still large, though.

    8. Re:Holy Shitbags Binaries Are Static And *Huge* by Cthefuture · · Score: 1

      Yeah, I did strip my first test but forget on the one I posted because there wasn't much difference. On x86_64 the difference was negligible.

      gcc -O2 -s -static hello.c

      611280 bytes

      --
      The ratio of people to cake is too big
    9. Re:Holy Shitbags Binaries Are Static And *Huge* by acheron12 · · Score: 1

      Have you tried stripping the binary?

      --
      there is no god but truth, and reality is its prophet
    10. Re:Holy Shitbags Binaries Are Static And *Huge* by Anonymous Coward · · Score: 0

      More like 567kB, you idiot.

  25. more languages than programmers by OrangeTide · · Score: 2, Insightful

    It's simple. It's a lot of fun to design and even implement your own programming language. It is not too hard, depending on how big of a problem you choose to bite off with your language. And then there are the oohs and ahhs you get from other developers when you have implemented a language, especially if it compiles to some real or virtual architecture.

    Too bad learning to use a programming language effectively is a lot of work, and is usually pretty frustrating. It has been easy for me to find the time and energy to implement my compiler. But I totally don't have the time to learn C++, Haskell, Python, OCaml, Ruby, PHP, Perl, et cetera.

    As a developer, and I realize this is a very silly and irrational, I tend to avoid using programs written in languages I don't understand. True, I almost never look at the source for the program. But take Gentoo emerge for example. The fact that it is written in Python instead of C, awk, shell script, Tcl, Lua, or Java is mainly why I don't run Gentoo.

    --
    “Common sense is not so common.” — Voltaire
    1. Re:more languages than programmers by Tablizer · · Score: 1

      I tend to be more interested in collection-oriented languages such as SQL, relational query languages, xBase (dBASE), and the APL derivatives. It's an under-explored area relative to app languages.

    2. Re:more languages than programmers by rrohbeck · · Score: 1

      And then there are the oohs and ahhs you get from other developers when you have implemented a language, especially if it compiles to some real or virtual architecture.

      I thought everybody did this around the fourth semester.

      Designing and implementing a language is easy. Designing a good language is hard.

      Each time I bang out a module in C++ I think about how much easier all this would be in Perl. Hopefully we'll have static compilation into efficient code for Perl6 one day. I can't wait.

    3. Re:more languages than programmers by mal0rd · · Score: 1

      As a developer, and I realize this is a very silly and irrational, I tend to avoid using programs written in languages I don't understand. True, I almost never look at the source for the program. But take Gentoo emerge for example. The fact that it is written in Python instead of C, awk, shell script, Tcl, Lua, or Java is mainly why I don't run Gentoo.

      I agree with most of your post, but Python, C, Lua, and Java are so similar, you shouldn't have any trouble reading through python code if you know one of the others. Especially with a searchable manual by your side.

      Hacking on emerge would be harder, but all these langs are basically interchangable. If only they shared a reasonable ABI and VM so they could be mixed freely. But we are stuck with bloated crap like Java and Mono.

    4. Re:more languages than programmers by shaitand · · Score: 2, Insightful

      "is mainly why I don't run Gentoo"

      Fascinating. Personally I don't run Gentoo because compiling the entire system takes more extra time than the added performance saves me over the life of the install.

    5. Re:more languages than programmers by Joce640k · · Score: 1

      I'm not sure SQL counts as a programming language

      Similarly, HTML also has an 'L' in the name but I don't count that either.

      --
      No sig today...
    6. Re:more languages than programmers by wdef · · Score: 2, Insightful

      Do we *really* need more languages? At university I learned Fortran, Pascal, Assembly, all of which stood me in good stead for later learning and have never really gone away. I had just got competence with Perl when I worked out that the many young developers use nothing but Python for things that I would use Perl for. I enjoy Perl. But if I want to go deeper into programming in certain areas, I will have to learn Python. I know Python has certain advantages and is probably easier to read but Perl is enormously powerful and fun. I taught myself C by doing various hobby projects sporadically over a year or two. You can see the bottom (or the end of the tunnel) with C since it's a simple language with few features but is difficult to use properly. Gradually you get more craft. Tried starting C++. What a mess. It's no wonder a guy I work with, one of the best C programmers in his field in the world, absolutely *hates* C++, as does Linus Torvalds. I mean, did they really make this mess on purpose? Apparently so. Learning a programming language properly is a real commitment. Some are easier than others. The case for this damn Google language needs to be pretty darn convincing before I'm going to even look sideways at it. Mere buzz words and fashion is not enough anymore. It just takes too long to take on YAS (Yet Another Syntax).

    7. Re:more languages than programmers by Joey+Vegetables · · Score: 1

      I am happy to compile most of Gentoo as needed (mostly in the background while doing other things) because I can mostly escape dependency hell this way, while preserving the ability to try various pieces of software that aren't in the Portage tree. It has nothing to do with performance, for me at least; I agree that the time spent compiling tends to negate much of the speed advantage, but it's well worth the ability for things I've installed, both inside and outside Portage, to mostly "just work" and for me to be able to upgrade according to my own needs and schedule.

      As for it being in Python, to me that is a feature, not a bug. I've spent much of my working life developing and maintaining software, and in my view Python's strengths, such as readability and "batteries included" philosophy, lend themselves to solid software development and lifecycle management practices. I don't often find a need to tweak an ebuild and I've never written one myself, but I'm very confident that if I ever do need to for some reason, I can. I'm confident that any Python code I find I will be able to read and understand, and I can't say that about most of the other languages I've used over the years. And on any project where I have my choice of tools, it is almost always Python + C. I'm not expert in either, and I know many others, but I've rarely encountered a task that could not be done in an efficient and maintainable fashion using some combination of these two.

    8. Re:more languages than programmers by Ant+P. · · Score: 1

      But take Gentoo emerge for example. The fact that it is written in Python instead of C, awk, shell script, Tcl, Lua, or Java is mainly why I don't run Gentoo.

      That can't possibly be the real reason, unless you don't understand C++ either.

    9. Re:more languages than programmers by OrangeTide · · Score: 1

      I think Python is way different in terms of syntax than C and Java, but maybe it's just superficially different and I have a mental block about it. But mostly I have trouble with the APIs, figuring out what libraries/modules to include and what functions to use and what their parameters and datatypes are takes a while to learn. It's the difference between learning the grammar for a language and learning the complete vocabulary.

      --
      “Common sense is not so common.” — Voltaire
    10. Re:more languages than programmers by OrangeTide · · Score: 1

      I build embedded Linux systems for a living, so compiling the entire universe is normal for me. That said, I don't buy the Gentoo sales pitch of gaining performance by switching on optimizations. But compiling everything to have the latest versions or being able to twist various compile-time knobs of many of the packages can be valuable.

      --
      “Common sense is not so common.” — Voltaire
    11. Re:more languages than programmers by OrangeTide · · Score: 1

      I totally don't do C++. I have a religious aversion to the C++ language and C++ developers. I have been known to kick developers off my team for writing too much C++ code in a C centric project. (although there is a rational reason for that)

      --
      “Common sense is not so common.” — Voltaire
    12. Re:more languages than programmers by shaitand · · Score: 1

      In the background? Admittedly the last time I used Gentoo I had a state of the art P4 and a gig of ram but getting up to the desktop literally took three days worth of compiling.

      There was a choice to use some precompiled base binaries that would have sped things up some but that sort of defeats the point.

      I could see the use if you need bleeding edge packages. But if you are willing to wait a month for them they just work in Ubuntu with a binary package system.

    13. Re:more languages than programmers by Tablizer · · Score: 1

      I think you mean does it count as an "application language". That's a sticky definition issue. Declarative work is still work, and can replace imperative code.

    14. Re:more languages than programmers by Rich0 · · Score: 1

      There was a choice to use some precompiled base binaries that would have sped things up some but that sort of defeats the point.

      If you're just going to install using the defaults then you have no benefit from not using the canned binaries. Even if you are, just install the canned binaries and do a rebuild in the background while the system is otherwise productive.

      Gentoo does have some performance benefits, but most of the benefits are the ability to run almost any combination of libraries and packages desired.

      For example, suppose you have some program that doesn't like the latest glibc - then you don't install the latest glibc. If you tried that on ubuntu then none of your other packages would work, as they are all linked against a specific version of the library.

      Sure, it can be annoying sometime to have to wait to use a new program while it builds, but for the most part compiling takes place when you aren't otherwise using the computer, but the benefits come when you are using it.

      It isn't the best option for everybody, but Gentoo does have a few unique benefits that you won't find elsewhere. Like everything, it has its place...

    15. Re:more languages than programmers by j1m+5n0w · · Score: 1

      Do we *really* need more languages?

      We need as many new languages as it takes in order to get languages that actually work well for the jobs we need them to do. One of the reasons we have so many languages is that users are dissatisfied with current languages, so they roll their own. And it isn't just that the old languages were good at one thing, but bad at something else so we needed new tools to solve new problems. Many languages in common use aren't even very good at the things they're most commonly used for.

      C basically works, but any moderately complicated C project inevitably turns into a huge project with many man years of effort to find all the bugs, most of which would never have gotten past a reasonably strict type checker. I'm pleased to see that C may get some serious competition from a language with modern features (like type inference and type safety) that may make it much easier to write high quality, fast, low-level code.

    16. Re:more languages than programmers by lennier · · Score: 1

      "I'm not sure SQL counts as a programming language"

      Right, it's not Turing-complete... but what if we added stuff so it was? So you could say 'select * from blah where (and-now-a-function-occurs)'? And then export that as a function and store it in a table? And built an entire world out of nested tables?

      SQL (or rather, relational theory) does some things amazingly right which the rest of the programming universe has still to even notice. But it's crippled itself by not choosing to become a real language.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    17. Re:more languages than programmers by shutdown+-p+now · · Score: 1

      We do need more new languages, because our present mainstream languages have been designed quite a while ago, and type theory and other "academical" things have advanced since then. What's worse is that some of the mainstream languages (Java is a particularly bad offender) ditched a lot of past improvements for the sake of dumbing down the language to be easier to learn.

      We do not need all kinds of new languages, however. Definitely not another rehash of the existing Lego bricks (static vs dynamic typing, class vs prototype OO, etc). We need languages that explore new theoretical concepts, so we can see which ones of them are actually viable in real world, and how to make them most presentable and easy to use.

    18. Re:more languages than programmers by wdef · · Score: 1

      *Really* was rhetorical. I was saying that a new language has to prove its worth in the field before I put several hundred hours into learning it. I'm not against experimentation and exploration in the academy. But I want to know that a language already has proved itself. I'll leave farting around with experimental languages to those who enjoy farting around with experimental languages.

  26. "Go" name already taken for programming languages by qw0ntum · · Score: 5, Informative

    This fellow has been working on his own programming language, also called "Go", for a decade. Even released a book about it. He filed an issue in the tracker for the Google language: http://code.google.com/p/go/issues/detail?id=9

    --
    'Every story, if continued long enough, ends in death.' --Ernest Hemingway
  27. Well said by CarpetShark · · Score: 1

    I was just about to bemoan the naming, which conflicts with Go (the board game), which is already difficult enough to google. The fact that it's GOOGLE making this mistake is pretty bad. On the other hand, maybe they'll fix the bug in their search engine now, and make it easier to google both :)

    1. Re:Well said by Anonymous Coward · · Score: 0

      Search: Go programming language
      Search: Go board game

      Unless the site you want is a programming site with a forum about the board game then this should work perfectly well with Google Search.

    2. Re:Well said by shawnmchorse · · Score: 1

      With the board game you basically have to search for the Chinese and/or Korean name equivalents instead, which are "weiqi" and "baduk". Perhaps Google Asia can can come up with different names that people can actually search for also...:-)

    3. Re:Well said by CarpetShark · · Score: 1

      No, that doesn't work. To google, you use the words people mention when talking about something. When people say, "here's how to do code exceptions in Go", they're not going to tack on "(meaning Go, the programming language)" every time, so your method filters out lots of valid results.

    4. Re:Well said by CarpetShark · · Score: 1

      Yeah, that's the best I've come up with. It would be nice if Google could detect the conceptual link between things like weiqi and Go, and return results for either, a bit like how it does word stemming (although I hate it when google does that by default).

  28. Lightweight languages do not remain lightweight. by reporter · · Score: 5, Insightful
    Ars Technica writes, "A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop."

    If this language becomes as popular as Perl, then 120,000 lines will soon become 1,200,000 lines. That is exactly what happened to the Perl interpreter and compiler.

    Also, just like Java, the new Go language (due to the immense respect for Google's scientific prowess) will likely receive accolades: "it is the best, final language that we will ever need". The same was said for Java. It was sold as the ultimate final language built on 50 years of accumulated knowledge of language design and computer architecture. Upon the introduction of Java, company after company blindly adopted it.

    Was Java the final language satisfying humankind's computing needs? No. Was adopting it worth the cost? Maybe.

    Now, we have Go. Is it a massive improvement over C and Java, thus justifying spending milions of dollars to train programmers? Only the future will tell.

  29. Re:C++ incomplete. C# windoz. Java slow elephant. by CarpetShark · · Score: 1

    Somehow most C/C++ coders has this strange fixation to write everything from scratch.

    That's probably because the C++ standard library isn't so easy to remember.

  30. No Exceptions?! by CarpetShark · · Score: 2, Insightful

    tl;dr yes, it has goto

    But apparently not exceptions? It sounded good in theory. Lack of assertions was going to bug me. Lack of exceptions and try...finally blocks is most likely a deal-breaker. I'll read the thing in detail at some stage and see if they provide a decent alternative though.

    1. Re:No Exceptions?! by ipoverscsi · · Score: 1

      One of the key problems with Exceptions is that they tend to violate security models.

      It is probably not common knowledge that C++ exceptions on the Windows platform are implemented using Structured Exceptions, an exception mechanism built into the Operating System that works even in C. I suggest reading up on Structured Exceptions if you are not already familiar with them.

      Let's say you have implemented a Windows Service in C++, and that at some point you change your thread's security token. Changing a thread security token is usually done to perform an action on behalf of a client using the client's credentials. Unfortunately, the Structured Exception system has no idea that you have changed the security token of your thread. If an action performed on behalf of the user while using the user's token throws an exception that is not caught within the scope of the function that altered the thread security token, well, congratulations! you've just violated your security model. Why? Because the exception handler that does catch the exception is in a parent scope and is now executing with the user's security token and not the original security token of the process. At best this means your exception handler may fail to work, and worst it can lead to a privilege escalation.

      And, no, using catch(...) is not a valid way of solving this security problem.

  31. Found it... by CarpetShark · · Score: 3, Insightful

    Found confirmation of this in Go's "Language Design FAQ":

    Why does Go not have exceptions?

    Exceptions are a similar story. A number of designs for exceptions have been proposed but each adds significant complexity to the language and run-time. By their very nature, exceptions span functions and perhaps even goroutines; they have wide-ranging implications. There is also concern about the effect they would have on the libraries. They are, by definition, exceptional yet experience with other languages that support them show they have profound effect on library and interface specification. It would be nice to find a design that allows them to be truly exceptional without encouraging common errors to turn into special control flow that requires every programmer to compensate.

    Like generics, exceptions remain an open issue.

    So in other words, they left every single user of the language to do it, over and over again, because it seemed like a lot of work for the team to do well, once. Sorry, but that just doesn't cut it.

    As for exceptions increasing control flow compensation... Java had this right; if a function's interface specifies what it throws, then you by definition save yourself a lot of control flow headaches, as you know exactly what calling a function can result in.

    1. Re:Found it... by JohnnyBGod · · Score: 1

      Not really. RuntimeException and its subclasses don't need to be, and often aren't, declared in the function's interface. Still, exceptions are useful and I think a modern language should support them, unless they're going for the embedded space.

    2. Re:Found it... by miro+f · · Score: 1

      except, of course, for those exceptions that don't have to be specifically declared (Array/StringIndexOutOfBounds, FileNotFound, etc etc)

      --
      being vague is almost as cool as doing that other thing...
    3. Re:Found it... by azgard · · Score: 2, Insightful

      Actually, it would be much better if they add signals (like those in Common Lisp) instead of exceptions, as they are more general concept. But I can understand it's hard to see from Java land.

    4. Re:Found it... by Anonymous Coward · · Score: 1, Interesting

      The problem with Java is that the checked exceptions don't include runtime exceptions, so a function "public void foo() { ... }" can still throw. Also, checked exceptions often result in lazy programmers just catching and ignoring exceptions (but maybe that's no different from other languages exceptions). I think it's fairly common to see checked exceptions in Java as a not-so-successful experiment:

      http://www.mindview.net/Etc/Discussions/CheckedExceptions

    5. Re:Found it... by moosesocks · · Score: 3, Informative

      So in other words, they left every single user of the language to do it, over and over again, because it seemed like a lot of work for the team to do well, once. Sorry, but that just doesn't cut it.

      Um. Did you read the text you just quoted? They didn't say anything of the sort!

      To paraphrse: Go is still a work in progress. It is our opinion that exceptions are computationally inefficient, and interfere with concurrent programming. If we implement something similar, we want to do it right the first time around. We are currently considering various methods of accomplishing this, as well as the impact of not implementing it at all.

      This, to me, sounds like an excellent way to design a programming language. Of course, there is going to be some backlash against any language that questions C's status as the "one true language," although most of the items in Go's feature list seem like they should have blindingly obvious in hindsight.

      Also, consider that C++ doesn't implement strings, and leaves the programmer to do it himself. STRINGS!

      (Go, by comparison acknowledges that a single, good string implementation will work for 99.99999% of programmers, while also doing nice things such as supporting UTF-8 out of the box)

      --
      -- If you try to fail and succeed, which have you done? - Uli's moose
    6. Re:Found it... by vivin · · Score: 1

      It depends. Specifying what exception is thrown can break abstraction because every class that implements an interface or an abstract method needs to know about the exception or handle it - all the way down the chain.

      --
      Vivin Suresh Paliath
      http://vivin.net

      I like
    7. Re:Found it... by lennier · · Score: 1

      "supporting UTF-8 out of the box"

      It does? Then why are strings arrays of bytes rather than arrays of Unicode chars?

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    8. Re:Found it... by HiThere · · Score: 1

      The apparent intention is that this be handled via the multiple return values, with one of them able to be allocated to carry any desired error code.

      I'm not at all certain that this is a better approach, but I'm certainly not sure that it isn't. Handling this will be a bother, but so are try-catch-finally blocks. I don't see any real down-side. I think it's just a different approach, and possibly a better one. It's not clearly inferior.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    9. Re:Found it... by shutdown+-p+now · · Score: 1

      Re-invocable continuations - as in Scheme's call/cc - are even more generic (I'm not sure if there's anything any more generic for nonlocal transfer of control, in fact). That said, C++/Java-style exceptions are an adequate implementation of one particularly handy use case, so they have their place.

    10. Re:Found it... by shutdown+-p+now · · Score: 1

      The problem with Java is that the checked exceptions don't include runtime exceptions, so a function "public void foo() { ... }" can still throw.

      It's not a problem with checked exceptions. The problem is that Java actually has runtime exceptions in the first place. And if you think of what those are, it's predominantly either a hard VM fault - which isn't really an "exception" as far as program is concerned - or a null pointer or an array index out of bounds. Both of the latter two are signs of an insufficiently strong type system.

      For null, why is it even a legal value for any reference type? If you'd have to opt into having it, and explicit checks were required before accessing such values (as in ML "option" or Haskell "Maybe" types), nulls wouldn't be a problem.

      Same for array indices: you simply need a type system that verifiably captures the correspondence between array indexer signature, and its type. Scala path dependent types can do this kind of thing, I believe.

    11. Re:Found it... by CarpetShark · · Score: 1

      This, to me, sounds like an excellent way to design a programming language

      The problem is that they've released it, so design-time has passed. This should have been discussed and resolved in a working group before the release. Now, instead, everyone will evaluate the language for what it currently is, develop techniques for what's currently there, and generally establish poor practices because the language google released was inadequate.

    12. Re:Found it... by CarpetShark · · Score: 1

      C++ does have strings in the standard library, for what it's worth. I agree on most of your other points though :)

  32. Hope we don't see unrelated junk coded in Go by Anonymous Coward · · Score: 0

    How many amateur developers will have this plan in their mind?

    1) Code an application in Go language instead of something more fit to that purpose
    2) Host it at Google code
    3) Get hired by Google

    Let me tell you the thing, just like top end Hollywood directors/producers/cast guys doesn't browse IMDB (Pro!) to hire new people, Google owners doesn't browse Google code to pick developers.

  33. Re:C++ incomplete. C# windoz. Java slow elephant. by larry+bagina · · Score: 1

    I learned c++ back before the STL was, er, standard.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  34. Bell Labs roots by Anonymous Coward · · Score: 0

    Altough the FAQ doesn't mention Plan 9 anywhere; the "channels", the C-like syntax and the logo all let me think about this nice OS with his concurrent programming language called Alef, designed by Phil Winterbottom. (Rob Pike and Ken Thompson were very involved in the Plan 9 design). Well, the comparison ends here I guess.

    1. Re:Bell Labs roots by mevets · · Score: 1

      Even the command syntax:

      $ 6g file.go
      $ 6l file.6
      $ ./6.out

      is familiar, plan9 for the 386 was:

      $ 8c file.c
      $ 8l file.8
      $ ./8.out

  35. Re:C++ incomplete. C# windoz. Java slow elephant. by upuv · · Score: 1

    C++ did not have a string class when it first came out. Thus the landscape of C++ code was polluted for ever more with dodgy string classes.

    Note I used "didn't" in my statement.

  36. Why? by alberion · · Score: 1

    I mean, I get the whole we like to do concurrent staff. But does the world really need another programming language? There has been a literal outbreak of new or revamped programming languages in the last few years. Are we seeing now with programming languages what happened to linux distros a while back? If so, what languages will emerge and what will just merge with others?

  37. mod parent insightful by heson · · Score: 2, Insightful

    Finally, a C++ user giving clues for a better C++, instead of the usual ones from non users.

  38. Re:"Go" name already taken for programming languag by malakai · · Score: 2, Insightful

    No, his is simply "Go!" with an exclamation. See: http://portal.acm.org/citation.cfm?id=998367

    Google is screwed, they'll need to change their name for this language or buy this guy off. If they ignore this guy they'll look like a bully.

    It's amazing no one at Google did a search go "Go Programming Language"

  39. Skeptical thoughts by jma05 · · Score: 2, Insightful

    I watched the presentation. It was about time for Google to join the programming language space, but I was not impressed as much as I had been with other Google projects.

    Go is fast: Sure. But compared to what? C and C++? They were never known to be fast compiling languages. Go is still a very simple language. So compilation speed is not impressive, relevant or novel *yet*. I recall from my Pascal (Delphi) days of how blazingly fast the compilations were when the language did not have a pre-processor or generics and had a more strict type system. Once Go gets generics and exceptions, we can see how well it compares to similar modern languages.

    Go is safe: I somehow kept seeing OCaml in a C style syntax in all this despite Go not being functional (perhaps I am just sleepy :-) ). Better type system, garbage collection, optional typing, higher data types. Imperative Ocaml also only takes a minor performance hit compared to C despite providing a much safer language.

    Concurrency: This could be something. The languages with built in support for this are somewhat obscure ATM (Erlang). Hopefully, Go will be more palatable to the mainstream.

    Programming languages are finally more than grammars and compilers. Many excellent languages never make it to limelight. C and C++ continue to be first choice for system software despite the existence of several excellent "language" alternatives. Google brand may help Go with an early boost, but it will be the tools, libraries and the community that will have to deliver it; or we will just have another Java FXScript story in front of us.

    1. Re:Skeptical thoughts by awol · · Score: 1

      Indeed the website for the language is "golang" just as ericsson is to ERlang, google is to GOlang. Seems maybe an OO corollary to erlangs functional paradigm. Will have to look deeper. I do love a new language,

      --
      "The first thing to do when you find yourself in a hole is stop digging."
    2. Re:Skeptical thoughts by Vintermann · · Score: 1

      Erlang isn't named after this guy. It's named after this guy.

      --
      xkcd is not in the sudoers file. This incident will be reported.
    3. Re:Skeptical thoughts by awol · · Score: 1

      Didn't mean to suggest that it was named after him, but rather developed by Ericsson the company, in house. The name is "deliberately ambiguous" according to someone who should know. (http://www.cs.chalmers.se/Cs/Grundutb/Kurser/ppxt/HT2007/general/languages/armstrong-erlang_history.pdf at 3.2)

      --
      "The first thing to do when you find yourself in a hole is stop digging."
    4. Re:Skeptical thoughts by shutdown+-p+now · · Score: 1

      C and C++? They were never known to be fast compiling languages. Go is still a very simple language. So compilation speed is not impressive, relevant or novel *yet*. I recall from my Pascal (Delphi) days of how blazingly fast the compilations were when the language did not have a pre-processor or generics and had a more strict type system.

      Actually, C is in fact one of the most (if not the most) fast-compiling language in terms of raw lines of code. The reason for that is simple: keep in mind that every time you write "#include <stdio.h>", you can easily bring in a few thousand lines of code for that alone. Those compilation speeds you've been seeing with Turbo Pascal/Delphi had in fact most to do with that - it compiles every file separately as a unit, and does not require textual inclusion of definitions for reuse. A "more strict type system" is certainly totally irrelevant, and so are generics (which C doesn't have in the first place).

      C++ is indeed quite a hog - though compiler writers are also pressured to optimize it for the same reason as C, which is multiplied manifold for C++ header-only template libraries such as STL and Boost.

  40. FYI: Array slices by UnderCoverPenguin · · Score: 3, Insightful

    Array slices and mapping types have been around for decades. Not even Perl was the first to provide tham, et alone Python.

    --
    Don't try to out wierd me, three-eyes. I get stranger things than you, free with my breakfast cereal. --Zaphod Beeblebr
    1. Re:FYI: Array slices by glwtta · · Score: 1

      Yeah, I was wondering why common concepts that have been around forever need to be referred to as "Python-like", guess some people have a hardon for Python.

      --
      sic transit gloria mundi
  41. Sponsored by The Power Rangers by Anonymous Coward · · Score: 0

    But wait! "Go Go Google Language" is just the right number of syllables to be the Power Rangers Theme song! Oh no! Curse you the 90s and your many memorable children's shows!

  42. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 1, Interesting

    With google stealing "chrome" and now "go" from others, and their retarded "closure" library, and other example, I have to wonder if google engineers have zero creativity themselves, or if they are just assholes.

  43. "safe" like C/C++!?!?! by Anonymous Coward · · Score: 0

    If they are going to use the word "safety" as an adjective for C/C++ then they seriously have no clue about what makes a programming language "safe" with respect to security and have ignored the last 20+ years of programming language development in this area.

  44. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    I like GOOP
    Google Object Oriented Programming language

  45. ok... I kinda hate it already.. by tempest69 · · Score: 1
    First off.. it's just the wrong distance from C..
    Perl and Python have a nice distance from C grammar rules.
    Java sticks in pretty tight.

    Go isnt close enough to guess, or far enough away to be distinct.
    Printf instead of printf no. The for loop.. same syntax, but no parens.. with infinite loop behavior in "for{STMT}"
    sure I can use parens.. but I can force other peoples code to not use jacked conventions.

    And yea, I kinda feel that a language should have a core, and a simple way to go full featured, without sending a beginner to cpan and explain the make process, explain the :: conventions for something as simple as making a window with a few buttons.

    The whole object oriented window system.. needs the low tech version, where a whole paradigm doesnt need to be explained, just to do a simple parameter->okbutton-> render function.

    Baseline is that I see a language that doesnt make coding fun..
    perl's @junk=LessThan_GreaterThan; is a thing of beauty (slashdot parses the symbols sorry)
    Python and ruby's huge integer types.. no C++ NTL hassles awesome.
    var s string := "hello world" WTF?? like some pascal-C cross breed. it's clumsy.. and conflicts with the pattern in my head of how a var should be declared. The memory protection seem alright..

    1. Re:ok... I kinda hate it already.. by hattig · · Score: 1

      It's "Printf" because it's a public function. Private functions are in lower case.

      Quite why they couldn't use a "public" or "private" (or "privfunc") keyword instead is another matter, but it's probably because they're trying to keep the code compact. Guess it could have been worse, could have been +printf for public, and -printf for private...

      I find the lack of parenthesis in the for and if statements disturbing, especially as it mandates the braces for the following block. No more if (x) foo();, it's if x { foo() }.

      The channels concept seems nice. The goroutines are a sensible feature for a common use case. The multiple return values is nice.

      It needs an IDE at some point, or at least a code formatter for common IDEs/editors.

      var s string = "foo" can be replaced with s := "foo". Think of := as "becomes".

    2. Re:ok... I kinda hate it already.. by tempest69 · · Score: 1

      thanks for the info. the public/private practice warrants some pondering as to my coding practices. Go is staying on my bad list.

  46. Re:"Go" name already taken for programming languag by martin-boundary · · Score: 1
    Worse. They probably have a marketing droids infestation (*).

    (*) Unfortunately for them, there's only one way to be sure...

  47. Re:"Go" name already taken for programming languag by CrashNBrn · · Score: 2, Interesting

    Because C# was screwed.
    And C++ was screwed...
    And JavaScript couldn't be called JavaScript because Java existed.

  48. Finally! by shacky003 · · Score: 1

    I have been wondering for years what programming language Skynet uses.. Woohoo!

  49. Common words should not be used in product names by Kupfernigk · · Score: 0
    This simply exposes the extreme lameness of allowing common words in product names. I have very limited sympathy for Mr. McCabe: naming your language with one of the most common verbs in the English language was always going to be at risk of a namespace clash. (The game is a different matter, as English was not the language of its originators.) If you work for a Bell Labs you can get away with calling a language 'C', if you are an academic you do best to use a name less likely to be taken, such as Pascal, Smalltalk.

    Unfortunately, in the real world, Google is huge, the "Go..." bit is going to ring immediate bells. Mr. McCabe made a bad choice of language name and he should stop complaining to Google and instead change it to something else and ask them to publicise the change - which I am sure they would do, and would get him more attention.

    No, I'm neither pro nor anti Google, but this is a case where realism is in order. To use the essential car analogy, suppose i was a custom builder and for years had made 10 cars a year with the model name "530". Then BMW come along with their long established 5 series and also release a 530. Is it realistic to expect BMW to change their model designation? I'm sure a lawyer would take on the case if his client had deep pockets, but his expectation of winning would be diddley squit.

    --
    From scarped cliff or quarried stone she cries "A thousand types are gone, I care for nothing, no not one."
  50. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    The STL (T stands for Template!) has nothing to do with the strings library. You are talking out of your arse.

  51. gofmt by CharlyFoxtrot · · Score: 5, Funny

    From Golanf.org : "With Go we take an unusual approach and let the machine take care of most formatting issues. A program, gofmt, reads a Go program and emits the source in a standard style of indentation and vertical alignment, retaining and if necessary reformatting comments. [...] We use tabs for indentation and gofmt emits them by default. Use spaces only if you must."

    Of course you realize ... this means war.

    --
    If all else fails, immortality can always be assured by spectacular error.
    1. Re:gofmt by fnj · · Score: 0, Troll

      Good find. OMFG, only a retard uses tabs. JC. Insanity.

    2. Re:gofmt by jonaskoelker · · Score: 1

      From Golanf.org

      Ha. Ha. Very gunny...

    3. Re:gofmt by kikito · · Score: 1

      Tabs. Yuck.

    4. Re:gofmt by hattig · · Score: 1, Funny

      Okay, this language is dead in the water, and dead to me.

      Tabs are evil. Spaces are the one true way.

    5. Re:gofmt by JesusOfNazareth · · Score: 1

      Indeed, indentation style is serious business.

      Back in my junior days I remember a team lead telling a junior colleague of mine, "Use tabs and I'll pull your scrotum over your head!!" Suffice to say I didn't use tabs for the next five years. Oddly enough though I've switched to tabs eventually.

    6. Re:gofmt by Anonymous Coward · · Score: 0

      Spaces are a way to enforce your coding style on someone else. Tabs allow people to adjust the appearance to something more usable to them. I have known people to use anywhere from 1 to 5 (or more!) spaces. Using tabs avoids this issue.

      ps. Eat it

    7. Re:gofmt by Anonymous Coward · · Score: 0

      What jackass invented tabs, anyways. That one character has caused way more consternation than it was ever worth.

    8. Re:gofmt by Anonymous Coward · · Score: 0

      tabs were created by satin as a thorn in programmers flesh

    9. Re:gofmt by Anonymous Coward · · Score: 0

      Yeh. I use emacs configured to convert the tab key to a sequence of spaces. Tabs are ambiguous! I also hate the K&R curly brace style -- It looks so much better to give the brace it's own line. Hey, this is important stuff!

  52. I'm going to write a Go engine with this... by wertigon · · Score: 1

    Just imagine, playing Go in GoEngine. Written in Go. Yeah. That's sweet. :D

    --
    systemd is not an init system. It's a GNU replacement.
  53. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    When you say "yes!" you don't go "yes factorial", not even if you are easily excited by math.

  54. I prefer brevity support by jonaskoelker · · Score: 1

    Vowels aren't nearly as expensive as they used to be back in the day.

    It'd be a nice touch if they'd add vowel support in package names.

    I can expand the name "fmt" in my head as I read it. I can't really expand my typing from "fmt" to "format" as I type it without typing it, or without having some auto-replace thing which then goes ahead and does the wrong thing sometimes (which I then have to undo), or I have to explicitly say "yes, expand this" which takes extra key presses (which we're trying to avoid), or...

    If you ask me, it'd be a nice touch if they kept the support for brevity in their package names.

    Otherwise, we end up with ArrayIndexOutOfBoundsException rather than IndexError.

    1. Re:I prefer brevity support by Tim+C · · Score: 1

      In 8+ years of programming in Java, I don't think I've *ever* caught ArrayIndexOutOfBoundsException - in fact I'd say that if you are catching it, you're doing something wrong.

    2. Re:I prefer brevity support by tepples · · Score: 1

      I work in a Python shop, but I catch IndexErrors all the time when trying to parse files. For example, we have tools to work with CSV files (serializations of arrays of arrays as tab- or comma-separated text files) to list products on web stores. If I'm parsing a CSV file, the CSV reader class returns a Python type equivalent to Java's java.util.ArrayList. If I know some rows will be shorter than others (such as optional elements or the empty row at the end of some files), I can catch the IndexError from getting an element and continue past the row. (Java likewise throws the IOOBE.)

    3. Re:I prefer brevity support by dave1791 · · Score: 1

      I can read code that says "format" faster than code that says "fmt" because I don't need to devote any thought processes to determining that "fmt" probably means "format". Have you ever read a forum post by a teenager writing in sms style? It makes you want to stab your eyes out. It is much faster to type that way on a handset and I've seen them make exactly the same argument for using it when they have a full size keyboard; that it is faster to type that way. Unfortunately, it is an order of magnitude slower to read.

      I also have a second negative view about overly concise code; it promotes buggyness. In code that I have maintained over the years, I've noticed that more bugs (and harder to fix bugs) show up in the super concise and unreadable code than in highly readable code. Also, fixing these bugs is more likely to introduce regressions.

    4. Re:I prefer brevity support by lastchance_000 · · Score: 1

      I'm guessing the exception handling in python is more expensive than finding the length of your ArrayList-like object and responding accordingly.

    5. Re:I prefer brevity support by Haeleth · · Score: 1

      Wrong! It's totally essential. Arrays in Java don't support the size() method that all other collections use to say how many elements they contain. So the only way to iterate over the contents of an array in Java is:

      try {
        Integer arrayIterationIndex = new Integer(0);
        while (arrayIterationIndex != null) {
            arrayInstance[arrayIterationIndex.intValue()].doSomething();
            arrayIterationIndex = new Integer(arrayIterationIndex.intValue() + 1);
        }
      }
      catch (ArrayIndexOutOfBoundsException wtf) {
      // reached end of array
      }

      I hope I never end up maintaining any of your code, if you don't even know basic idioms like that.

  55. That might not be good for you by syousef · · Score: 0, Offtopic

    why wonder when you can look it up? http://golang.org/doc/go_spec.html

    I prefer this reference ;-)

    http://en.wikipedia.org/wiki/Considered_harmful

    --
    These posts express my own personal views, not those of my employer
  56. Do *not* optimize for readability (do a tradeoff) by jonaskoelker · · Score: 3, Insightful

    People will read a piece of code more times than they will write it, so it makes sense to optimize for readability.

    If you can make the code 1% more readable (pick your measure) at the cost of making it take twice as long to write, is that worth it?

    If you can make the code 1% less readable and simultaneously make it twice as fast to write, is that worth it?

    Also, it's a particular name we're talking about. Is python unreadable because it says "len" instead of "length"? Is it bad to say "IndexError" instead of "ArrayIndexOutOfBoundsException"? Is it bad to say "" instead of "System.out."?

    Of all things, I think names (with vs. without vowels) have the smallest impact on readability. Descriptive names are important, but I think it's much more important to be able to write code that has an easily comprehensible structure.

  57. Re:C++ incomplete. C# windoz. Java slow elephant. by shaitand · · Score: 1

    The string class example was bogus but he has a point. It does seem like every library wants everything stored as its own special type of whatever. Including strings.

  58. Not Invented Here by nut · · Score: 2, Interesting

    Google is developing a real, 'Not Invented Here' complex. Rather than get behind Firefox, they produce their own browser. Rather than integrate tightly with OpenOffice, they produce Google Apps. Now they've written their own programming language. Go figure. And of course there's always those rumours of the Google OS...

    --
    Never trust a man in a blue trench coat, Never drive a car when you're dead
    1. Re:Not Invented Here by Anonymous Coward · · Score: 0

      Sounds strangely familiar - there's another monopolistic software company that tried things like this. Can't quite remember its name - Mucroshaft or something like that.

      1 Do No Evil
      2 ? ? ?
      3 Embrace and Destroy
      4 Profit!

    2. Re:Not Invented Here by Anonymous Coward · · Score: 0

      And of course there's always those rumours of the Google OS...

      Android ring a bell? :)

    3. Re:Not Invented Here by Anonymous Coward · · Score: 0

      wake up, google os is not a rumor anymore

    4. Re:Not Invented Here by Anonymous Coward · · Score: 0

      Google is developing a real, 'Not Invented Here' complex. Rather than get behind Firefox, they produce their own browser. Rather than integrate tightly with OpenOffice, they produce Google Apps. Now they've written their own programming language. Go figure. And of course there's always those rumours of the Google OS...

      Except that, in each case, they generally bring something new and interesting to the table that's worth investigating.

    5. Re:Not Invented Here by Anonymous Coward · · Score: 0

      Rumors? I thought they already announced Chromatic a while back. Or were going to announce it.

    6. Re:Not Invented Here by foxylad · · Score: 1

      I'm calling you on the OpenOffice/GoogleApps comparison too - since when is a monolithic office suite anything like a lightweight online collaboration app?

      You might as well say they shouldn't have bothered with Gmail because there are perfectly good open source email clients available.

      --
      Do as you would be done to.
  59. Re:Named after the most difficult-to-master game e by mr_gorkajuice · · Score: 2, Funny

    I wonder if the chinese name for the programming language will be Weiqi, just to screw us over.

  60. Ummm, C++ has a string class. by Joce640k · · Score: 1

    We've also figured out how to make memory management a non-issue, we don't want no steenkin' garbage collection.

    I looked at GO and I'm not sure what it brings to the table that can't be done better with C++.

    Maybe

    a) Slightly cleaner syntax - no big deal once you're used to C++.
    b) No pointer arithmetic - less chance of stray pointers, sure, but you should be using STL anyway. If you're still banging pointers around in C++ you're Doing It Wrong (except for very low-level code).

    --
    No sig today...
    1. Re:Ummm, C++ has a string class. by ardor · · Score: 1

      I too see it as a mixed bag. It has real closures, which is a big advantage over C++, a cleaner syntax, but has no generics, not even primitive ones like the Java generics. Also, it seems to lack reflection (the reflection interface appears to be something different).

      --
      This sig does not contain any SCO code.
    2. Re:Ummm, C++ has a string class. by feandil · · Score: 1

      pointer arithmetic is useful for efficient code, it has nothing to do with "high" or "low" level.

    3. Re:Ummm, C++ has a string class. by mbrod · · Score: 1

      Agree. GC and memory management in C++ are non-issues now.

      C++0x, once it gets spread around to where it needs to get spread around, brings in a lot of nice to haves I am used to getting in say Perl.

      http://en.wikipedia.org/wiki/C%2B%2B0x

      C++ just keeps getting better and better.

  61. great by Anonymous Coward · · Score: 0

    is the go programming language logo a hamster or a bear?

  62. Parent pretty much sums it up by Joce640k · · Score: 1

    They're the only two features of Go which stand out, and I'm not sure I want either of them.

    PS: While we're fixing C++ can we get rid of arrays? (ie. new[] and delete[] )

    --
    No sig today...
  63. Channels.... by N+Monkey · · Score: 1

    Altough the FAQ doesn't mention Plan 9 anywhere; the "channels", the C-like syntax and the logo all let me think about this nice OS with his concurrent programming language called Alef, designed by Phil Winterbottom. (Rob Pike and Ken Thompson were very involved in the Plan 9 design). Well, the comparison ends here I guess.

    Parallel processing, channels and array slices made me think of Occam.

  64. Yawn by Joce640k · · Score: 1

    The 1990s is calling and wants the C vs. C++ wars back.

    --
    No sig today...
  65. Oh, I see. by jotaeleemeese · · Score: 2, Insightful

    So the guys at Google, could not be bothered to, er, google for "go language" or "go programming language" out of politeness, so the other guy has to suck it up for being just him, a one man band.

    What a wonderful concept of decency and fairness.

    --
    IANAL but write like a drunk one.
    1. Re:Oh, I see. by Anonymous Coward · · Score: 0

      "Do no evil"

    2. Re:Oh, I see. by Dionysus · · Score: 1

      "Do no evil"

      You forgot to add "Try to"

      --
      Je ne parle pas francais.
  66. How does it compare to D? by Anonymous Coward · · Score: 1, Interesting

    Can some expert compare Go with the D programming language?. Looks like D already took what's good in C and C++ and now it's a stable and damn fast language.

    1. Re:How does it compare to D? by zuperduperman · · Score: 1

      Not to mention, D has a Windows compiler.

      I can't quite see the point of a language in this day and age that has no compiler or runtime engine on the most popular platform on the planet.

  67. Re:"Go" name already taken for programming languag by Tim+C · · Score: 3, Informative

    Actually JavaScript being called JavaScript was a hideous decision - even now I read comments from people who think it's something to do with Java.

  68. Obligatory 99 bottles of beers example by gurkmannen · · Score: 1

    package main

    import (
            "os";
            "fmt";
    )

    const bottlecount int = 99

    func bots(b int) string {
            if b > 1 {
                    return fmt.Sprintf("%d bottles", b)
            }
            if b == 1 {
                    return "1 bottle"
            }
            return "No more bottles"
    }

    func main() {
            for i := bottlecount; i > 0; i-- {
                    b := bots(i);
                    os.Stdout.WriteString(b + " of beer on the wall, ");
                    os.Stdout.WriteString(b + " of beer.\n");
                    os.Stdout.WriteString("Take one down and pass it around, ");
                    os.Stdout.WriteString(bots(i - 1) + " of beer on the wall.\n\n");
            }
            os.Stdout.WriteString("No bottles of beer on the wall, no bottles of beer.\n");
            os.Stdout.WriteString("Go to the store and buy some more, ");
            os.Stdout.WriteString(bots(bottlecount) + " of beer on the wall.\n");
    }

    --
    aka Gardener, aka ollej
    1. Re:Obligatory 99 bottles of beers example by shutdown+-p+now · · Score: 1

      func main() {
            b := ...
      }

      Are they trying to piss off both C and Pascal fans at the same time? ~

  69. Do we need more languages? by benwiggy · · Score: 1

    Do we really need more programming languages? Aren't there enough to do everything yet?

    Shouldn't we be trying to reduce the number of languages, rather than add to it? Or even better, create yet another layer of abstraction between us and the machines that gets us away from being slaves to syntax?

    1. Re:Do we need more languages? by kikito · · Score: 1

      Mmm.

      Do we need faster computers? Cars?

      Do we need better medicines? People live too long already!

    2. Re:Do we need more languages? by benwiggy · · Score: 1

      Do we need faster computers? Cars?

      Do we need better medicines? People live too long already!

      Please explain why you associate a high number of computer languages with progress. (which is at the heart of what I originally asked.)

    3. Re:Do we need more languages? by ynohoo · · Score: 1

      Do CompSci interns need to justify their tenure? Hey look, a programming paradigm!

  70. Re:Do *not* optimize for readability (do a tradeof by miro+f · · Score: 5, Interesting

    I find that if you shorten long words arbitrarily, it actually increases the writing time.

    I could write ConnectionManager pretty quickly just due to typing experience in English. The words just flow from my brain onto the keys without even thinking about the individual letters. But if you shortened to CnnctnMgr then you have to think about it every time you type it out, what letters have I taken out again?

    It gets more difficult when you're working off someone else's code. If you shorten long words but not short words then later on when you're looking at new code it takes much longer to get used to variable names. If you stick to a convention and don't shorten any words, you sometimes don't even need to see the variable being used to know what it's called, and can use them without thought.

    ArrayIndexOutOfBoundsException is clearly a poor joke, however. I always hated that one.

    --
    being vague is almost as cool as doing that other thing...
  71. Beowulf clusters!!! by ctrl-alt-canc · · Score: 1

    Well, since Go has some native support for concurrency, it shouldn't be that difficult to have it running on a Beowulf cluster...

  72. Works fine in python, Makefile by jonaskoelker · · Score: 2, Informative

    Are you insane? Have you ever written a parser?

    I've written my share. And I've read (and, I think, understood) how python does it.

    Really, it's not that bad. Simply look at each line and see if it's indented more than the previous; if so, add an OPEN_BRACE token; if less, a CLOSE_BRACE token (or call them OPEN/CLOSE, BEGIN/END, etc.). Then, once you've transformed the indentation structure into tokens, parse the rest.

    You can probably do it faster if you do it on the fly (i.e. at the same time as "parse the rest") rather than in two passes, but the idea is more easily comprehensible this way.

    Also, my practical experience with writing loads of python and more than my fair share of Makefiles suggests that it all Just Works (tm).

    At least as long as you don't mix tabs and spaces. It's quite easy to write a shell script which tests for this and warns you. Also, any decent editor with an embedded lisp dialect can be made to highlight tab/space mixes (or just run your shell script in the background).

    Why the big worry?

    1. Re:Works fine in python, Makefile by godrik · · Score: 1

      Well, It does not work that well. Indentation based language are difficult to use with copy/paste. Sure you should be careful when you do copy/paste anyway, but it may add problem.

    2. Re:Works fine in python, Makefile by lennier · · Score: 1

      "At least as long as you don't mix tabs and spaces. ... Why the big worry?"

      You just answered your own question.

      Rip off and remove the Tab key from every keyboard ever and then we can talk.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
  73. Missing the point by Anonymous Coward · · Score: 1, Interesting

    You are all missing the important point of this language (or I've not seen anyone mention it yet), and that's it's concurency model. No, it won't replace C++ for some things, but it implements part of CSP, a VASTLY nicer model of concurrency than the traditional threads/locks model. You try write a program using threads and locks with 1000 threads all intermingling and prove there are no race hazards or deadlocks, then try the same thing in a CSP based language (this, occam-pi, Java with JCSP, even Javascript with worker threads). I can guarantee that for any non-trivial program this will be far easier in the CSP language, which is very important in the modern parallel market.

    I was instantly happy to see this as I work in an area of concurrency research, involving a lot of CSP which most people have simply never heard of, or don't understand. This may not replace other languages for all things, but it will hopefully be a good start point to bring CSP to the masses.

  74. No templates, no party. by master_p · · Score: 2, Insightful

    Templates is one of C++'s advantage over any other language (except D that implements them). Without templates, type safe containers and reusable algorithms cannot be implemented. For example, in Go, a List class would have to use void* types, throwing type safety out of the window.

    The syntax is also not that good. That the type goes after the variable name, the missing parentheses in 'if' and 'for' statements are syntactic changes that offer no better readability over C.

    Finally, the built-in channel mechanism is something that can be done in C++ in less than 100 lines of code.

    1. Re:No templates, no party. by ctrl-alt-canc · · Score: 1

      Templates will be implemented in Go++

    2. Re:No templates, no party. by daid303 · · Score: 3, Insightful

      ../test.cpp: In destructor ‘std::pair::~pair()’: /usr/include/c++/4.3/bits/stl_pair.h:73: instantiated from ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’ /usr/include/c++/4.3/bits/stl_tree.h:390: instantiated from ‘void std::_Rb_tree::_M_destroy_node(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:943: instantiated from ‘void std::_Rb_tree::_M_erase(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:585: instantiated from ‘std::_Rb_tree::~_Rb_tree() [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_map.h:92: instantiated from here ../test.cpp:11: error: ‘testObj::~testObj()’ is private /usr/include/c++/4.3/bits/stl_pair.h:73: error: within this context /usr/include/c++/4.3/ext/new_allocator.h: In member function ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’: /usr/include/c++/4.3/ext/new_allocator.h:118: note: synthesized method ‘std::pair::~pair()’ first required here

      Because templates are wonderful!

    3. Re:No templates, no party. by daid303 · · Score: 1

      And I forgot to add, Java has typesafe containers, with generics. Which are not the same as templates. So the "C++ has that advantage over any other language" argument is void.

    4. Re:No templates, no party. by Vintermann · · Score: 1

      Your three first sentences are wrong, wrong and wrong...

      --
      xkcd is not in the sudoers file. This incident will be reported.
    5. Re:No templates, no party. by jcupitt65 · · Score: 1

      Finally, the built-in channel mechanism is something that can be done in C++ in less than 100 lines of code.

      No it can't. Go has a segmented stack, so co-routines can be very, very small. I think they default to just a few kb. If the initial stack is too small, it grows as needed. No more stack overflows! Yay.

    6. Re:No templates, no party. by Rockoon · · Score: 1

      Templates is one of C++'s advantage over any other language (except D that implements them).

      Maybe. Its certainly one of its features. Not sure if its an advantage. The most common uses for templates are implemented in other languages as first class features.

      Without templates, type safe containers and reusable algorithms cannot be implemented.

      Wrong. Seriously wrong. Very seriously wrong. Extremely very seriously wrong. Did I mention that this is wrong?

      That the type goes after the variable name, the missing parentheses in 'if' and 'for' statements are syntactic changes that offer no better readability over C.

      Plenty of very popular languages put type names after the variable name, nor require parentheses for if's and for's. The most used programming language on the planet (VBA) for instance. Also "missing" in many languages are semicolons and curly braces.

      Finally, the built-in channel mechanism is something that can be done in C++ in less than 100 lines of code.

      No it can't. C++ doesn't even have portable threading yet. I have determined that you are smoking the my-language-is-better-than-yours crack pipe, while basking in the myopic kool-aid of a one compiler and one operating system universe of blindfolded ignorance.

      --
      "His name was James Damore."
    7. Re:No templates, no party. by master_p · · Score: 1

      You can always set the min stack of a thread using pthreads.

    8. Re:No templates, no party. by master_p · · Score: 1

      Wrong. Seriously wrong. Very seriously wrong. Extremely very seriously wrong. Did I mention that this is wrong?

      No, you are wrong. Type safety means that the program does not stop its execution due to a type mismatch error. So it's either that type mismatch errors are caught in compile time or that they are prevented at run time. The 'Any' type of Go does not guarantee prevention of type mismatch at run time. And Any is only for classes, not primitives.

      Plenty of very popular languages put type names after the variable name, nor require parentheses for if's and for's. The most used programming language on the planet (VBA) for instance. Also "missing" in many languages are semicolons and curly braces.

      But this is supposed to be a C derivative. What's the point of not using parentheses in 'if' and 'for', for example? Why maintain the curly brackets then?

      No it can't. C++ doesn't even have portable threading yet. I have determined that you are smoking the my-language-is-better-than-yours crack pipe, while basking in the myopic kool-aid of a one compiler and one operating system universe of blindfolded ignorance.

      Oh please. A Go channel is nothing more than a queue. A synchronized queue in C++ is no more than 30 lines of code, using pthreads.

    9. Re:No templates, no party. by Rockoon · · Score: 1

      No, you are wrong. Type safety means that the program does not stop its execution due to a type mismatch error. So it's either that type mismatch errors are caught in compile time or that they are prevented at run time. The 'Any' type of Go does not guarantee prevention of type mismatch at run time. And Any is only for classes, not primitives.

      The poster (oh yeah, thats you!) claimed that type safety is only possible with templates. Its wrong, and I'm not the only one who has told you so.

      If you wish to retract what you said, or clarify what you said, do so without declaring me wrong, when clearly more than one person has called you out on how horrendously wrong it was.

      --
      "His name was James Damore."
    10. Re:No templates, no party. by Anonymous Coward · · Score: 0

      Indeed.

      From http://golang.org/src/pkg/container/list/list.go we can see that they're using Go's "interface{}" (C "void*" / Java "Object").

      They're just going to run straight into the Collections issues Java had when it introduced generics and had to retrofit them to the non-generic existing Collections without breaking backward compatibility.

      I think that they should note that the language will be in flux whilst they decide whether to do generics now, or leave it to screw up compatibility later.

      I mean, they tried with the built-in map: map[string]int even though the syntax sucks.

    11. Re:No templates, no party. by sardaukar_siet · · Score: 1

      Finally, the built-in channel mechanism is something that can be done in C++ in less than 100 lines of code.

      Dump'em here or it doesn't hold :D

    12. Re:No templates, no party. by master_p · · Score: 1

      Please. Typesafe containers without templates can not be done. Period.

    13. Re:No templates, no party. by Rockoon · · Score: 1

      But this is supposed to be a C derivative.

      No it isn't. Wrong again.

      From the official site:

      Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family (declarations, packages), plus some ideas from languages inspired by Tony Hoare's CSP, such as Newsqueak and Limbo (concurrency). However, it is a new language across the board. In every respect the language was designed by thinking about what programmers do and how to make programming, at least the kind of programming we do, more effective, which means more fun.

      Oh please. A Go channel is nothing more than a queue. A synchronized queue in C++ is no more than 30 lines of code, using pthreads.

      ORLY?

      Dare I say... wrong?

      Go supports hundreds of thousands of GoRoutines in the same address space. Good luck getting pthreads to support hundreds of thousands of threads. Go also automatically pauses blocked GoRoutines and begins work on other unblocked ones, but I guess you think a simple queue can do that in 30 lines of code. How exactly are you going to be managing that queue from the blocked thread? Insert code into each routine you want to thread manually?

      yeah.... you know what.... wrong.

      --
      "His name was James Damore."
    14. Re:No templates, no party. by Rockoon · · Score: 1

      Yeah, you are right.. languages like C# which dont have templates also dont have typesafe containers... oh...uhh...shit.. wrong again.

      --
      "His name was James Damore."
    15. Re:No templates, no party. by master_p · · Score: 1

      You are the one that is wrong. C# has generics, which are the same with C++ templates: different code is produced for each different template instantiation. The only difference is that in C++ the template instantiation happens at compile time, whereas in C# the template instantiation happens at run time.

    16. Re:No templates, no party. by master_p · · Score: 1

      Go is mostly in the C family (basic syntax),

      That makes Go a C derivative. Being a derivative does not mean a language can't borrow ideas from other languages. So you are the one that's wrong.

      Go supports hundreds of thousands of GoRoutines in the same address space. Good luck getting pthreads to support hundreds of thousands of threads.

      You can actually create as many threads as there is space for the task structure and for the stacks. If you make a thread's stack sufficiently small, you can create millions of threads.

      If you don't like that, you can make, let's say, 8 threads, and dispatch functions on those threads.

      Still, no need for a new language.

      Go also automatically pauses blocked GoRoutines and begins work on other unblocked ones, but I guess you think a simple queue can do that in 30 lines of code. How exactly are you going to be managing that queue from the blocked thread? Insert code into each routine you want to thread manually?

      I don't have to pause anything. A queue's get operation is blocking: if you wait for a value, then the thread blocks on the queue's semaphore.

      yeah.... you know what.... wrong.

      You are. It's no shame in admitting it.

    17. Re:No templates, no party. by Rockoon · · Score: 1

      I don't have to pause anything. A queue's get operation is blocking:

      If the routine you have threaded is making special calls to a thread manager after checking to see if something it needs is blocked, then you have completely missed the point of Go. I am strongly suspecting that you have never done any concurrent programming, but instead have only threaded a couple independent routines (IF THAT.)

      Wrong.

      --
      "His name was James Damore."
    18. Re:No templates, no party. by master_p · · Score: 1

      If the routine you have threaded is making special calls to a thread manager after checking to see if something it needs is blocked, then you have completely missed the point of Go. I am strongly suspecting that you have never done any concurrent programming, but instead have only threaded a couple independent routines (IF THAT.)

      No, the Queue::get() method is a blocking call. Obviously, you have not understood anything.

    19. Re:No templates, no party. by Rockoon · · Score: 1

      Gotcha. Not only are you wrong about what other languages can do, you dont even know what your beloved C++ templates are.

      Templates are not what you think they are. Templates are not another name for generics. So, wrong.

      --
      "His name was James Damore."
    20. Re:No templates, no party. by hazah · · Score: 1
      You do realize that the only relevant piece of information are only in the last 2 lines?

      "/usr/include/c++/4.3/bits/stl_map.h:92: instantiated from here ../test.cpp:11: error: ‘testObj::~testObj()’ is private /usr/include/c++/4.3/bits/stl_pair.h:73: error: within this context /usr/include/c++/4.3/ext/new_allocator.h: In member function ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’: /usr/include/c++/4.3/ext/new_allocator.h:118: note: synthesized method ‘std::pair::~pair()’ first required here"

      You'd think, after seeing this happen around 5 times you'd know where to start looking, geez.

      On a more to the point note: Templates, being what they are, can either allow what they allow, or give better error messages, but not both. Having a construct that can only be validated during instantiation is a double edge sword. Powerful if you can tame the beast. Dangerous and difficult if you cannot.

      Concepts would have alleviated some of these issues at the price of tightening the requirement set, presenting its own set of trade offs.

    21. Re:No templates, no party. by Rockoon · · Score: 1

      No, the Queue::get() method is a blocking call. Obviously, you have not understood anything.

      ..and has nothing to do with what Go does when it pauses blocked GoRoutines.

      YOU don't seem to "get" what Go is.

      I'll ask you flat out. I have a function I'd like to thread.. lets call it YouAreDumb()

      Now, YouAreDumb() accesses various resources that may or may not be locked at any given time. Go detects these locks, and instead of spinning on it like an idiot (consuming resources for no good reason) .. Go will go ahead and pause it, and start up another GoRoutine or continue one that has been paused previously.

      And it can do this for hundreds of thousands of GoRoutines, *without* a thread created for each of them.

      How sir, are you going to do that in C++ in only 100 lines of code? I'm pretty sure your fucked when you start pausing these routines that lock up resources and then get paused themselves. Its called deadlock and newbs who have never done concurrent programming don't have a clue about this shit and seem to think that things are "easy" and can be done in "100 lines of code"

      --
      "His name was James Damore."
    22. Re:No templates, no party. by dargaud · · Score: 1

      Templates is one of C++'s advantage over any other language (except D that implements them). Without templates, type safe containers and reusable algorithms cannot be implemented.

      Templates are nice... but do they really provide anything at all you couldn't get in C ?
      #define MYTYPE int
      Define all your structures and algo with MYTYPE. Then just use #define MYTYPE float or whatever you want in a new implementation. It is even type-safe.

      --
      Non-Linux Penguins ?
    23. Re:No templates, no party. by Anonymous Coward · · Score: 0

      Templates is one of C++'s advantage over any other language (except D that implements them). Without templates, type safe containers and reusable algorithms cannot be implemented.

      And except, of course, ADA, where the syntax came from, and all the other languages that had templates long time before C++.

    24. Re:No templates, no party. by jcupitt65 · · Score: 1

      Of course, but then you can't grow it. Go's stacks size dynamically as needed.

    25. Re:No templates, no party. by Anonymous Coward · · Score: 0

      If you think that basing generic containers on a void* architecture is mutually exclusive with type-safe containers, you are a Jr. programmer, period. Templates (for generic programming, not for all that meta-programming silliness), by the way, can be largely and adequately implemented with nothing more than an existing C or C++ preprocessor.

    26. Re:No templates, no party. by Anonymous Coward · · Score: 0

      error: ‘testObj::~testObj()’ is private
      It has all the useful information. The issue is with the way it is presented to the user. If instead of textwall, it were presented in a form similar to a stack trace it would be much more programmer-friendly. don't paint compiler's inefficiencies as weakness of language feature. ../test.cpp: In destructor ‘std::pair::~pair()’: /usr/include/c++/4.3/bits/stl_pair.h:73: instantiated from
              ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’ /usr/include/c++/4.3/bits/stl_tree.h:390: instantiated from
              ‘void std::_Rb_tree::_M_destroy_node(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:943: instantiated from
              ‘void std::_Rb_tree::_M_erase(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:585: instantiated from
              ‘std::_Rb_tree::~_Rb_tree() [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_map.h:92: instantiated from here ../test.cpp:11:
              error: ‘testObj::~testObj()’ is private

      Add some coloring to that to distinguish between code tokens, filenames, line numbers. I agree that C++ template and namespace syntax is cumbersome.

    27. Re:No templates, no party. by EvanED · · Score: 1

      Your criticism of errors stand, but let me see if I understand your argument in this post. I'll paraphrase:

      1) C++ has templates
      2) Java has generics
      3) Generics are not templates
      4) Thus... this proves that C++ doesn't have the advantage of templates

      Did I get that right?

    28. Re:No templates, no party. by shutdown+-p+now · · Score: 1

      The syntax is also not that good. That the type goes after the variable name

      Don't even get me started on this. Huge part of why C has those largely unreadable nested array/pointer/function-pointer types is precisely because it has type before name; and it has that because it inherited it from Algol-68 (which inherited it from Algol-60). It worked alright when the language had a grand total of 4 simple types (boolean, integer, real, text) and 1 complex type with no nesting (array of any simple type), but it doesn't scale well.

    29. Re:No templates, no party. by shutdown+-p+now · · Score: 1

      You are the one that is wrong. C# has generics, which are the same with C++ templates: different code is produced for each different template instantiation.

      This isn't quite true - JIT-generated code is mostly shared for reference types, with additional hidden method argument used to pass in missing info (such as type handle for RTTI, and instance/array factory for new) at runtime.

      In any case, it is an implementation detail. On language level, C# generics are not at all like templates, because C++ templates are glorified text substitution macros. Heck, you can write a template such that it's not possible to tell whether a particular line of code within it is a variable declaration or an operator application! This certainly isn't true of C# generics, which are really just a form of type generalization ("for all X, ...").

    30. Re:No templates, no party. by daid303 · · Score: 1

      No, you didn't get it right. The OP said: "Without templates, type safe containers and reusable algorithms cannot be implemented." which is wrong, as Java implements typesafe containers and reusable algorithms with generics.

    31. Re:No templates, no party. by daid303 · · Score: 1

      You do realize that this error was only 1 line? And most people use IDEs that show errors on just 1 line, where the private destructor thing would have fallen off the screen. And the error location is somewhere within a default header file.

      But indeed, this error was easy to spot, I know. But it was all I could create in 2 minutes. I have seen more creative errors.

    32. Re:No templates, no party. by master_p · · Score: 1

      Now, YouAreDumb() accesses various resources that may or may not be locked at any given time. Go detects these locks, and instead of spinning on it like an idiot (consuming resources for no good reason) .. Go will go ahead and pause it, and start up another GoRoutine or continue one that has been paused previously.

      Well, if YouAreDumb() accesses a mutex and the mutex is locked, the O/S puts the thread in the waiting thread list. Basic O/S theory.

      And it can do this for hundreds of thousands of GoRoutines, *without* a thread created for each of them.

      So can the O/S do, if you make each thread's stack minimal.

      How sir, are you going to do that in C++ in only 100 lines of code?

      I don't, that's what I am trying to tell you. The O/S will do that.

      I'm pretty sure your fucked when you start pausing these routines that lock up resources and then get paused themselves. Its called deadlock and newbs who have never done concurrent programming don't have a clue about this shit and seem to think that things are "easy" and can be done in "100 lines of code"

      I'm pretty sure you are dumb and have never done any real threaded code.

    33. Re:No templates, no party. by master_p · · Score: 1

      I know templates is not another name for generics. For example, in Java, types are erased and everything is converted to Object. Not so in C#, where the run-time compiler produces different instantiations of the code, in order to have the most optimized code. This is similar to C++'s templates, the only difference being that C++ does this at compile time.

    34. Re:No templates, no party. by master_p · · Score: 1

      This isn't quite true - JIT-generated code is mostly shared for reference types, with additional hidden method argument used to pass in missing info (such as type handle for RTTI, and instance/array factory for new) at runtime.

      Well, if there is no difference in handling separate types, then C# will not produce the same code twice. But the general principle is the same as in C++: if the types are different enough, then different code is created.

      In any case, it is an implementation detail. On language level, C# generics are not at all like templates, because C++ templates are glorified text substitution macros. Heck, you can write a template such that it's not possible to tell whether a particular line of code within it is a variable declaration or an operator application! This certainly isn't true of C# generics, which are really just a form of type generalization ("for all X, ...").

      Templates and generics have differences, but when it comes to type safety, they do the exact same thing: they make sure the underlying variables are handled correctly. Go's lack of templates makes writing typesafe reusable code impossible.

    35. Re:No templates, no party. by EvanED · · Score: 1

      Ah, okay. Bad antecedents. I took "that advantage" in your post to refer to "C++ has templates" from the OP. (This still stands; there are a number of things you can do with templates that you can't do with generics.)

    36. Re:No templates, no party. by Rockoon · · Score: 1
      Please resolve my issue with your words.

      You say:

      I know templates is not another name for generics.

      But then you say:

      This is similar to C++'s templates, the only difference being that C++ does this at compile time.

      Generics implement type safety, and templates can implement generics. Get it? Got it? Good. Now.. you were saying that ONLY templates can implement type safety.... WRONG.

      --
      "His name was James Damore."
    37. Re:No templates, no party. by Rockoon · · Score: 1

      Well, if YouAreDumb() accesses a mutex and the mutex is locked, the O/S puts the thread in the waiting thread list. Basic O/S theory.

      Hundreds of thousands of threads... in a waiting list... right? Have you *ever* created hundreds of thousands of threads on any modern operating system? Windows? Linux? OSX? If so, were you able to close the program, or did you (as I already know you would) have to do a hard reset?

      Whats the queue for if the OS is managing the threads?

      This is the problem. You seem to think that the OS can manage hundreds of thousands of threads efficiently in one breath, yet strangly in other breaths you speak of using a queue so that you can do thread pooling (in 100 lines, no less)

      As far as what I have done. I have done threaded code. Threaded code is easy compared to concurrent computation with shared resources. You obviously have no clue what the difference is.

      --
      "His name was James Damore."
    38. Re:No templates, no party. by hazah · · Score: 1

      So people are using a tool (IDE) that isn't capable of presenting the information to the user that is clearly there? Perhaps a new tool is in order?

  75. Er...? by Kupfernigk · · Score: 2, Informative
    Chrome is based on Webkit and optimised for Javascript, which is Google's delivery tool of choice. OOO was never going to be suitable for running as a cloud application. The Google OS seems to be tight integration of Linux and Chrome. Go seems to be basically the start of an improved version of C, rather than an improved version of C++.

    You seem to be complaining because Google is working on technologies which are not your technology of choice. But far from an NIH, they seem to be giving serious traction to existing technology which best suits their needs.

    --
    From scarped cliff or quarried stone she cries "A thousand types are gone, I care for nothing, no not one."
    1. Re:Er...? by SpinyNorman · · Score: 1

      Go seems to be basically the start of an improved version of C, rather than an improved version of C++

      It sounds more like it has more in common with C# than C++.

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

    2. Re:Er...? by bonch · · Score: 1

      Go isn't an "improved version of C." It's an alternative to C. Just because Chrome is based on an existing rendering engine doesn't mean it also acts as a replacement for Firefox. Google OS uses Linux for its kernel but will replace X11 and will run its own web apps.

      Just because they base their alternatives on existing technologies doesn't mean it's not still a NIH mentality.

  76. maybe by Anonymous Coward · · Score: 0

    I'll learn it on the go.

  77. Naming Conventions by Jane+Q.+Public · · Score: 1

    Hey! At least they don't use Hungarian Notation!

  78. Blocked in Syria by Anonymous Coward · · Score: 0

    What kind of an "open" language is it, if it's website is blocked in Syria (and probably the rest of USA's embargoed countries)

  79. Re:Named after the most difficult-to-master game e by glwtta · · Score: 5, Funny

    I think they just chose the name so they can use their page numbering convention for future versions:

    version 2: Goo
    version 3: Gooo
    etc.

    I will probably mature around the time Goooooo comes out - can't wait to use it!

    --
    sic transit gloria mundi
  80. Dev's worst nightmare! by L4t3r4lu5 · · Score: 1

    A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop

    When would dev's ever have time for wheelie-chair sword duels?!

    --
    Finally had enough. Come see us over at https://soylentnews.org/
  81. No exceptions? Really? by RzUpAnmsCwrds · · Score: 5, Interesting

    Go seems to suffer from the problem of not being done. Case in point: exceptions.

    Google's C++ style guide forbids exceptions. This is because of historical reasons - Google's codebase is not exception-tolerant.

    Because Go doesn't have exceptions, programmers won't write exception-safe code. Since Go is garbage-collected, this is less of an issue compared with C++, but there are still cases where things like file handles or external resources need to be cleaned up.

    Two, three, or four years down the road, it's going to be hard to use exceptions in Go, because the existing code that's out there won't inter-operate properly with code that throws exceptions.

    In my opinion, exceptions are absolutely, positively critical in a modern imparative programming language. Exceptional conditions happen. Parsers get data in the wrong format. Network requests time out. Hardware fails.

    There are some exceptional conditions that should never happen, and if they do they should kill the system and print something that lets you track down the problem. Exceptions provide this behavior for free; simply don't catch them and you get at least a stack trace when they occur.

    The alternative is to write a bunch of error handling code to print out debugging information and exit. Then you call it from everywhere that one of these critical errors occurs.

    Except, what if you want to handle one of these critical errors? What if you're calling code that exits if it fails, but you want to report errors in a different way? What if the exceptional case is supposed to happen, like if you're writing unit tests?

    The other type of error isn't critical. Maybe it's a network timeout or a parsing error, neither of which should probably crash the system (in most cases). Here, you want to handle the error and take some action, like re-sending the data or asking for input from the user again.

    Error codes work here, except that they're cumbersome. Want to include information on exactly what kind of a parser error occurred? Now you're going to have to return both an error code and an error string. Maybe you'll even return an error object.

    What if the error occurs in a private method (lowercase first letter in Go) that's called by the public method (uppercase first letter in Go)? With exceptions, you just throw in the private method. With error codes, you need to check for an error code in the public method when you call the private method, then pass the error along.

    1. Re:No exceptions? Really? by ztransform · · Score: 1

      In my opinion, exceptions are absolutely, positively critical in a modern imparative programming language.

      There are two ways of handling an error; exceptions, or explicit return code processing.

      Typically return code processing is done for errors that are likely to be encountered and should be handled appropriately. Exceptions are used to deal with unusual unexpected events. Of course either method of error handling can be used for whatever purpose suits the programmer.

      To say that one method of error handling is superior or correct or even required over the other is a little naive.

    2. Re:No exceptions? Really? by RAMMS+EIN · · Score: 1

      ``To say that one method of error handling is superior or correct or even required over the other is a little naive.''

      I disagree. Forget to check a return code and nobody might ever find out, except that some people will end up with corrupted data. Forget to check an exception and you will (in most implementations, at least) get an error message telling you what went wrong and where in the program. Some systems (Lisp systems, in particular) will go as far as letting you fix the error and continue the program. I think exceptions _are_ fundamentally superior over error codes, and I am quite curious about why the designers decided not to put them in Go.

      --
      Please correct me if I got my facts wrong.
    3. Re:No exceptions? Really? by ztransform · · Score: 1

      I think exceptions _are_ fundamentally superior over error codes, and I am quite curious about why the designers decided not to put them in Go.

      Have a look at the Go Language FAQ. It states very clearly why exceptions were not added to Go. It also states the design goals of the language.

      Have you ever considered, from an assembly language perspective, what exception processing looks like? How handling of multiple stack frames might take place? Have you ever implemented your own exception handling methodology in C? If not then demanding exceptions from all languages illustrates naivety.

      If you want languages that provide safety then you must sacrifice speed.

      I, personally, have never found myself enamoured by exception handling. It has its conveniences but you may well find many old school programmers find themselves content without it.

      Initial things I feel a bit puzzled about with "Go" is the difference in argument handling between Print and Println, the use of a leading capital to distinguish between private and public routines (not all languages have capitals - unicode support is great until you smack foreigners in the mouth with capital letter requirements), I'm sure I'll think of more.

    4. Re:No exceptions? Really? by RAMMS+EIN · · Score: 3, Interesting

      ``Have a look at the Go Language FAQ. It states very clearly why exceptions were not added to Go.''

      Yes, I've read that since. I hadn't bothered to read the whole thing before posting. :-)

      It seems to me the reason Go doesn't have exceptions is that "we haven't figured out a good way to implement them yet".

      ``Have you ever considered, from an assembly language perspective, what exception processing looks like? How handling of multiple stack frames might take place?''

      As a matter of fact, yes. I am the creator of the Voodoo programming language, a low-level language intended to be used as an intermediate step to native code generation. I am currently working on mapping the constructs of my Mana programming language (which, alas, is mostly documented on paper as of now) to Voodoo. That includes exceptions, restarts, continuations, closures, tail calls, garbage collection, the whole enchilada. Exceptions aren't exactly straightforward to implement (they break call-return control flow), but it's work you only have to do once and that will save users of your language a lot of headaches. "It's somewhat difficult to implement" has never been a good reason not to have a good idea in a programming language, especially if it _has_ been done before.

      ``If you want languages that provide safety then you must sacrifice speed.''

      Is that so? Care to back up that assertion with some argumentation?

      ``I, personally, have never found myself enamoured by exception handling. It has its conveniences but you may well find many old school programmers find themselves content without it.''

      Oh, I manage just fine in languages without exception handling, too. I'd also manage just fine if all I had was an assembler. In fact, I've done just that for years (back when there wasn't Internet access where I lived). But that doesn't mean I don't think high level languages or exceptions aren't a good idea.

      --
      Please correct me if I got my facts wrong.
    5. Re:No exceptions? Really? by phantomfive · · Score: 0

      Exceptions are only critical in a programming language if your programming style needs them. Once you learn to program without them, they don't matter so much. There are other ways to deal with exceptional conditions.

      --
      Qxe4
    6. Re:No exceptions? Really? by SlashDotDotDot · · Score: 3, Informative

      Go seems to suffer from the problem of not being done. Case in point: exceptions.

      The authors at least partly agree with you. They describe the absence of exceptions here. They consider it to be an open issue.

      On the other hand, they already provide an alternative to the "finally" block of an exception handler: the defer keyword. I like the looks of this, as it means you can handle all of your closing and locking kinds of issues in a direct pairing with the corresponding open or lock, regardless of whether the function terminates early due to error conditions.

      --
      /...
    7. Re:No exceptions? Really? by lennier · · Score: 1

      "Case in point: exceptions."

      Aren't exceptions just one specialised application of continuations? So why not just provide generalised continuation support?

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    8. Re:No exceptions? Really? by Eivind+Eklund · · Score: 1

      ``To say that one method of error handling is superior or correct or even required over the other is a little naive.''

      I disagree. Forget to check a return code and nobody might ever find out, except that some people will end up with corrupted data. Forget to check an exception and you will (in most implementations, at least) get an error message telling you what went wrong and where in the program.

      I think both paradigms has their strenghts and weaknesses.

      I prefer exceptions for "semi-dirty" code, where I'll try to do error handling but won't really, really verify for it, because exceptions take most of the hassle out of this and means that one error in coding won't leave the user with corrupted data but will create a stacktrace that is possible to debug. This fits for most business code.

      I prefer returned error codes for code where I really want to make it solid (e.g, the operating system code I've worked on in FreeBSD), because I can verify that the handling is correct much more easily. The handling is explicit, in the way, and more of a hassle to write in the first place - but it is also easier to verify.

      I suspect that there is some paradigm out there that has the ability to work like both of these (possibly some kind of wrapped return types a la Haskell's Maybe / Just types with possible exception information included), but I don't yet know this paradigm.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    9. Re:No exceptions? Really? by Anonymous Coward · · Score: 0

      Error codes work here, except that they're cumbersome. Want to include information on exactly what kind of a parser error occurred? Now you're going to have to return both an error code and an error string. Maybe you'll even return an error object.

      Not that I disagree with the notion that exceptions are a useful feature, but they provide for multiple return values* to make it lot less clunky

      * http://golang.org/doc/effective_go.html#multiple-returns

  82. Re:"Go" name already taken for programming languag by victorhooi · · Score: 1

    heya,. Actually, if you look at the issues, you'll see a number of people make the very valid point (e.g. comment 66, http://code.google.com/p/go/issues/detail?id=9#c66), that the languages are "go", and "Go!". And a lot of languages already differ by one character - C, C++. and C#. Or A+ and A++. Or Alef and ALF. Or GM and GML? Or how about Modula-2, Modula-2+ and Modula3? Look it happens, you don't see anybody flaming each other on those languages, getting them to change. I don't see K&R flaming Microsoft about C#. Cheers, Victor

  83. The importance of copy on write by tepples · · Score: 1

    nobody expecting a NSString cares if you use the mutable version of it.

    If your class holds a reference to a string, and it has checked the string to make sure it contains only (for example) alphanumeric characters and dashes, you don't want any other code to modify the string to insert characters you don't expect. That's why languages like Java, Python, and PHP make a new string when a program modifies a string.

  84. Re:C++ incomplete. C# windoz. Java slow elephant. by marco13185 · · Score: 2, Informative

    C# is not a windows only language at all. Mono is a pretty complete implementation of the .NET Framework on Linux (with some good progress on OS X). A lot of really cool apps, such as Beagle, Banshee, F-Spot, Tomboy, and Gnome-Do, are written for Mono.

  85. ConnMgr by tepples · · Score: 1

    But if you shortened to CnnctnMgr then you have to think about it every time you type it out, what letters have I taken out again?

    The canonical abbreviation for "Connection" that I've seen in numerous libraries is "Conn", and Mac OS documentation has abbreviated "Manager" as "Mgr" since the days of Inside Macintosh. So people would expect ConnMgr.

    1. Re:ConnMgr by Dionysus · · Score: 1

      I've seen Mng, Mn, Mgr, Man as abbreviation for Manager. of course, the fun part is when they have different types of managers in the code, and they decide to abbreviate them all differently. Lots of fun.

      --
      Je ne parle pas francais.
  86. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    Umm... I'm not a friend of java (time and updates have dulled my hatred of late 90's java), but wasn't ArrayIndexOutOfBoundsException just arrayindexo[tab] even way back in the day? I think normal geeks can type Array and Index with 5 hand twitches ar ray ind e x.

    I also ran into a problem where a coworker told me to use his function ConnectionManager (changing names to protect the innocent). He had abbreviated it CnntMgr. How do you search for that crap?

  87. std::string and std::basic_string by tepples · · Score: 2, Informative

    The STL (T stands for Template!) has nothing to do with the strings library.

    The C++ standard library consists of the C standard library, the iostream library, and the STL. In the STL, std::string is a specialization of the template class std::basic_string.

  88. Making C++ bindings to a C library by tepples · · Score: 1

    If you're still banging pointers around in C++ you're Doing It Wrong (except for very low-level code).

    And because not all third-party libraries already have C++ bindings, you still need to write "very low-level code" quite often when you make your own.

    1. Re:Making C++ bindings to a C library by Tweenk · · Score: 1

      In other languages you cannot even use those libraries without bindings, so it's not a valid criticism...

      --
      Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
  89. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    You have to call it ConMan

  90. Garbage collectoin latency by tepples · · Score: 1

    but if you're writing e.g. desktop productivity software, does it really matter that you spend 3% of your application time in the GC?

    It matters if the 3% of application time happens all at once, making the application appear to be frozen, while the user is waiting to be able to do something. A runtime environment's garbage collector needs to be incremental, invisible, and concurrent, or the same implementation issues that you restrict to Doom 8 will start showing up in Word 15.

  91. You must have missed the Go specification... by flithm · · Score: 4, Insightful

    C++'s templates offer a lot more than just generics (which is what you're talking about when you say "type safe containers and reusable algorithms"), however Go does, in fact, provide for this with its "interfaces." The Go interface affords for both data abstraction (akin to C++'s inheritance hierarchy), and generic programming. Go provides an "Any" container, which "may be used to implement generic programming similar to templates in C++".

    It's worth noting though that this is a dynamically bound language feature, which means it is checked and enforced at runtime rather than compile time -- both a positive and a negative depending on how you look at it. It provides for some more interesting programs to be written that do fun things at runtime, but on the down side it means you lose a lot of the compile time type-checking that C++ provides and can save a lot of debugging time later on. It also means that you can't do any template metaprogramming with Go -- again which can be viewed as a positive or a negative.

    I also challenge you to come up with a solution that equates to Go's built in Channel's in less than 100 lines of C++. What you're actually saying is you "can implement Go's Goroutine's AND Channels in less than 100 lines of code in portable, cross platform, C++". But, let's give you the benefit of the doubt and say that you've already go some mechanism for emulating a Goroutine (which by the way allows one to "mutiplex independently executing functions onto a set of threads"). I think _just_ the thread safe code that would implement all the necessary locks and barriers for a _single_ platform would probably be more than 100 lines, and would not be portable (ie, it would be pthreads, or win32 specific).

    I am open to being wrong about that, but I really do believe that you haven't spent much time investigating Go, and are therefore spreading FUD. For example your assertion that "in Go, a List class would have to use void* types, throwing type safety out of the window" is just plain wrong.

    I should also point out that I am in no way a Google Go fanboy. I see it as a pseudo-interesting low-ish level language that I haven't quite been able to envision the proper use for yet. I don't really buy Google's claim that it's a system level language (I can't see myself wanting to write an OS or device driver in it). To me it seems more like a great way to rapidly build efficient client / server type applications.

    1. Re:You must have missed the Go specification... by master_p · · Score: 1

      Go provides an "Any" container, which "may be used to implement generic programming similar to templates in C++".

      I can do the same in C++, using boost::any or rolling my own variant type. Still, it's not templates. It's not type safe.

      It's worth noting though that this is a dynamically bound language feature, which means it is checked and enforced at runtime rather than compile time -- both a positive and a negative depending on how you look at it.

      Certainly negative from a performance standpoint.

      It provides for some more interesting programs to be written that do fun things at runtime, but on the down side it means you lose a lot of the compile time type-checking that C++ provides and can save a lot of debugging time later on.

      Definitely negative, then.

      I also challenge you to come up with a solution that equates to Go's built in Channel's in less than 100 lines of C++. What you're actually saying is you "can implement Go's Goroutine's AND Channels in less than 100 lines of code in portable, cross platform, C++". But, let's give you the benefit of the doubt and say that you've already go some mechanism for emulating a Goroutine (which by the way allows one to "mutiplex independently executing functions onto a set of threads"). I think _just_ the thread safe code that would implement all the necessary locks and barriers for a _single_ platform would probably be more than 100 lines, and would not be portable (ie, it would be pthreads, or win32 specific).

      Bullshit. The channel class in c++ is about 30 lines of code, using pthreads. It includes a semaphore for notifying the receiver, a container of data and a mutex to serializes access to the container. It contains two methods (put and get). If you want a bidirectional channel, you just put two channels in one.

      For example your assertion that "in Go, a List class would have to use void* types, throwing type safety out of the window" is just plain wrong.

      It still throws type safety out of the window, by using 'any'.

    2. Re:You must have missed the Go specification... by flithm · · Score: 1

      I agree with all your "negatives", but you clearly have a C++ centric viewpoint on Go. I think it's more valuable to look at it without bias.

      While it's true that the dynamic binding has a negative performance impact, it's also true that this offers some design flexibility that you can't get in C++.

      It's clear that performance isn't the key concern of Go; it seems like they're aiming more for convenience and rapid development speed.

      Sometimes it's hard for C++ programmers to think beyond type safety but once you shift your mind into say Python or Ruby mode (languages even more dynamic and less type safe than Go), you can still write safe code.

      But like I said I do agree with you, that your negatives are indeed negatives. I just want to point out that there are positives there too, and we should be looking at every language with an eye of "what specific problem can this tool be used to solve." rather than "how can I use tool X to solve the same problems I solved with tool Y" -- which is something C++ programmers can fall into easily since it's without a doubt one of the most flexible, powerful, and multi-paradigm languages out there.

      As for your 30 LOC Gochannel... don't forget that a Goroutine is not just a thread. Multiple Goroutines are multiplexed across many threads and the Gochannel.

      I should also like to point out that the C code for _just_ the platform agnostic channel code (after all the os specific threading functions have been abstracted away) in Go is 1035 lines long as of changeset 3975. Nor does this include the Goroutine code.

    3. Re:You must have missed the Go specification... by master_p · · Score: 1

      it's also true that this offers some design flexibility that you can't get in C++.

      Wrong. I can do with C++ the same design flexibility, including "dynamic" programming ala Java (that's what C++ was before templates) or dynamic programming ala Objective-C.

      it seems like they're aiming more for convenience and rapid development speed.

      Go is not interpreted.

      Python or Ruby mode (languages even more dynamic and less type safe than Go), you can still write safe code.

      You can even write safe code in raw assembly. So? not a point. The type safety C++ gives you increases the development speed. If Go was interpreted, you may had a point. Since it's not, I don't see any advantage over C++.

      I just want to point out that there are positives there too

      Yes, there are. The imports and the garbage collection. But they are not enough to justify a shift to Go.

      As for your 30 LOC Gochannel... don't forget that a Goroutine is not just a thread. Multiple Goroutines are multiplexed across many threads and the Gochannel.

      I have just posted a Queue C++ class here. It can be used from as many threads as you like. It's totally thread safe. It's 36 lines of code.

    4. Re:You must have missed the Go specification... by Anonymous Coward · · Score: 0

      It's not even possible to implement goroutines in plain C++ or C. Go uses segmented stacks which start out small and grow dynamically, which is how you can have so many goroutines/threads. You'll need a modified C or C++ compiler to get this behavior.

    5. Re:You must have missed the Go specification... by flithm · · Score: 1

      Wrong. I can do with C++ the same design flexibility, including "dynamic" programming ala Java (that's what C++ was before templates) or dynamic programming ala Objective-C.

      You can not, with C++, add functions to classes at runtime like you can with Objective-C. You can not, with C++, change the access properties of a particular class instantiation (ie change a method from public to private) at runtime like you can with Java.

      You're clearly a C++-centric programmer who fails to understand that the more tools in your belt, the better. Every language has its use. C++ is an awesome language, for specific purposes, just like Java is (for specific purposes), same with Python, and Ruby, and many other languages.

      No language is without its faults either.

      Go is not interpreted.

      That doesn't mean anything. Neither is Java. And neither is obj-c. Yet they're both languages that can be compiled to machine code, are dynamically bound, and are capable of providing runtime reflection. It's all about how it's implemented and the runtime.

      Your queue class is of no relation to Gochannels whatsoever. You're omitting the Goroutines, which you simply can not ignore. They do not equate to simple threads. Take a look at the Go channel source and you'll understand better what they're actually doing.

      not enough to justify a shift to Go.

      Runtime reflection, true closures (something not offered any very many other compiled languages), array slices, and a built in parallel programming paradigm certainly justify at least giving it a thought for a very select category of problems.

      I'm up for considering anything if it will save time / money / hassle. If it doesn't, oh well, move on to the next tool. Whatever fits!

      I should also mention that I'm no Google or Go fanboy. I'm actually a C++ compiler developer by trade so I've no beef with C++ either. In fact I love C++. I love many languages. My thesis was written in D, for example. I've also written commercial applications in Python, Ruby, Erlang, etc, etc.

      For me, the jury is still out on Go. I'm not convinced the world needs YAL (yet another language), but I'm open to the idea. If they find a niche for it, great.

    6. Re:You must have missed the Go specification... by Anonymous Coward · · Score: 0

      You can do this in C with sigsetjmp/siglongjmp or getcontext/setcontext and be POSIX compatible. You have a tiny stub function that bridges between separately allocated stacks. It's pretty trivial, although it would be better and easier with compiler support. It's sometimes even possible to do this with no assembly code whatsoever (although your eyes will bleed). Or you can patch in with a custom mcount if using gcc.

      The reality though is that nobody cares. With 64-bit you can just give each a growable stack of huge proportions and the OS handles this fairly well.

    7. Re:You must have missed the Go specification... by master_p · · Score: 1

      You can not, with C++, add functions to classes at runtime like you can with Objective-C.

      Yes, you can do that as well. In fact, you can do the exact same object-oriented in C++ as in Objective-C. See this for more details.

      You can not, with C++, change the access properties of a particular class instantiation (ie change a method from public to private) at runtime like you can with Java.

      Besides being stupid, you can do that in C++ as well. If you have the header of the class, you can change the function access by hacking the header. Or you can write a binary compatible class with the class you want and use that. But, as I said, it's stupid.

      You're clearly a C++-centric programmer who fails to understand that the more tools in your belt, the better. Every language has its use. C++ is an awesome language, for specific purposes, just like Java is (for specific purposes), same with Python, and Ruby, and many other languages.

      I don't disagree with that. I am a Java and .NET programmer as well. But the point here is that Go offers nothing that cannot be done with C++.

      That doesn't mean anything. Neither is Java. And neither is obj-c. Yet they're both languages that can be compiled to machine code, are dynamically bound, and are capable of providing runtime reflection. It's all about how it's implemented and the runtime.

      It does. It is said that Go enhances productivity. I say it does not, because it's not an interpreted language. The edit-compile-run cycle still exists. Productivity is enhanced when I can pause the program, modify it and rerun it from the point it was, not from fast compile times (which helps, but not so much).

      Your queue class is of no relation to Gochannels whatsoever. You're omitting the Goroutines, which you simply can not ignore. They do not equate to simple threads. Take a look at the Go channel source and you'll understand better what they're actually doing.

      It's a green thread implementation, i.e. software threads. I don't want to reinvent the wheel. Not only pthreads is more than enough, but there are pthreads green threads implementations as well. By using my class (or any other Queue class) and pthreads (any implementation), the same thing as goroutines can be achieved.

      Runtime reflection

      Not enough to justify changing programming environments from Java and C# that also offer reflection.

      true closures (something not offered any very many other compiled languages)

      C++0x has closures.

      array slices

      Easily emulated with C++ templates.

      and a built in parallel programming paradigm

      Why does it matter if parallel/concurrent functionality is built-in or not? what it matters is what I can do with a specific programming language. Right now, I can do much more in C++/C#/Java than in Go, including parallel programming.

      certainly justify at least giving it a thought for a very select category of problems.

      It has a long way to go until it is a candidate for real projects (open source or commercial).

      I should also mention that I'm no Google or Go fanboy. I'm actually a C++ compiler developer by trade so I've no beef with C++ either. In fact I love C++. I love many languages. My thesis was written in D, for example. I've also written commercial applications in Python, Ruby, Erlang, etc, etc.

      Good for you. What compiler have you implemented? can I download it from somewhere? Are you interested in making a C++ successor? (yes I am interested in it, I'm fed up with C++'s problems all these year

  92. Resources other than memory by tepples · · Score: 1

    After all, manual memory management means code needs to be run every time the last reference to a chunk of allocated memory is lost.

    And manual resource-other-than-memory management means code needs to be run every time the last reference to a resource other than memory is lost. C++'s RAII idiom and Boost smart pointers excel at this, as do both the context manager and the reference counting in Python.

    And indeed, some studies have found automatic memory management to actually outperform manual memory management.

    Do you mean "outperform" in latency, or just throughput? Anything interactive needs a latency guarantee so that the user doesn't spend several seconds at a time staring at a frozen application stuck in its garbage collector.

    1. Re:Resources other than memory by RAMMS+EIN · · Score: 1

      ``Do you mean "outperform" in latency, or just throughput?''

      I meant throughput. But:

      ``Anything interactive needs a latency guarantee so that the user doesn't spend several seconds at a time staring at a frozen application stuck in its garbage collector.''

      There are non-real-time and real-time automatic memory management systems just as there are non-real-time and real-time manual management systems.

      As an aside, all the programs that annoy be by making me wait several seconds unpredictably use manual memory management. Not saying the pauses are _because_ they use manual management ... but long pauses are neither a necessary consequence of, nor exclusive to garbage collected systems.

      Finally:

      ``And manual resource-other-than-memory management means code needs to be run every time the last reference to a resource other than memory is lost.''

      I am developing a programming language in which I will experiment with automatically managing non-memory resources, too. But this differs from automatic memory management in several ways. First of all, by contrast with some automatic memory management systems, it means you do have to perform work for unreachable objects (e.g. close files whose handles are no longer reachable). Secondly, the work you need to perform could take quite a lot of time compared to things that interact only with memory. Thirdly, these resources tend to be acquired and released on a much coarser scale (e.g. virtually every function call interacts with memory, but few deal with other resources). On the whole, I am not convinced automatic non-memory resource management is a good idea - but that's exactly why I'm doing the experiment: to find out.

      --
      Please correct me if I got my facts wrong.
    2. Re:Resources other than memory by gbjbaanb · · Score: 1

      Roughly the cancel out overall.

      ie. Manual management works like this:
      alloc, dealloc, alloc, dealloc, alloc dealloc.

      GC works like this:
      alloc, alloc, alloc, dealloc, dealloc, dealloc.

      So overall there is no difference to speak of.

      There are places where you can see a benefit to one over the other. In GC, you do not get the fragmentation of the heap like you do with manual management. However, in GC you do have to walk the heap and compress it. So you're making trade offs there, that will possibly have an effect with some types of application. (note you can mitigate the fragmentation on manual heaps with fixed-block allocators).

      GC can have better performance with shared objects, ie once allocated an object can be passed around by passing the 'pointer' to it. With a RAII style system, the full object tends to be passed around (which is why C++ compilers do a very good job of optimising code, and the boost shared_ptr was created. GC is in effect like having all objects created in a shared_ptr).

      GC does have an issue with memory leakage - see the notes that inexperience C# programmers have been complaining of when not (manually) removing event handlers from UI components. The GC never frees them if there's always a reference held to an in-use object, even if that object no longer gets used. GC also has issues with 'deterministic finalisation' - which is not a problem if the only resource used by your object is memory, but it is a huge problem for all other types of resource. I think the designers didn't grasp this fact. (I know they didn't when designing C# because they had to later go and create a reference-counting wrapper, SafeHandle)

      So GC is a tool that is useful in some instances, but its not something that should be your only option, unfortunately all languages that provide GC-based memory don't tend to offer much in the way of alternatives, unlike C++ which not only allows you to have GC memory management for objects you choose to be collected, but also allows you to have shared objects with deterministic finalisation, and also allows you to have cheap stack-based objects too.

    3. Re:Resources other than memory by tepples · · Score: 1

      There are non-real-time and real-time automatic memory management systems just as there are non-real-time and real-time manual management systems.

      But if the developer of a platform decides to make available only a non-real-time automatic memory management system, developers of interactive applications are screwed. I believe this makes up a large part of tracing garbage collection's bad reputation: early versions of Java had no real-time collector.

      First of all, by contrast with some automatic memory management systems, it means you do have to perform work for unreachable objects (e.g. close files whose handles are no longer reachable).

      Any reference-counted garbage collector (as opposed to a tracing garbage collector) can be made to support destructors. These include the mechanisms in C++ Boost and in Python. Yes, I know this causes problems in the case of reference cycles, but these objects that represent resources generally don't tend to hold references in a cycle.

      Thirdly, these resources tend to be acquired and released on a much coarser scale

      People always find something to complain about. Once you've eliminated all the memory leaks in a program, people will female dog about open file leaks, network connection leaks, GUI widget leaks (a big problem in the Windows 9x days when there were 65536 byte user and GDI heaps), etc.

      (e.g. virtually every function call interacts with memory, but few deal with other resources)

      A lot of function calls that interact with memory allocate a piece of memory and then free it before the end. These are ideal candidates for reference counting.

    4. Re:Resources other than memory by RAMMS+EIN · · Score: 1

      ``Roughly the cancel out overall.

      ie. Manual management works like this:
      alloc, dealloc, alloc, dealloc, alloc dealloc.

      GC works like this:
      alloc, alloc, alloc, dealloc, dealloc, dealloc.''

      Depends. Generally, garbage collection happens when the heap is fully. In the ideal case, that never happens, and you see everything being deallocated in one fell swoop when the program terminates. In pathological cases, you see GC being run for every memory allocation, spending a lot of time but freeing virtually no heap space.

      ``So overall there is no difference to speak of.''

      Perhaps under "normal" circumstances, but there are cases where the difference is enormous.

      ``There are places where you can see a benefit to one over the other. In GC, you do not get the fragmentation of the heap like you do with manual management.''

      Depends on the memory manager. There are GCs that defragment, but also those that don't. There are also malloc implementations that fragment a lot and malloc implementations that fragment very little.

      ``However, in GC you do have to walk the heap and compress it.''

      Again, depends on the GC. There are compacting GCs and non-compacting GCs. There are those that scan live objects and those that scan garbage. There are generational and non-generational, real-time and non-real-time GCs ... there is a lot of work out there, and your generalizations really don't apply to all of it.

      ``GC can have better performance with shared objects, ie once allocated an object can be passed around by passing the 'pointer' to it.''

      I don't think that is a property of GC. It's just something that automatic memory management makes easier, because, unlike manual memory management, you don't have to keep track of who is responsible for when the space is to be freed.

      ``GC does have an issue with memory leakage - see the notes that inexperience C# programmers have been complaining of when not (manually) removing event handlers from UI components. The GC never frees them if there's always a reference held to an in-use object, even if that object no longer gets used.''

      You mean that garbage collectors only reclaim memory that is no longer referenced, not memory that is referenced but will not ever be used. You are right about that.

      ``GC also has issues with 'deterministic finalisation' - which is not a problem if the only resource used by your object is memory, but it is a huge problem for all other types of resource. I think the designers didn't grasp this fact. (I know they didn't when designing C# because they had to later go and create a reference-counting wrapper, SafeHandle)''

      I don't see that as a problem. If you want a resource freed at some specific point in your program, you can write code that does so. GC is useful for when you don't care when the resource is released other than that you want it released after the last reference to it disappears. In that case, automatic memory management saves you the trouble of manually tracking where the last reference disappears, and allows the runtime to schedule release at any arbitrary point - which may buy you performance.

      ``So GC is a tool that is useful in some instances, but its not something that should be your only option, unfortunately all languages that provide GC-based memory don't tend to offer much in the way of alternatives, unlike C++ which not only allows you to have GC memory management for objects you choose to be collected, but also allows you to have shared objects with deterministic finalisation, and also allows you to have cheap stack-based objects too.''

      Right. On the other hand, I'd argue that the correctness of your program depending on when a resource is released is very, very rare.

      Think about it this way: garbage collection reclaims the resources used by objects after you're done with them (last reference is lost, so you can't possibly do anything with these objects anymore). The problems you raise are really cases where you _do_ still

      --
      Please correct me if I got my facts wrong.
    5. Re:Resources other than memory by gbjbaanb · · Score: 1

      Hi. Did you know /. supports i and quote html tags (sorry, can't type angle brackets by themselves)

      My point about GC leakage is that people can too easily *think* they've released the object and consider it will clean up by itself, but find out later that their app is using 500 Mb RAM and has obviously got an 'error' *somewhere* in the program. GC gives you a false sense of security that a manual memory system doesn't - manual systems leakage is a outright bug more often caused by sloppy programming. Sometimes I think this is a flaw in the GC systems, if you have to manually de-reference an object, or manually call a closure method, its not as OO as I was taught (but I was brought up on RAII idiom)

      One thing about GC references and deferred finalisation is not that you want to close your handle or suchlike, its the next application along might want to open that handle and will fail because its technically still in use. Safehandle was introduced because the GC mechanism (in C#) couldn't provide application correctness.

    6. Re:Resources other than memory by RAMMS+EIN · · Score: 1

      ``But if the developer of a platform decides to make available only a non-real-time automatic memory management system, developers of interactive applications are screwed.''

      You mean "if there is something in the platform that causes every app to suck, then you're screwed". Yes. But actual real-time guarantees are very rarely needed. Yes, there are extremely sucky garbage collectors. There are insanely sucky malloc implementations, too. This is not an issue of automatic vs. manual memory management.

      ``I believe this makes up a large part of tracing garbage collection's bad reputation: early versions of Java had no real-time collector.''

      No, garbage collectors had a bad reputation long before Java existed. And they used to be bad. And bad ones are still being written. But they aren't necessarily bad, and some of them are actually really good. That's what I'm trying to get people to see.

      ``A lot of function calls that interact with memory allocate a piece of memory and then free it before the end. These are ideal candidates for reference counting.''

      Define "ideal". Reference counting is quite expensive. It also breaks when there are cycles in your object graph. If you use reference counting for resource management, you are effectively making your program slower while still allowing resource leaks. I don't see the point in that.

      If you want something like "close this file at the end of this block", you can use a construct like Common Lisp's with-open-file:

      (with-open-file (file "/etc/passwd")
        ; do something with file here
        )

      Or, of course, your favorite equivalent in your favorite programming language.

      --
      Please correct me if I got my facts wrong.
    7. Re:Resources other than memory by tepples · · Score: 1

      [Garbage collectors] aren't necessarily bad, and some of them are actually really good. That's what I'm trying to get people to see.

      But what platforms popular among end users have a "really good" garbage collector?

      If you want something like "close this file at the end of this block", you can use a construct like Common Lisp's with-open-file

      Python has that too and calls it "context managers". But the end-user poster child for garbage collection (that is, Java) does not; instead, it has finally, which makes managing those resources just as manual as managing memory is in C.

  93. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    Watch C#, it'll be adding some more multithreaded things in the 4.0 release

  94. Re:Do *not* optimize for readability (do a tradeof by dave1791 · · Score: 1

    If you can make the code 1% more readable (pick your measure) at the cost of making it take twice as long to write, is that worth it?

    If you can make the code 1% less readable and simultaneously make it twice as fast to write, is that worth it?

    Agreed.

    Now flip those numbers around. If you can make your code twice as readable (and maintainable) with 1% extra effort, is it not worth it? What if python's len() was ln() insread? As it it, the first few times I wanted to get the length of a list in python, I tried length(). The language sometimes uses full length English words and sometimes not. Compare "str"with "unicode".

  95. Re:C++ incomplete. C# windoz. Java slow elephant. by upuv · · Score: 1

    Yah but mono ain't C# at the end of the day is it.

    It will always be that bastard language child that sorta looks like it's dad. Sometimes it wants to do it's own thing and express it's own individuality sometimes it wants to be just like dad. In the end it's not dad.

    And cool apps just don't cut it at the Enterprise level. For id skimming iPhone apps sure but not big boy stuff.

    And really do we want to have a copy of something that is associated with the most hacked OS on the planet? No! I want something in my data center that is fast cheap to build and requires little attention. Windoz anything requires 24/7 hotline loven. I really don't want something that quacks like a duck walks like a duck but it's a turkey.

    Hell I'll take perl, ruby, python and php before a C# or it's bastard children.

    But that's just my opinion. :)

  96. Not for Android by Doc+Ruby · · Score: 1

    The compiled executables are completely native binaries, so it's not like a managed code language where the compiler generates bytecode for a virtual machine.

    Android, Google's OS for small/mobile devices (eg. netbooks and mobile "phones"), runs a virtual machine called "Dalvik". Android is programmed in Java source code, which is compiled into bytecode that is not Java, but specific to Dalvik. Dalvik is not a stack architecture like most virtual (and real) CPUs, but is instead a register architecture, which is more parallel.

    I'm surprised that Google is releasing a whole new language that is not targeting Dalvik with generated bytecode. Especially since Go is designed for parallelism. And also since they've got Rob Pike, who helped invent Unix and its programming environment (C) that go hand in hand. Pike also devised the Limbo language, which is a bytecode generator.

    Go really seems like a half measure. I wonder why they bothered.

    --

    --
    make install -not war

    1. Re:Not for Android by shutdown+-p+now · · Score: 1

      Dalvik is not a stack architecture like most virtual (and real) CPUs, but is instead a register architecture

      Most real CPUs (definitely all mainstream ones) are register machines, not stack machines. "Register architecture" doesn't mean that you do not have a stack at all. It just means that there is no data stack that is used for basic operations like addition (in a typical stack machine, like JVM or CLR, you have to do it as "push left operand; push right operand; add; pop result"). Register machines still have a call stack.

  97. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    I'd write Con and then press ctrl+space for autocomplete :-)

    Surely the compressed version would be ConnMgr? I know people say to remove the vowels, but that's not the actual rule!

    There are some nice things. How often have you written:

    if (v instanceof FooLongNameAnnoyingToTypeInnitFoooooo) {
            FooLongNameAnnoyingToTypeInnitFoooooo fv = (FooLongNameAnnoyingToTypeInnitFoooooo) v; ...}

    Go has:

    fv, ok = v.(FooLongNameAnnoyingToTypeInnitFoooooo)
    if ok {...}

    But that ok thing is probably because the language doesn't have exceptions. The slices should take care of AOOBEs though.

  98. Single-language platforms by tepples · · Score: 1

    Heres a novel idea. Use a language as a tool, and use the right tool for the job.

    Then platform makers should stop building around single languages when the language isn't the perfect tool for every application. For example, programs for "feature phones" must be written in Java (or a language trivially decompilable to Java), programs for Xbox 360's XNA must be written in C# (or a language trivially decompilable to C#), and programs for iPhone must be written in Objective-C.

    1. Re:Single-language platforms by TheTurtlesMoves · · Score: 1

      Which part of tool are you not understanding?

      The OS on these devices is not written only in these languages however, which does not make these languages useless as the GGP implied. What you have here is a vendor control problem. They are giving you a hammer even if you prefer to use screws, but only to a point.

      Just like the x86 can use more than compiled C. These devices can use a lot more than you are suggesting. The JVM (ok not the crap jvm me version on phones) supports a huge number of languages that compile to byte code. There are a large number of tools that compile C++/Java/C# to objective-C for the iPhone. The list goes no. Choose your weapon. Of if you are like most people, do what the boss tells you.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    2. Re:Single-language platforms by tepples · · Score: 1

      What you have here is a vendor control problem. They are giving you a hammer even if you prefer to use screws, but only to a point.

      But what's the appropriate solution to the problem of a vendor mandating an inappropriate tool?

      The JVM (ok not the crap jvm me version on phones) supports a huge number of languages that compile to byte code.

      Which is why I mentioned "Java (or a language trivially decompilable to Java)". Languages that compile to the JVM have semantics that map onto Java.

    3. Re:Single-language platforms by TheTurtlesMoves · · Score: 1

      Like lisp and scheme.... ? Really these languages have nothing that maps "to trivially decompilable to Java" in any sense other than a Turing complete language can always be translated into another Turing complete language.

      And what does java have to do with byte code? about as much as C has to do with the x86 instruction set is what (ok a little more, but not much).

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
  99. Yay! OS Hooks! by smcdow · · Score: 1
    Unlike some other popular languages, Go includes hooks into the OS:

    ... the low-level, external syscall package, which provides a primitive interface to the underlying operating system's calls.

    Finally, some sanity in language design. syscall will no doubt be used only occasionally, but it's there if you need it and you know what you're doing.

    --
    In the course of every project, it will become necessary to shoot the scientists and begin production.
  100. Re:C++ incomplete. C# windoz. Java slow elephant. by gbjbaanb · · Score: 1

    Back in the day, C++ was pretty much C code written with some nicer syntax features. the lack of a string class really doesn't make much of a muchness.

    Hell, even today, C++ is (well, should, you know some people overengineer C++ code so every little thing is a multiply-inherited object) pretty much C code packaged up with a nicer syntax. And some STL and Boost thrown in to make some things simpler.

    C# - suffers the same memory issues as Java. Practically *is* Java really.

    So Go.. add a common library of useful stuff and it could be a killer language, especially if Google drops their Java-based language they hacked up for Android and starts to use it for everything. Lets hope it doesn't become just another entry in the '99 bottles of beer' list. They're going to have to rename it though ;)

  101. meh by PJ6 · · Score: 1

    The syntax is nothing special. Let's see if it delivers anything compelling in practice.

  102. Re:C++ incomplete. C# windoz. Java slow elephant. by weicco · · Score: 1

    And really do we want to have a copy of something that is associated with the most hacked OS on the planet?

    Are you talking about C or C++? Those are the two languages Windows mostly consist of...

    --
    You don't know what you don't know.
  103. Re:Do *not* optimize for readability (do a tradeof by iris-n · · Score: 3, Funny

    Bad example. "len" was chosen to stop people typing "lenght", not to be shorter.

    --
    entropy happens
  104. Stupid Name by Iron+Monkey · · Score: 1

    Could they have chosen a worse name? I mean seriously, Go? That'll be easy to find on a search engine. Well I guess it's Google so they can special-case the word, but still.

    --
    If my enemy's enemy is my friend, what happens if my enemy is his own worst enemy?
  105. Great, yet another C/Python clone... by Hurricane78 · · Score: 1

    Innovation? What's that?
    Haskell? Never heard of it.
    Python? No, we can't just make an existing language faster.
    C? Yes we love the horribly crappy syntax of C, and will clone it.

    Yay! Yet another pointless reason for yet another pointless language.

    Sorry, but Haskell completely and utterly spoiled me for all other programming languages... :)

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
    1. Re:Great, yet another C/Python clone... by j1m+5n0w · · Score: 1

      As a Haskell programmer myself, I see where you're coming from, but realistically there are a lot of C and C++ programmers who are never going to be able to accept the idea of "everything is const". There are also some problems for which Haskell would not be a good choice. (That category is much smaller than I initially thought, but there are still a few problems where the easiest way to get good performance is to just write it up in C.)

      From the looks of it, the Go designers have at least borrowed some useful ideas from Erlang, and they have a primitive kind of type inference. Their "interface" mechanism also has a lot of similarity with Haskell's type classes.

      The Go designers may not have borrowed as heavily as they might have from Haskell*, but at least the result is a lot closer to Haskell than C or C++.

      * Things I hope the Go designers do borrow from Haskell: The "$" operator, Maybe types, parametric polymorphism. Things I hope the Haskell implementer borrow from Go: Erlang-style message passing, fast compilation.

    2. Re:Great, yet another C/Python clone... by Anonymous Coward · · Score: 0

      Well stated. I laughed when I read the FAQ. You could take the word "Go" out, put in any other language name, and it looks like the other language's FAQ:

      Why are you creating a new language?

      Go was born out of frustration with existing languages and environments for systems programming. Programming had become too difficult and the choice of languages was partly to blame. One had to choose either efficient compilation, efficient execution, or ease of programming; all three were not available in the same mainstream language. Programmers who could were choosing ease over safety and efficiency by moving to dynamically typed languages such as Python and JavaScript rather than C++ or, to a lesser extent, Java.

      Go is an attempt to combine the ease of programming of an interpreted, dynamically typed language with the efficiency and safety of a statically typed, compiled language. It also aims to be modern, with support for networked and multicore computing. Finally, it is intended to be fast: it should take at most a few seconds to build a large executable on a single computer. To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection; rigid dependency specification; and so on. These cannot be addressed well by libraries or tools; a new language was called for.

  106. gccgo? Why not LLVM? by Anonymous Coward · · Score: 0

    I'm curious as to why they went with gcc instead of LLVM for one of their first backends. It's pretty obvious there is a slow move to LLVM for everything. It's a lot easier to work with than gcc (ie. better design. The BSD's and such are already moving to LLVM/clang and such, it's only a matter of time before everyone else does.

    1. Re:gccgo? Why not LLVM? by Skapare · · Score: 1

      Let me know when the BSD and Linux kernels are entirely written in that. Then I will start to consider thinking about it.

      --
      now we need to go OSS in diesel cars
    2. Re:gccgo? Why not LLVM? by Anonymous Coward · · Score: 0

      The gccgo port was written by Ian Taylor, a long time GCC contributor, who does not know LLVM. It's interesting to note that LLVM is "too slow" compared to the plan 9 compiler (not compared to GCC *g*), but the plan9 compiler generates atrocious code.

      LLVM is actually quite speedy at -O0 mode, which is why it is used for JITs, perhaps the authors didn't try the right flags or something.

    3. Re:gccgo? Why not LLVM? by basiles · · Score: 1

      One of the main reasons to go to GCC not LLVM is that Google has several top GCC experts (nice people like Ian Taylor, Diego Novillo, Rafael Espindola and many others). On the contrary, few Google employees seem to post on LLVM mailing lists. And I see a simple reason for Google to pay leading experts on GCC. Google has a big lot of servers running Linux, and most of Linux is GCC compiled (in particular the kernel). Put it in a simpler way: if their experts are able to improve GCC just by 0.03% (or perhaps 0.05%) the saving in energy bills alone is paying the entire team of GCC experts at Google. In GCC summits some Google guys mention a single binary executable of more than 700 megabytes. I don't think that migrating such a monster program to Clang is easy, and an easy decision to take. In addition, Google has several Linux kernel experts (and they have their own patched kernel). These guys need GCC to compile that kernel. Perhaps Google also invest effort in LLVM. I don't know.

    4. Re:gccgo? Why not LLVM? by Anonymous Coward · · Score: 0

      Written? it's a compiler, not an editor. Oh, and clang/llvm compiles the FreeBSD and linux kernels just fine.

    5. Re:gccgo? Why not LLVM? by Skapare · · Score: 1

      It's also a run-time environment. Let me know when you port (write) a {BSD,Linux} kernel FOR that environment. Then I will believe it to be serious enough for the kinds of applications the Go language may be targeted for.

      --
      now we need to go OSS in diesel cars
  107. ChaiScript by lefticus · · Score: 1

    I may as well take the opportunity to mention a FOSS programming language I have been working on that is designed to enable the merging of the speed of C++ with the flexibility of a scripting language. It is a scripting language designed for embedding in your C++ application, and it makes it trivial to your C++ classes/objects/functions to the scripting language. It's called ChaiScript, we've been working on it for about 6 months now and have made several releases.

    ChaiScript works with your existing C++ code and doesn't require you to rewrite your application, like moving to a whole other language would.

    1. Re:ChaiScript by Skapare · · Score: 1

      What if I skipped over C++ for my stuff that needed OO? Actually, I am looking for a light-OO scripting language with a small footprint (not larger than bash itself, usable even in init code on embedded devices). Something like Javascript might do. But it needs to be a light weight implementation (speed isn't critical), and using reference counting instead of garbage collecting. I need it for standalone, but something that is intended for use embedded into applications can probably be used by making a simplistic host app that does nothing more than just run it.

      --
      now we need to go OSS in diesel cars
  108. Re:"Go" name already taken for programming languag by LaminatorX · · Score: 4, Funny

    Two "Go"s considered harmful.

  109. the language is an ancient secret by Anonymous Coward · · Score: 0

    first they made the Go language
    then they sat watching it's beauty for days.(100, 100 or so...)
    then they just could not control their love for it so they formed a company called ... .... Go Ogle!

    history.stack.pop(); :-D

  110. not even that by hbr · · Score: 1

    Not sure what compiler you are using - I make it 2940 bytes when compiling C after doing a "gcc helloworld.c" and "strip a.out".

    If I use "gcc -static hi.c", then it's up with the go version at about 500kB.

    Hmm. Must remember to get a life.

  111. 90000000000913 ! by Anonymous Coward · · Score: 0

    Plan 9,
    6g,
    Rob,
    go0gle,
    is it only me or does someone else also think these guys use keyboards with numeric pads?

  112. Re:"Go" name already taken for programming languag by azmodean+1 · · Score: 1

    I nearly injured myself with my tea because of your comment. Thank you.

  113. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    Ever heard of std::string and all the rest of the very well designed standard library? In fact I would risk to say, one of C++ greatest assets was the vision and cleverness of stepanov when we created the concepts that later became the standard library.

      Now how many languages have a standard implementation of the swap mechanic? Like std::swap? Something even more basic on conceptual level?

  114. Garbage collection by Skapare · · Score: 1

    According to the official site, "Go has ... garbage collection". Is it mandatory? Or can its usage be avoided? One of the issues I have with GC is the wider footprint (and subsequent swapping activity) it imposes. There are situations where I want to avoid GC, but want something more than Plain Old C.

    --
    now we need to go OSS in diesel cars
  115. Re:"Go" name already taken for programming languag by LaminatorX · · Score: 1

    So the statement was nearly accurate. ;-)

  116. What has the world come to... by jchandra · · Score: 4, Insightful

    Ken Thompson, who invented Unix, creates an experimental new language with Rob Pike et. al. and Slashdotters try to overdo each other in pissing all over it.

    Nice.

    Tell you what kids, try learning something for a change. And show some respect.

    --
    god n. : the Supreme Being, indistinguishable from a good random number generator.
    1. Re:What has the world come to... by DerekLyons · · Score: 1, Insightful

      Just because it was invented by somebody (or somebodies) who once invented something great a long time ago in a land far away doesn't meant that it automatically the most coolest, correctest thing ever. The once greats do fade, or get bats in the belfry, etc... etc...

    2. Re:What has the world come to... by swamp+boy · · Score: 1

      Tell you what kids, try learning something for a change. And show some respect.

      And get off my lawn.

    3. Re:What has the world come to... by BitHive · · Score: 2, Informative

      It's harder for people to show how smart they are by reflecting on things carefully and making posts that add to the discussion. Heck, they might even have to face the fact that they don't know enough to contribute anything meaningful. Shitposting is a good way to not face that reality, and go on about your smug day.

    4. Re:What has the world come to... by Anonymous Coward · · Score: 0

      Oldsters hold back and have held back progress in all fields. They should retire already and shut up so that the bottleneck to progress will be eliminated. We need fresh ideas, rather than propogandizing for stuff that should have died a long time ago.

    5. Re:What has the world come to... by cananian · · Score: 0

      And this language, in particular, combines all the worst features of C, Perl, and Python. I can't find a single example in the tutorial that doesn't make my eyes bleed.

      --
      [ /. is too noisy already -- who needs a .sig? ]
    6. Re:What has the world come to... by lennier · · Score: 0, Troll

      "Ken Thompson, who invented Unix..."

      Yes... about that.... the problem is, Unix isn't exactly the best designed OS of all time. It's there, and it runs, but it's not necessarily pretty.

      It survived, like C, so that says something... but mostly about how abysmally awful all the other alternatives have been.

      Go looks like a small step forward, in some ways, but... sigh. Better, but so little better.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    7. Re:What has the world come to... by blurbus · · Score: 1

      Sorry, but I don't worship people. I realize Ken & Rob are talented. But I'm not going to genuflect every time they do something. Just because they fancy a whim to create yet another programming language like C doesn't mean I should like it. There's plenty of worthwhile things out there to learn: a lot more important and time-worthy to learn than another C-like language. Maybe they need another hobby. And maybe you need to get a life.

  117. Re:"Go" name already taken for programming languag by HumanTorch · · Score: 1

    Not only that - the most obvious name for actual java scripting technology was taken.

  118. Re:"Go" name already taken for programming languag by unapersson · · Score: 1

    Can't you use it to script java applets? Kind of like a bridge between the applet and the webpage containing it. I've always thought that might be one of the reasons Sun allowed Netscape to rename LiveScript to JavaScript.

  119. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    Well, there's always FORTRAN... it does have very good multithreading/concurrency support, and is definitely fast.
    Oh, wait, you want string manipulation?

  120. Brainfuck rules! by xOneca · · Score: 1

    I program in Brainfuck, you insensitive clod, Google!

  121. Congratulations! You're writing low-level code. by jeffb+(2.718) · · Score: 1

    My biggest rant about most of these new languages: garbage collection is useless! I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement. Worse, it takes away my most powerful speed optimization tool: careful memory layout for best cache hit rates. I can write simple graph traversal code that is 10X faster in carefully designed C/C++ than in any garbage collected language for large graphs.

    If you're writing code that needs to know about low-level details of your hardware, you need to use a low-level language. I wouldn't be surprised if you could eke out another factor of two by spending some quality time with a logic analyzer and assembly code.

    When it comes time to make your code run as fast as possible in parallel across many cores, though, it gets harder to optimize without introducing bugs -- especially when, instead of a few hundred lines of carefully crafted graph-traversal logic, you're trying to maintain and extend a few hundred thousand lines of "everything else".

    It sounds like you've found a niche where your understanding of your problem, your compiler, and your architecture lets you win significant performance gains. That's great, but that niche is getting squeezed from both the bottom (as compilers, optimizers, and architectures get more sophisticated) and the top (as problems and applications get larger and more complex). For everything that doesn't fit into the niche, automation -- including highly-optimized and reliable garbage collection -- is far from useless.

  122. And exceptions have anti-race-condition support by tepples · · Score: 1

    I'm guessing the exception handling in python is more expensive than finding the length of your ArrayList-like object and responding accordingly.

    In Python, exceptions are cheap enough that programmers find it easier to ask forgiveness than permission in many cases. Even iterators end by throwing Python's equivalent of a j.u.NoSuchElementException within next() instead of returning False on some sort of hasNext(). Besides, exceptions reduce time of check to time of use to zero, unlike branching based on length and finding that another thread holding a reference to the same list has removed elements from the list behind your back.

  123. Doesn't Google fund Python? by Luke+has+no+name · · Score: 1

    Guido? How do you feel about this?

  124. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    C++ come on it didn't even have a string class

    Um, no string class in C++?

    std::string?

    #include ?

    No?

  125. Re:"Go" name already taken for programming languag by tristanreid · · Score: 1

    Good point, but they're actually two separate animals. The ability to script applets came after the fact, and it's really an additional library, not the language itself.

    -t.

  126. How many times have I heard it called "Java" by Fished · · Score: 1

    Not too long ago, we had a consultant from Sun write a PHP website for us, and he called all his Javascript "Java". The rest of his code lived up to similar standards of quality and technical erudition.

    --
    "He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
  127. Re:Do *not* optimize for readability (do a tradeof by thelexx · · Score: 1

    Considering you write it once and read it many, you have to multiply your (less than generous or realistic) 1% improvement in readability by how many times it is read.

    And practically speaking, come on, how fucking long does it really take you to physically write code anyway? Typing code in is the LEAST time consuming part of programming. Even a 25% increase in time spent typing amounts to a very small increase over time versus what is lost by people trying to follow compressed and abbreviated code.

    Simply put, sacrificing readability because you are lazy is just lame.

    --
    "Gold still represents the ultimate form of payment in the world." - Alan Greenspan, 1999
  128. Re:Lightweight languages do not remain lightweight by eric-x · · Score: 1

    >Now, we have Go. Is it a massive improvement over C and Java, thus justifying spending milions of dollars to train programmers? Only the future will tell.
    There is also Digital Mars D which is designed to fill the gap between C++ and Java. And there is also C#. I don't think the purpose of Go is to be something like that, it looks more like a scripting language with static typing.

  129. The ABA problem by Tetsujin · · Score: 1

    Here's a simple one. How about the ABA problem with a concurrent linked list. GC takes care of it.

    Mamma Mia! This scenario, that's me down to the last detail... My project, my love, my life, my obsession, whatever you'd call it.... The solution I came up with wasn't elegant at all, it went on and on and on... So long... Time is money, as they say, and this work was money, money, money, slipping through my fingers. And when I thought I had it going the right way... Bang! a boomerang, it came back and hit me in the face (figuratively speaking, of course...) When my co-worker Fernando reviewed my code I felt like I was under attack, my own personal Waterloo. I was really starting to feel that one of us was going to have to leave my office, and it sure wasn't me... But he suggested what you suggested - a fresh approach using GC... Just like that it was as good as new. GC really is the name of the game when it comes to the ABA problem in a concurrent scenario... I could have spent all our last summer at the company trying to make my non-GC approach work, knowing me. Knowing you, you probably would have gone straight to the GC approach in the first place and got it working just as well in a week. :)

    When all is said and done I think that GC has a lot to offer. I still think explicit resource management has its place, but people ignore the merits of GC because they're head-over-heels for the traditional approach, or because they believe GC is inherently more cost than it's worth... I have a dream that someday the programming industry will move as a whole beyond that mindset...

    --
    Bow-ties are cool.
  130. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    If you can make the code 1% more readable (pick your measure) at the cost of making it take twice as long to write, is that worth it?

    If you can make the code 1% less readable and simultaneously make it twice as fast to write, is that worth it?

    What about increases in coding time that result in decreases in debugging/support time? Comments and readable functions may take longer to write, but can offer benefits in the long run.

  131. So depressing by Anonymous Coward · · Score: 0

    Google, an enclave of some of the best and brightest in software engineering, and this is what they come up with?
    I have been getting paid to program computers for close to 40 years now, and during that time the BIG changes in programming have been losing Hollerith cards and editing that could edit any character in a file without re-opening the file. (TECO {*shudder*}) or throwing away the card!
    Pretty sad huh?

    The languages have all remained forks of Algol. This is the best we can do? Arguing about white space and libraries and late binding vs early binding, etc. Programs that are written in flat ASCII files, it all makes me sick.
    The computing power has gone through the roof with CPUs and GPUs that rival supercomputers and we are still using makefiles; static analyzers and debuggers. And arguing about the color of the font, or spacing used.
    Next time you think you are cutting edge, just realize that you are using tools that where designed 50 years ago, with almost no change!
    And when we designed those tools, they where so they could run on those old pathetic machines that consisted of rooms of equipment with cooling towers (the first computer I used had 48K of core memory, and export was controlled by the DOD), they where not designed to be human friendly.
    The programming paradigm should consists of the programmer expressing the unambiguous goals of the program, and setting a list of requirements, such as target CPUs, inputs and outputs, etc. and then the program is created to satisfy those programmer stats.
    Even better have the intended hardware target described in another unambiguous "language" that is passed into this "compile" as well, that way the tool knows if there even is cache available.
    I don't care how many cycles it takes to achieve those goals at "compile time", we have volatile and non-volatile memory that is measured in gigabytes, not k. With CPUs of amazing throughput. I want the tools to figure out if this fetch is from L1 or L2 cache, not me!
    And if my programming requirements stated that speed was important, then restructure the design of the program to use L1. This will take at most seconds on a computer not days of my life. I don't even want to know what it did to achieve my requirements, unless I specifically go looking for those answers. It is just that simple.

    Will we ever get away from these barbaric hardware defined and confined programming tools?

    1. Re:So depressing by Anonymous Coward · · Score: 0

      Next time you think you are cutting edge, just realize that you are using tools that where designed 50 years ago, with almost no change!

      Deities damn those ancient sumarians for inventing the circular wheel! Is this the best modern man can do..? Round wheels.?! I wonder...

      Will we ever get away from these barbaric hardware defined and confined programming tools?

      If you stare real hard at some high level code, you can pretend it's not all transistors underneath, delude yourself that executed instructions pass into an afterlife and replace our limited understanding of physics with whatever fantasy you desire. IOW, you can smoke crack for the rest of your life and you'll still not by transending your corporeal form.

    2. Re:So depressing by argent · · Score: 1

      Programs that are written in flat ASCII files, it all makes me sick.

      There's plenty of languages that don't use flat ASCII files. They don't get anywhere because they're inherently ghettoized. It's hard to even talk *about* Smalltalk, for example, without digressions about the workspaces and the GUI... even though these are the least interesting features of the language itself.

    3. Re:So depressing by Anonymous Coward · · Score: 0

      You took one statement out of my entire rant to rebut? In fact I really don't know what you are trying to convey.
      "YES" there are a few non-ASCII languages out there, probably the most popular of which is "G" (LabView). But all the ones I have seen are basically the same procedural language structures in another skin. And the reason G has been as successful as it has been is because it has a big company behind it. (I am not sure what you mean by "ghettoized").
      The point I was trying to make was that the entire programming paradigm is broken! And hasn't advanced any since the early 1960s.
      Which is sad considering that we (the people who get paid to program)consider ourselves creative!

    4. Re:So depressing by argent · · Score: 1

      You took one statement out of my entire rant to rebut?

      It happened to be a pretty important statement, because it shows you're focusing on irrelevant and trivial implementation details.

      "YES" there are a few non-ASCII languages out there

      Sure, I've used a number of them, starting with APL in the '70s and Smalltalk in the early '80s. I've even implemented back-ends for graphical process control languages. I'm pretty up on the subject.

      But all the ones I have seen are basically the same procedural language structures in another skin.

      Well, of course. Whether a language is rendered as flat files or pointy ones is just noise. Smalltalk is a perfect example of that. It would still be a breakthrough language design without the integrated GUI, the GUI is a distraction, it hides the language's real strengths from people who are hung up on the presentation. The important differences between language are in the grammar and semantics. The stuff under the skin.

  132. Also immutable objects are 100% safe in multi-threaded environments which means they require no mutexes/locks/semaphores or any other such thread access control tricks. This makes using them much speedier.

    Yes. And additionally, strings are the most common type of object used as a hash table key. Mutable keys can lead to nasty bugs.

  133. I know the parent poster by Anonymous Coward · · Score: 0

    and he's an incredible dick.

  134. Re:Do *not* optimize for readability (do a tradeof by Blakey+Rat · · Score: 1

    My favorite crappy name has always been the Javascript/DOM function XMLHttpRequest.

    A single function name that:
    1) Is inaccurate (it doesn't give a crap whether XML/JSON/plain text is received)
    2) Doesn't follow camel-case pattern (as is the convention with DOM functions)
    3) Writes two acronyms with different cases "XML" vs. "Http"-- both are acronyms, why the different case?

    The only slight excuse you can give it is that it was mostly invented to serve as an internal tool for Outlook OWA and IE, and somehow got "into the wild," but that's still not much of an excuse.

  135. Re:Lightweight languages do not remain lightweight by RAMMS+EIN · · Score: 1

    ``The same was said for Java. It was sold as the ultimate final language built on 50 years of accumulated knowledge of language design and computer architecture.''

    Seriously? If there is anything Java and the culture around it have done wrong, it is _not_ learning from what came before it.

    --
    Please correct me if I got my facts wrong.
  136. This just in... by XDirtypunkX · · Score: 1

    The second version of this language will be considered harmful.

  137. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    GOTO mod +5 Funny

  138. Re:Congratulations! You're writing low-level code. by WaywardGeek · · Score: 1

    I mostly agree with you. I have in fact found a niche that is getting squeezed, but not as fast as it should be. These techniques are simple to automate compared to the optimizations that are already done, but for some reason, innovation in runtime efficiency seems to have evaporated in the last 10 years or so. It's probably because everyone sees the niche getting squeezed and moves on to some other problem.

    A native Java compiler should be able to analyze my loops, and break up objects into well chosen chunks, and allocate those chunks together in memory. This alone would make it instantly the fastest computer language in the world for memory intensive applications.

    I think language developers are also missing out on innovations that could greatly reduce bugs while simplifying coding. Garbage collection is good for what I call "value" objects like strings, and matrices. However, for normal objects representing things you'd typically see in a relational database, like "employee", you still have to write a destructor manually. The destructor will remove the employee from it's department and any other relationships with other objects before deleting it. GC doesn't help me at all in managing simple databases with objects like employees. If I forget to clean up a relationship, with GC I get a memory leak, while in C++ I get a dangling pointer. I wouldn't say one is better than the other.

    Instead, the compiler should generate the destructor automatically for me, by analyzing the relationships and through some user declarations. This capability already exists in relational databases. Unlike GC, compiler-generated destructors save the coder time and nearly eliminates very painful memory leaks/dangling pointers.

    I'm not just hypothesizing. DataDraw writes 100% of all my destructors when I'm programming in C. My little company has so few memory leaks and dangling pointers most programmers don't even know how to run valgrind. Mostly we use it to measure cache statistics.

    --
    Celebrate failure, and then learn from it - Nolan Bushnell
  139. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    When you realize that people who do not speak English as a first language find your abbreviations completely unreadable, they become a lot less attractive.

  140. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    Pretty good point, actually. Like the examples.

  141. Re:"Go" name already taken for programming languag by T.E.D. · · Score: 1

    I guarantee you some enterprising squatter has already gone out and registered the .com and .org for every alternate name mentioned in that thread too.

  142. Content of golang.org for a visitor from Iran by mebrahim · · Score: 1
    Google Error

    Forbidden

    Your client does not have permission to get URL / from this server. (Client IP address: ***.***.***.***)

    You are accessing this page from a forbidden country.

  143. Re:"Go" name already taken for programming languag by Archibald+Buttle · · Score: 1

    There's a petition now to change the name to "Issue 9": http://www.petitiononline.com/gglgoi9/petition.html

  144. ArrayIndexOutOfBoundException by johanwanderer · · Score: 1

    Just nitpicking here, but how often do you explicitly declare or catch an ArrayIndexOutOfBoundException? It is, by definition, a RuntimeException, and only occurred when something *really bad* happened, e.g. indexing into an array using an invalid index. When it does occur, whatever that thread is doing should pretty much be thrown out, bug report filed, and programmers put back to work figuring out what really happened.

    Just because a method declares that it might throw a particular exception doesn't mean you have to catch (or declare) exactly that. For example, there is nothing wrong with saying that your method throws an IOException when its dependencies throw a MalformedURLException. As the individual lines of code aggregate and become blocks and bigger blocks, the exception signature should become more generic.

    A high-level block of code that deals with high-level IO should throw only IOExceptions. It might have to catch some other exceptions and convert it into IOExceptions, but the calling code doesn't have to know all that. All it need to know is that something went wrong, with the detailed information on the stack trace. Just enough to log the error, clean up the mess, and terminate.

  145. Semicolons by Anonymous Coward · · Score: 0

    The release of a new programming language and another opportunity squandered to ditch semicolon statement terminators forever.

  146. Alternative names by AlpineR · · Score: 1

    !Go! (since it's not Go!)
    Goobar
    Goooooooooooooo
    6o
    G0

  147. But the real question is... by SarekOfVulcan · · Score: 2, Funny

    Has anyone implemented Go in Go yet?

  148. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    According to Wikipedia's edit history, the "Go programming language" page on Wikipedia was only created yesterday. Therefore it might've been hard to find this guy's language.

  149. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    "I find that if you shorten long words arbitrarily, it actually increases the writing time"

    I think the real problem is that the naming of variables and functions and what have you should already be in a list with functional autocomplete already that gives common variable and other names and bind them unique ID's, so that you can use the same name more then once with a different ID.

    I think the whole programming nomenaculture needs serious updating

  150. Re:Congratulations! You're writing low-level code. by larry+bagina · · Score: 1

    If your database doesn't do that stuff for you already, maybe you should look into one that supports triggers or foreign key constraints.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  151. Fast compile times? by Anonymous Coward · · Score: 0

    In terms of speed, they report compiling 120,000 lines under 10 seconds for Go on a laptop. On the Mono project they report compiling 18,000 lines of C# per second on a t40 Thinkpad. So Google's Go compiler written in C/C++ is slower than the Mono C# compiler written in managed code? Impressive.

  152. 10 seconds is just not fast; Sorry guys by cb123 · · Score: 1

    I just used tcc to compile itself in *100 milliseconds*, some 100X faster than the Go advertisement. Does Go actually do 100X more work than a C compiler? Doutbful. It may be 100X faster than the insanity that has become gcc compiling itself, but it actually sounds pretty slow for what it does.

  153. Re:Named after the most difficult-to-master game e by Thing+1 · · Score: 1

    I will probably mature [...]

    Doubtful?

    --
    I feel fantastic, and I'm still alive.
  154. Eliminating getter/setter by DrFalkyn · · Score: 1

    I was wondering if any programming language has done something like this:

    class A {
          property B { // specify B's type
                  type integer; // specify legal values for B
                  constraint B > 0;
                  constraint B 100; // specify that B can be read and written from outside the class
                    public read, write; // specify default value, used on initialization
                    default 1;
            }
    }

    Would seem to reduce the amount of boilerplate code you would have to write in terms of getter/setter functions, and make everything clearer. You could just say A.B = 5 or C = A.B without having to call A.setB(5) A.getB(). Object initialization would also be much more clear, you would simply create the object and set any values you want.

    1. Re:Eliminating getter/setter by Anonymous Coward · · Score: 0

      http://boo.codehaus.org/

    2. Re:Eliminating getter/setter by cananian · · Score: 1

      Take a look at javascript, especially ES5.

      --
      [ /. is too noisy already -- who needs a .sig? ]
    3. Re:Eliminating getter/setter by Anonymous Coward · · Score: 0
    4. Re:Eliminating getter/setter by Bob+Uhl · · Score: 1
      Take a look at this Common Lisp:

      (defclass a () ((b :accessor b :initform 1 :type (integer 0 100))))

      Although it's up to your implementation whether or not to enforce the type declaration.

  155. Re:Named after the most difficult-to-master game e by Anonymous Coward · · Score: 0

    I will probably mature around the time Goooooo comes out

    ... that's what she said.

  156. I'm done with file based languages by jamie(really) · · Score: 1

    I'm done with any language that requires that one file references another by a *path*. So when I have to do something low level enough for C, I'll probably stick with that, since at least my editors can deal with that shit for me.

  157. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    Actually, JavaScript was there first. It shipped with Netscape 2.0 beta in December 1995. Sun claims that Java was released in 1995, but in fact it wasn't available until January 1996.

  158. dvorak by j1m+5n0w · · Score: 1

    I do that. It's really not that big of a deal; sometimes I'm not even consciously aware that I've switched layouts. For awhile I had trouble with letters like "y" that you type with the same motion but the opposite hand.

  159. Re:Congratulations! You're writing low-level code. by WaywardGeek · · Score: 1

    My in-memory data-base built in C using DataDraw does this already. The speed rocks. Before writing the first version of DataDraw back in 1991, I read about relation databases, and was somewhat inspired. Why we have these innovations in databases, but not computer languages, I can't guess.

    --
    Celebrate failure, and then learn from it - Nolan Bushnell
  160. Re:C++ incomplete. C# windoz. Java slow elephant. by LionMage · · Score: 1

    And no, "that was only added in 1995" doesn't count as a criticism since C++ was not defined as an ISO standard until 1998 and std::string has been there ever since.

    And for those of us who were writing C++ code before there was an ANSI (let alone ISO) standard, how would this not be a legitimate criticism? I started writing C++ before templates were a standard part of most C++ implementations, and many C++ compilers I used were glorified ports of the AT&T cfront C++-to-C compiler.

    That there were no decent standard libraries before circa 1995 is bad enough. Even well after that time, there were still C++ environments I had to write code in which still didn't support templates, or didn't have a decent string class, or were missing the many useful things in STL. I distinctly remember contacting an old professor of mine at RPI to get a working STL I could use for a project at American Express, and this was circa 1996, maybe 1997. I also remember trying to port a Windows application for IGC -- it apparently built fine on Solaris using Mainsoft's MainWin porting libraries, but the HP-UX compiler was a whole other kettle of fish that required the programmer to supply separate files to give it hints on how to instantiate templates.

    Even when strings were widely available in all major C++ implementations, a lot of old hat C++ programmers were writing their own implementations or using some third party string implementation instead of using the standard. I suppose some of that is programmer inertia, and some of that is lack of trust in the "official" implementation. I think the lesson here is, "Never ship a new programming language without all the basic data types and collections taken care of."

    I think a lot of the rest of what the GP has to say is bunk or suspect, but you can't just dismiss the bad experiences that a lot of developers had with C++. Many of us were forced to use it long before it was fully baked and ready. So yes, it's entirely fair to criticize a programming language if it's in wide use before a standard is finalized.

  161. Comma grouping at every factor of 1,000? by zooblethorpe · · Score: 1

    version 2: Goo
    version 3: Gooo

    It will probably mature around the time Goooooo comes out - can't wait to use it!

    Shouldn't that be G,ooo,ooo? Or perhaps the first "o" for the zeroth release, so the upcoming first release will be Gone? :)

    Cheers,

    --
    "What in the name of Fats Waller is that?"
    "A four-foot prune."
  162. Re:C++ incomplete. C# windoz. Java slow elephant. by Anonymous Coward · · Score: 0

    Note the use of the past tense. Didn't. As in, C++ didn't have a string class, but now it does.

    It may surprise you to learn that people were programming profitably in C++ long before there was an ANSI or ISO standard, and in those days using a C++ compiler was a crapshoot as to which features you might get.

  163. Re:C++ incomplete. C# windoz. Java slow elephant. by HiThere · · Score: 1

    The ISO may only have defined a C++ standard in 1998, but there were many users a decade earlier. The first C++ compiler I used was cfront, and it compiled C++ to C. I found it more of an improvement over C than I find the current C++ compilers. (Due to work considerations I spent a decade with MSAccess & it's version of VisualBasic...which wasn't even standard MSVisualBasic. Yuck!!!) When I came back to C it was via Ruby & Python. C++ was virtually unintelligible. (Not really, but I *REALLY* despise templates! Give me Ada generics any time as an alternative. If Ada had decent string handling, I'd never have looked at C again.)

    To me Google go looks like an interesting language. I'm not clear how one should convert uint64's into a ubyte[], but outside of that I think I'm sold...at least enough to give it a test. It's lacking in libraries at the moment, but if it becomes at all popular that should diminish quickly.

    FWIW, I've currently been using D as the best language for performance, etc., but D doesn't handle multiple-processors gracefully. They've got a library, and they're planning to improve it, but it's an "add-on", not a built-in. To me this is an important feature, and I don't currently know any language that handles it well. (Yeah, I've looked at Erlang. I've also timed simple programs. I think I'd do better with Python. In Erlang if you can directly apply the language built-ins, you get good performance. Otherwise not. And the built-in database doesn't appear to do what I want. And other parts of the program chain were just too slow.)

    Of course, this is all based on their assertion that Google go really *IS* in the same speed ball-park as C. D is, so it's not impossible. But many languages that make that claim aren't. (I guess it depends on what you're doing.)

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  164. verbosity != readability by sakti · · Score: 1

    Verbosity of syntax doesn't help with readability, it works against it.
    You can't read what's not on your screen.

    --
    "It is better to die on one's feet than to live on one's knees." - Albert Camus
  165. Re:Do *not* optimize for readability (do a tradeof by Anonymous Coward · · Score: 0

    The approach is not to remove all vowels, but to come up with a short name that has very low chances of being confused as something else. using your approach "format" would be frmt; but fmt has been in use for long time and people automatically associate that permutation to the word format. ConnectionManager would be ConnMgr or CtnMgr, I think.

  166. Re:"Go" name already taken for programming languag by lennier · · Score: 1

    Simple solution: Google should rename theirs to 'Goo'...

    --
    You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
  167. Re:Lightweight languages do not remain lightweight by Abcd1234 · · Score: 1

    Actually, you're quite wrong. Go is *specifically* designed to act as a new systems-level programming language akin to C++ or D. Of course, it inherits a number of features from various high-level languages (not the least of which is an integrated GC), but in the end, it's meant to be used as a replacement for C/C++/Objective-C/D, rather than, say, Python or Perl.

  168. Re:C++ incomplete. C# windoz. Java slow elephant. by Abcd1234 · · Score: 1

    Yah but mono ain't C# at the end of the day is it.

    Huh? Mono's implementation of C# will always be C#, as the language spec is open and standardized.

    It will always be that bastard language child that sorta looks like it's dad.

    I can only assume you're talking about the class library, here. Of course, C# and it's stack is no different than C + POSIX, here. The basic libraries and functionality are, again, standardized, and Mono implements those. In addition, it provides a stack of APIs to integrate with various OSS technologies (Gtk, Gnome, various databases, etc).

    'course, I'm not sure what your point is. Mono implements the standard, just like gcc and glibc implement a standard. Mono then adds a bunch of it's own stuff. I don't see a problem here.

    And really do we want to have a copy of something that is associated with the most hacked OS on the planet? No!

    Uhh... why? Frankly, you sound like an idiot, here. C# and the related APIs are a decent piece of technology. Ignoring it because it was produced by the same company that produced Windows is completely idiotic.

    But that's just my opinion. :)

    Clearly an ignorant, uneducated one. But, this is Slashdot... I expect little else.

  169. Unfortunately they blew the System call interface by tlambert · · Score: 1

    Unfortunately they blew the System call interface on Mac OS X.

    Mac OS X defines the system call API as the top of Libc, not the bottom at the user/kernel boundary.

    You can see this in their implementation of the "kill" and the "posix_spawn" system calls, but there are tons of others:

            SYS_KILL = 37; // { int kill(int pid, int signum, int posix); }

            SYS_POSIX_SPAWN = 244; // { int posix_spawn(pid_t *pid, const char *path, const struct _posix_spawn_args_desc *adesc, char **argv, char **envp); }

    Most of the places they say "NO_SYSCALL_STUB" are actually decorated version of system calls for binary backward compatibility. If they ever include Framework support for certain existing frameworks, they are going to find that their use of 32 bit libraries may result in unexpected-by-the-framework cancellation points that need to not be there.

    The kill system call changed from older versions of the OS to ensure POSIX compliance for one compilation environment, and historical behaviour; in fact, for the 32 bit version of libc, there are 189 decorated symbols for doing everything from translating error codes to getting variant behaviour to enforcing POSIX semantics in user space in libSystem itself, and there are 74 variants for cancellation points in both 32 and 64 bits.

    Changing the contract between libSystem and the kernel under the covers to fix bugs happens often. The posix_spawn() system call is a good example of that. Apple has extended spawn several times by modifying the _posix_spawn_args_desc. The code itself uses accessors and mutators on an allocate descriptor. It can change (and does) size when new extensions are added.

    Basically by providing their own direct system call interface, they've guaranteed that they will constantly be chasing a moving target, and they've lost a lot of the default POSIX semantics that are implemented at the libSystem level. For kill and similar calls, they've lost the go code portability between OSs by doing this.

    Finally, they need a type mechanism so that the unsupported interfaces can be conditionalized based on the UNIX standard permitting non-implementation of certain interfaces; otherwise they will run into things like unnamed semaphores which will throw a SIGSYS, which will abort their programs.

    -- Terry

  170. Re:Lightweight languages do not remain lightweight by jipn4 · · Score: 1

    If this language becomes as popular as Perl, then 120,000 lines will soon become 1,200,000 lines. That is exactly what happened to the Perl interpreter and compiler.

    I doubt it. The Perl-community is enamored with features and bloat. The people behind Go are hostile to it.

    And, as I recall, never in their history were Perl or Java quick to compile.

    Also, just like Java, the new Go language (due to the immense respect for Google's scientific prowess) will likely receive accolades

    Who cares? The world is full of idiots. Hey, you just made an idiotic argument yourself, to paraphrase "Because Java is bad and Java received accolades, Go will be bad if it receives accolades too."

  171. first impressions by jipn4 · · Score: 1

    It seems like a variant of aleph, a Plan 9 language.

    It's not bad, and I think it's a worthy replacement for C.

    They really need to work on their installs. Having different compiler names for different target platforms is silly. And having a build process that requires the user to set environment variables is equally silly.

  172. Interfaces by elnyka · · Score: 1

    Where C++ provides classes, subclasses and templates, Go provides interfaces. A Go interface is similar to a C++ pure abstract class: a class with no data members, with methods which are all pure virtual. However, in Go, any type which provides the methods named in the interface may be treated as an implementation of the interface. No explicitly declared inheritance is required. The implementation of the interface is entirely separate from the interface itself

    Now, this is awesome.

  173. re: I wonder why they bothered. by j1m+5n0w · · Score: 1

    They say that Go was designed to give them a better language for writing server code than the C++ they're using. I think it makes a lot of sense in that context. They don't need to use Go in every project to be a worthwhile effort.

  174. On Maybe types and NULL pointer exceptions by j1m+5n0w · · Score: 1

    I'm going to elaborate on the Maybe type idea because I think it is important. In Haskell, there's no distinction between a value and a pointer to a value, and these things can't be Null. In C, one often wants to represent, say, an optional value. A pointer can be used for this: it is either assigned a value, or it is NULL. In Haskell, we do the same thing with a Maybe type. Maybe is a container that can either have the value "Nothing", which means it's empty, or "Just a" where "a" is the value you stored.

    The important thing about Maybe types is that they let you make a distinction between things that can be empty and things that can't. In C, any pointer can be NULL, so we can't tell from the type signature of a function if it's okay to pass in a NULL value or not. And indeed, a large proportion of all C runtime errors is the dreaded NULL pointer exception.

    What I am suggesting, is that Go should have a notion of a pointer that can only point to a valid object, and a pointer that can be set to NULL. They type system should distinguish between these two cases, and the compiler should fail if the user tries to mix the two. NULLable pointers should only be used when absolutely necessary.

    From what I've read so far, I have no idea if Go allows standard pointers to be NULL.

    1. Re:On Maybe types and NULL pointer exceptions by j+h+woodyatt · · Score: 1

      Cyclone has what you want here, and yes, Go also perpetuates Tony Hoare's Billion Dollar Mistake.

      --
      jhw
  175. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    Two "Go"s considered harmful.

    Thank you, sir.

  176. Copy Paste Much? by Buttink · · Score: 1

    Java + C + Ada + Erlang = Go lol

  177. Re:C++ incomplete. C# windoz. Java slow elephant. by Spykk · · Score: 1

    How can you speak highly of C and then write off C++ because it has no inherent string type? In C your only option is char arrays or rolling your own string concept. C++ has those options as well as a very nice string class included in the standard library.

  178. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    0% of 1 user recommends this project

  179. Re:Named after the most difficult-to-master game e by Anonymous Coward · · Score: 0

    Just be happy it's not battletoads

  180. Re:"Go" name already taken for programming languag by Anonymous Coward · · Score: 0

    This Comment deserves to be a Slashot Headline!

  181. Re:Do *not* optimize for readability (do a tradeof by jonaskoelker · · Score: 1

    I don't speak English as a first language. I find fmt, ConnMgr, recv, sys, btn, etc. to be perfectly readable abbreviations.

    Is it a surprise to you that the Danish branches of $SOFTWARE_COMPANY (at which I've worked) requires its employees to be good (or at least decent enough) at English?

  182. Re:Do *not* optimize for readability (do a tradeof by jonaskoelker · · Score: 1

    Granted, I picked arbitrary figures to argue a point.

    Also, I disagree: it's not written once. It's written once, then rewritten several times, in a sequence of small patches.

    And I think there's value to be had if you can type less: while typing, you can't really think that well about what you're going to write next (at least not as well as if you weren't typing).

    I think in some (some!) cases my position is very defensible: does "len" really take longer to read and understand, compared to "length"? My experience is that it's the same, so why not save the typing time?

    That being said, I think you are right in some cases. I don't advocate brevity at all costs. I advocate brevity in the cases where they're a net win.

    Then, "in which cases is it a win?" is an empirical question that I don't know the answer to.

  183. Re:C++ incomplete. C# windoz. Java slow elephant. by acheron12 · · Score: 1

    C++ come on it didn't even have a string class. Thus pointer math hell.

    #include <string>

    int main() {
    std::string s = "What am I, chopped liver?";
    cout << s;
    return 0;
    }

    --
    there is no god but truth, and reality is its prophet
  184. Re:Do *not* optimize for readability (do a tradeof by maxume · · Score: 1

    Optimizing frequently used internal functions is a different thing than optimizing every variable name.

    --
    Nerd rage is the funniest rage.
  185. Nobody needs yet another imparative language? by Ramin_HAL9001 · · Score: 1

    Languages that are supposedly fun and easy to use are a dime a dozen, and yet another like this "Go" is the last thing anyone needs. C++, Java, Python. Ruby, Perl, and now "Go" all are basically the same with different syntax and type checking features. Go won't solve their underlying problems. That is why we have Ocaml and Haskell. I really can't understand why anyone even bothers with imperative languages anymore. Aggressive type checking and the everything-is-a-function paradigm is the only way to go.

  186. Why? by Anonymous Coward · · Score: 0

    This just leaves me wondering: why do we need yet another programming language that looks sort of like C? Ugh. We have a glut of different languages somewhat similar.

  187. Re:C++ incomplete. C# windoz. Java slow elephant. by sproketboy · · Score: 1

    8 gig for a Java app? WTF are you doing - adding the whole app to session variables or something?

    We deploy a large Java app which runs nicely under 512 on 2 gig web servers. Maybe it's time for you to go back to the books.

  188. Nice name... by DaVince21 · · Score: 1

    What's Google implying? That I Go ogle people?

    --
    I am not devoid of humor.
  189. Re:C++ incomplete. C# windoz. Java slow elephant. by mahadiga · · Score: 1

    Clearly web centric

    But isn't PHP & Python web centric?

    --
    I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
  190. Slices from xmlrpc by mahadiga · · Score: 1

    typedef struct _xmlrpc_mem_block {
    size_t _size;
    size_t _allocated;
    void* _block;
    } xmlrpc_mem_block;

    I think http://golang.org/doc/go_for_cpp_programmers.html#Slices are picked from http://xmlrpc-c.sourceforge.net/

    --
    I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
  191. My favorite long identifier by SeanAhern · · Score: 1

    XCreatePixmapFromBitmapData