12 ms·
Google Go: A New Programming Language That’s Python Meets C++
- byrneseyeview 17y agoChrome. Closure. Go. It says great things about Google that these all clearly started as projects that they assumed nobody would ever have to Google. (Although http://www.google.com/chrome http://www.google.com/chrome is now #1 for [chrome]).
- jkincaid 17y agoIs there a reason why so many languages are nearly impossible to search for? (C, C++, Go, etc.) I mean, surely someone must have figured out that this is not the best naming trend quite a while ago.
- 83457 17y agohttp://www.google.com/search?hl=en&q=%22[[INSERT_PROGRAMMING_LANGUAGE_NAME_HERE]]+programming+language%22 http://www.google.com/search?hl=en&q=%22[[INSERT_PROGRAM...
- mdemare 17y agoOur kind is so dominant on the net that our interests eclipse the original concepts. Try googling Java, Python, Lisp or Ruby - not much about Indonesia, snakes, speech impediments or gems to be found.
- joeld42 17y agoReally? http://tinyurl.com/y8zjorj http://tinyurl.com/y8zjorj
- deleted 17y ago[deleted]
- igrekel 17y agoHem... at one point you will need to search for more specific things. "package management for go programming language" or "XML parser go programming language" probably won't be so useful, and it is sure cumbersome to type.
- frognibble 17y agoRich Hickey picked the name Clojure partly because the name is easy to search for.
- btilly 17y agoPerl was chosen in part for the same reason. Long before Kibo made searching for your name on usenet famous (how many here remember Kibo?), in the early days (late 80s until the volume got too high) Larry Wall used to monitor all mentions of Perl on Usenet.
- elblanco 17y agoI haven't heard that name in a very long while.
- qohen 17y agoKibo -- The man: http://en.wikipedia.org/wiki/James_Parry http://en.wikipedia.org/wiki/James_Parry The myth: http://en.wikipedia.org/wiki/Kibology http://en.wikipedia.org/wiki/Kibology The lore: http://www.kibo.com/menu.shtml http://www.kibo.com/menu.shtml
- cstross 17y agoNot only do I remember Kibo; I was killfiled by Kibo ... (I feel old, now. Time to think about learning a new language.)
- sans-serif 17y agoThose are nothing compared to d and r (relatively unknown) and my favorite: io.
- elblanco 17y agofunny, I can always find malbolge.
- mnemonik 17y agoHave you ever tried to find anything about Io (http://iolanguage.com http://iolanguage.com) through google? Impossible. Any projects I think up in the future are going to have to be named from this angle: how easy will it be to google for?
- thomas11 17y ago"io language" or "io programming language" work just fine. Of course I don't know what I'm missing, but I assume everyone who writes about Io uses one of these words in their text.
- msluyter 17y agoSearching "go programming language" (without the quotes in the search) seems to work for me.
- andreyf 17y agoHm, it could be a self-challenge - make web search good enough to know what I'm talking about when I look for Go? I'd expect: the game, then the language. Certainly not go.com
- whatusername 17y agoSince I saw this the other day: http://duckduckgo.com/?q=go&v= http://duckduckgo.com/?q=go&v=
- ynniv 17y agoMaybe its a branding exercise in disguise. You can't search for ["Chrome", "Closure", "Go"], but for the first two you quickly get what you're looking for if you associate the company name: "Google %s".
- snprbob86 17y agoIt's legally the safest and easiest route. If your company name is already trademarked, you don't need to worry about someone tacking a common word on the end and stealing it. This is why so many Microsoft products have such generic names -- and all of them include at least one prior trademark. Google is at least trying to keep a flat namespace instead of Microsoft's nested hierarchical mess. If nothing else, it would help prevent duplication of efforts because of potential naming conflicts.
- garnet7 17y ago> This is why so many Microsoft products have such generic names Actually, in their case, I think it's more that they want to choose names are a mix between commonly-used word and one that is similar to an already existing product. Wordperfect --> Word, Netscape Navigator --> Explorer, OO.o XML --> OOXML, etc.
- rayvega 17y agoIt seems another programming language named Go! already exists: http://news.ycombinator.com/item?id=935545 http://news.ycombinator.com/item?id=935545
- prabodh 17y agoI am just wondering how same link got posted twice ... http://news.ycombinator.com/item?id=934140 http://news.ycombinator.com/item?id=934140 ....Both point to http://golang.org http://golang.org ..
- mdemare 17y agoLooks interesting! I feel that an improved C is what's mostly lacking in the programming language landscape nowadays. So now Google's got its own OS (two actually), browser, and now its own programming language. Anything missing yet? Their own editor / IDE?
- andreyf 17y agoTheir own editor/IDE? I wouldn't imagine this as something that they'd release.
- ecuzzillo 17y agoOh, you never know. They release a lot of the not-business-specific infrastructure they improve, which an editor undoubtedly is. I'd argue their secret sauce, and the parts they wouldn't want to release, are - the insane scaling stuff - all the intelligent things they do with the insane amount of data they have, and the insane rate at which they can process it
- viraptor 17y agoIt's like several people got the same idea... http://ooc-lang.org/ http://ooc-lang.org/ is also an improved C really.
- SwellJoe 17y agoBram Moolenaar (vim) is a Googler.
- mbrubeck 17y ago...and has his own experimental C language replacement: http://www.zimbu.org/ http://www.zimbu.org/
- blasdel 17y agoThey actually maintain at least four browser codebases: Chrome, Android's Webkit, Picasa (uses Gecko), and their server-side renderer. They have at least three product OSes: ChromeOS, Android, and The Google Search Appliances. This is at least their second new programming language project: there's also Rob Pike's Sawzall. They have numerous in-house implementations of existing programming languages: V8, Closure, GWT, Dalvik, Unladen Swallow, plus all the extant ones they maintain forks of.
- frankus 17y agoI can't find any sort of reference to a Google sponsorship. Am I missing something?
- akamaka 17y agoI'd have to disagree with the title "Python meets C++". There's very few features that have been brought over from either of those languages. It looks like C with some very carefully chosen additions: memory safety, concurrency and maps.
- mbrubeck 17y agoI agree. From the FAQ: "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." Two of the designers were Rob Pike and Ken Thompson, both instrumental developers of Unix/C and Plan9/Inferno. Thompson created the B programming language that C was based on.
- dhess 17y agoDon't forget Russ Cox, who I believe stuck with Plan 9 longer than either Rob or Ken. I'm excited to see CSP in Go. I've been advocating its use for concurrency since I learned about Plan 9's channels, but most people paid no attention.
- uriel 17y agoRuss still maintains 9vx and Plan 9 from User Space.
- ypavan 17y agoFrom the Tech Talk PDF, it is mentioned that Robert Griesemer, Ken Thompson, and Rob Pike started the project in late 2007. Ian Lance Taylor and Russ Cox joined in 2008. And the goal, as they mention, seems to have the efficiency of a statically-typed compiled language with the ease of programming of a dynamic language but with - Safety: type-safe and memory-safe. Good support for concurrency and communication. Efficient, latency-free garbage collection. High-speed compilation. They are aiming at a lightweight type system with no implicit conversions and no more 0x80ULL. A good starting point is their FAQ page and also the tech talk at youtube: http://www.youtube.com/watch?v=rKnDgT73v8s http://www.youtube.com/watch?v=rKnDgT73v8s
- tptacek 17y agoI am not so interested in Go as an implementation platform, so much as I am in the idea of a bridge for web programmers to real C.
- mdemare 17y agoI like C, maybe it is Good Enough, but don't you think C has some real flaws that could be fixed in a newer language?
- tptacek 17y agoI think there's ~30 years of C code that isn't going away and that is going to remain the bottom layer of most programming stacks, and it's good for devs to be able to drop into it.
- mdemare 17y agoThere will always be a need for a bottom layer language, but 20 years from now, will it still be C? I hope at some point the world will migrate to a newer language.
- blasdel 17y agoAnything you could write a native filesystem or device driver in would be semantically quite similar to C, even in the ideal microkernel fantasy.
- jacquesm 17y agoWhy would you hope that if the old language is doing just fine for the purpose ?
- anigbrowl 17y ago'Just fine' is relative. The state of California still does all its financial transactions on a mainframe running COBOL; the cost of maintenance rises every year, but thanks to our budget deficit nobody wants to write the check for the cost of replacement.
- benreesman 17y agoI was ready to be dismissive until I read who was behind it. This is part of the Bell Labs legacy. Kickass.
- viraptor 17y agoI also suspected bell labs the moment I saw the page... not sure where that idea came from. Maybe from this? ;) http://plan9.bell-labs.com/plan9/img/plan9bunnyblack.jpg http://plan9.bell-labs.com/plan9/img/plan9bunnyblack.jpg http://golang.org/doc/logo-153x55.png http://golang.org/doc/logo-153x55.png [edit: creepy thought... Go logo == the Glenda bunny being thrown at something?]
- Semiapies 17y agoPerhaps flying? :)
- amichail 17y agoHow come who was behind it is important but who says what on HN is not? One could have extra information right beside each submitter/commenter's name (e.g., ... founder, Google employee, PhD in ..., etc.).
- tspiteri 17y agoYou can say that who is behind it is important because you do not need to add extra information besides their names, their names stand on their own.
- tumult 17y agoI use C when I have a program with tight timing and/or memory requirements. I see that this is a GC language, so am I right in assuming that it's not suitable for soft or hard realtime systems?
- agl 17y agoGC pauses are current unbounded, so I wouldn't use it for that sort of thing, no.
- tumult 17y agoRight on, good to know, thanks :)
- kaib 17y agoMost of Google infrastructure is soft realtime so GC delays have definitely been a concern. The memory footprint for a simple hello.go on arm using 5g is currently ~70k with the optimizer not yet enabled. I'm planning to do some work on a AT91SAM7 with 256kb of flash and it should fit OK. You might be able to squeeze it into a smaller space if you drop some of the runtime.
- tumult 17y agoAssuming the OS threads/preemptive multitasking are playing nice (i.e. letting me devour timeslices at my leisure), how well do you think the GC would work when I need to land events in a 15 microsecond window at 40hz on a normal desktop PC? I'd be crunching a decent amount of math and discarding/creating objects between events, but total memory utilization would not be going up or down. Sorry if that's kind of specific, it's some of the limitations in one of the current problems I'm working on :)
- kaib 17y agoGiven the realtime GC is not done nobody really knows. However, the design goal is to have the GC interrupt time to be linear to the stack of your go-routine (with small constants). Thus you should have at least some control over event latencies through program structure. Like I said earlier, there is significant interest inside Google to make it possible to write really low latency services in Go. I personally think 15 usec is reasonable to ask for.
- nearestneighbor 17y agoAT FIRST GLANCE: Annoyances: braces; variable declarations more verbose than in C Flaws: no discriminated unions; no generics or parametric polymorphism Doubts: no exceptions; no macros (as far as I can tell) Edit: I take back the verbosity claim. := does inference Edit2: interfaces replace generics, but are type-checked at runtime, apparently: http://golang.org/doc/go_for_cpp_programmers.html#Interfaces
- agl 17y agoNo macros indeed. Unions types will probably happen sooner rather than later.
- jrockway 17y agoYeah. Languages with no control flow other than "call" and "return" were ok for the 80s... but we know better now. Just add continuations and you get functions, coroutines, exceptions, loop exits ("last", "next", etc.), and so on for free. I am not sure why I'd use this language with no libraries when I could use a better-designed language with no libraries instead.
- telemachos 17y agoIt ain't CPAN yet, but I think "no libraries" is an over-statement: http://golang.org/pkg/ http://golang.org/pkg/
- btilly 17y agoThere are other control flow options available. For example they offer the following simple example of what they call goroutines: ch := make(chan int); go sum(hugeArray, ch); // ... do something else for a while result := <-ch; // wait for, and retrieve, result You can actually set up any complex mess you want of functions talking to other functions through channels. This gives you coroutines, threading, etc. Looking through the spec, it looks like they have anonymous functions and closures as well. While I agree that they need to add exceptions, they do have some interesting things in there already.
- gchpaco 17y ago
- mdemare 17y agoGarbage collection, type inference, built-in maps and arrays, immutable strings, concurrency support. Very nice! Best of all, no header files!
- thaumaturgy 17y agoAs a random aside: it's possible to build C++ projects without header files, and get your source files to automatically work out their own dependencies and all that good stuff. I did it with a horrible C++ preprocessor hack. It was fun.
- dchest 17y agoAnd for C, see makeheaders http://www.hwaci.com/sw/mkhdr/ http://www.hwaci.com/sw/mkhdr/
- milkshakes 17y agohttp://golang.org/doc/go_faq.html#Concurrent_programming http://golang.org/doc/go_faq.html#Concurrent_programming "Do not communicate by sharing memory. Instead, share memory by communicating."
- Luyt 17y agoArs Technica on Go http://arstechnica.com/open-source/news/2009/11/go-new-open-source-programming-language-from-google.ars http://arstechnica.com/open-source/news/2009/11/go-new-open-...
- Luyt 17y agoIt seems like Ars Technica also have their own shortened links... http://arst.ch/9uw http://arst.ch/9uw
- mdemare 17y agoNice article, but calling Go not innovative because it has a C-like syntax is a bit naive.
- wendroid 17y agoJournalists journalist, coders code.
- nailer 17y agoThere's a shitload of coders who write well. * Kathy Sierra * JWZ * ESR (okay he's a bad coder, but still) * Zed * _Why * The MIT Introduction to Algorithms instructors who clearly spend time making their lectures entertaining as well as informative. * And yeah, most of the staff at Ars: DRY dictates not having seperate markup for the compiler and your colleagues - so yes, in that respect, the unnecessary braces in Go are not innovative.
- cwp 17y ago"Journalists journal, coders code." FTFY
- dschobel 17y agoDespite the large amount of enthusiasm for language design, modern mainstream programming languages don't fall far from the C tree. The best that Microsoft, Sun, and Apple have to offer are just variations on that theme, with the addition of predictable object models and conveniences like garbage collection. Hey, give MS some credit for F# here! And it's got out of the box support in Visual Studio 2010.
- jhawk28 17y agoDoubt it will be successful, no beards: http://www.youtube.com/watch?v=rKnDgT73v8s http://www.youtube.com/watch?v=rKnDgT73v8s
- agl 17y agoKen, iant and I have beards thank you :) Rob, gri, Russ and Kai are sadly lacking.
- nailer 17y agoAny chance you could please ditch the brace requirement? You're already marking up the code for humans using indentation, don't repeat yourself by having the compiler use a different parsing mechanism (and make developers mark up seperately for their colleagues and the compiler).
- praptak 17y ago> Any chance you could please ditch the brace requirement? Wearing braces is optional. It's only the beards that are mandatory.
- jacquesm 17y agoLet's please not ditch the brace requirement.
- nailer 17y agoCould you provide either some supporting arguments or a response to the parent post?
- jacquesm 17y agoSure. The 'indentation is enough' argument ignores that braces offer redundancy and are unambiguous. They're like guard rails on the highway, they make totally explicit what is going on. The 'but you're writing for other humans to read' argument imho is not 100% the truth, you're writing for both the computer and other humans to read. Humans like the indentation, the braces make it explicit. The computer doesn't care about the indentation, it just looks at the brackets. Drop a bracket and you get an error, drop a couple of spaces and your program will happily continue to work, only not in the way you intended. it's funny how even in languages that don't use 'begin/end' markers (such as python) there are extraneous characters, such as the () pair when calling a function (surely there are ways to do without that ?), or when making a list or a dictionary. Some things come in pairs, and the beginnings and endings of blocks are such things. In Pascal it was BEGIN and END, which seemed overly verbose, in C it was { and }, which seems about as minimal as you can go before you become invisible, and when you get invisible you lose something. Try cutting and pasting some python examples from online fora and see how well it works without. And try figuring out from a python program that has been created on a box with alternate tab settings what it's intended function was (yes, I know there are tools for that situation). Begin and end block have meaning, they are 'there', and even if you don't strictly speaking need them they cost next to nothing and make me feel a lot more like things are spelled out to mean exactly what I'm reading. I should probably start collecting python examples in the wild on the web where the indentation is clearly messed up so the code no longer works the way it is intended, this is a lot more common than you'd want. It is also very frustrating when learning a language. So, please keep those braces.
- blasdel 17y ago"Go has its own model of process/threads/light-weight processes/coroutines, so to avoid notational confusion we call concurrently executing computations in Go goroutines." I like this not just because it's CSP reborn -- new languages should be introduced with their own delightful disambiguating nomenclature.
- nailer 17y agoI like it because it rhymes.
- Freebytes 17y agoI am not interested in really learning another programming language, and from the looks of it, the productivity claim is questionable. Not only can many of the examples they show be done in fewer lines of code in other languages, but you also do not need to re-learn the languages you already know. Many programming languages offer many of the features they are mentioning as useful so why learn yet another programming language unless it truly has something useful to offer that does not already exist. As one person stated, it has braces. I like braces for the purpose of organization, but I dislike variable declarations because it only serves to clutter the code and sometimes decreases productivity. The programming language needs to become more productivity oriented, and I do not think Go accomplishes this goal. Developers want to be creative with their code, but they would probably rather be more creative with their projects instead.
- jacquesm 17y agoThis is hacker news, learning new programming languages and learning about them or thinking about them is part of what hacking is all about (at least for me it is). If you think that programming languages are a 'done deal' then try to ignore the last 15 years or so and see what you're left with. Sure, we're not much closer to the holy grail of programming in absolute terms, but new languages (erlang, clojure, ruby, python to name a few) have definitely incrementally changed the perspective we have of programming, and have opened up more fruitful ways of building certain classes of applications.
- Freebytes 17y agoWhen I stated "I am not interested in really learning another programming language", I should have worded it more clearly. "I am not interested in learning this particular programming language because it does not seem to be a step above existing languages. It seems outdated before it has even been released. Simply because something has big names behind it does not mean the product is automatically superior to others. I intend to learn other languages, of course, but I do not intend to waste my time.
- joeld42 17y agowow... first impression is this is my dream language... Can't wait to start messing with this...goroutines yay...I could be wrong but this looks really nice.
- vaksel 17y agoSo how long before we start seeing craigslist ads that ask for 5 years of Go experience?
- jurjenh 17y agonot before the end of the world (2012)
- stcredzero 17y agoPerhaps time travelers exist, and this is just them accidentally blowing their cover?
- jjs 17y ago2 weeks, tops.
- Krechet 17y agoWhat the hell??? Didn't they come out with programming language last week already or some such? I don't see the point exactly. I mean I can learn it, but then what? It's not going to be installed anywhere where I can do work, it's not going to have any third party libraries, it's not going be be supported by any decent editor for a while (I use vi, throw your rocks). Google: what is the point? First it's browser plugins, then browsers, then two OS's, now programming languages? How about a nice new processor architecture a la PowerPC? It's better and faster you know. Maybe they'll also invent new people to be their user base. I can imagine that intro video: "Welcome to GPeople - the new Google interaction experience. When you interact with a GPerson you don't need to talk. They already know what you are thinking and will insert relevant advertisement into their conversation with you. The advertisement will be unobtrusive and will target your innermost fears..."
- dchest 17y agoThey already support your editor: http://code.google.com/p/go/source/browse/?r=release#hg/misc/vim http://code.google.com/p/go/source/browse/?r=release#hg/misc... :-)
- rikthevik 17y agoGoogle has a ton of really smart people using their 20% time on projects they find interesting. I think they've shown great restraint in what they release publicly. I'm sure there's a ton of very cool new things being worked upon in the company.
- omnigoat 17y agoMy word, a whole bunch of what I'm reading is exactly what I have/had intended to implement in my toy language, prism. Bit-specified integer (and real) types, increment/decrement operators as statements (prefix only!), hell, even using "var <X> ..." for variable declarations. The guiding principles are divergent though. And the bit about deducted type relations (http://golang.org/doc/go_lang_faq.html#inheritance http://golang.org/doc/go_lang_faq.html#inheritance) leaves me with mixed feelings. I'm actually happy! It means my stupid little language has some validity :P For those who wish to deride it: http://code.google.com/p/prism/ http://code.google.com/p/prism/
- omnigoat 17y agoWell, in the interests of actually furthering discussion: I feel as if string and map simply could have been part of the standard library. My solution to the this for prism was to have a section of the standard library (which doesn't exist yet) marked as "integral", to effectively have an implicit "import string, map from std.__integral__" at the top of every translation unit. The absence of overloading operators seems to contradict their claims of improving the visual "flow" and feel of programming. There are cases where savvy operator overloading works wonders: vectors/matrices/quaternions, strings, complex numbers, etc. To be able to write my_string + my_other_string is far more elegant than strcat(my_string, my_otherstring). Consider what happens when you have four of five strings you'd like to concatenate! The choice of CSP reflects Google's mentality: Their problems lend themselves very well to CSP. Other domains (in my opinion) work better with a STM model. But that's clearly a design choice, and I think it's fine!
- wheels 17y agoAfter reading "The Case for D" a little bit back, what these leaves me wondering is not, "Why this over C or C++?" but "How does this compare to D?" After a quick glance, D piqued my interest more. D seems to fall a bit nearer to the C++ side of the fence than Java, but also boasts C++-level performance and relative safety. http://www.ddj.com/hpc-high-performance-computing/217801225 http://www.ddj.com/hpc-high-performance-computing/217801225 Neither of them will replace C or C++ in the near-term simply because those languages are so entrenched, but if I were looking for a language just to play around in for potential future use from these families, at this point it'd be D.
- michaelneale 17y agoLooking good. I always thought something like this would be LLVM based, this is surprising.
- 9oliYQjP 17y agoThey said in the FAQ that they "felt" LLVM was "too large" and "too slow". I would have liked to see this statement backed up with data.
- nikils 17y agolink to Ken Thompson's previous c-compiler paper http://doc.cat-v.org/plan_9/4th_edition/papers/compiler http://doc.cat-v.org/plan_9/4th_edition/papers/compiler search for 'Performance'
- michaelneale 17y agoYes I saw that (and took their word for it). It is interesting that they seem to deeply care about compile time speed (I guess given Go is a fresh start in so many ways, people thought it would be nice to have super fast compiles for quick turn around and testing).
- vicaya 17y agoThe home page touts "safety" as a feature the language but all it takes to crash the program is concurrent access to the builtin map: "uncontrolled map access can crash the program", according the faq. Interesting so far besides some syntax ugliness and lack of macros, but not yet good enough for many system programming projects, especially given the state of the garbage collector. GC is the hardest thing to implement large-scale, concurrent, memory intensive applications (e.g, database servers). Java spent 18 years to perfect its GC to be the current state of the art, which still sucks for these applications. I hope they can come up with a concurrent garbage collector that can work on > 16 GBs of RAM with sub ms max latency :)
- blasdel 17y agoIt is intended to be absolutely safe: dereferencing an invalid pointer doesn't result in "undefined behavior" -- it results in your program halting every time. You can't accidentally succeed or allow for buffer overflows, which is all that's important (especially since Go doesn't have exceptions). Hopefully they can rip off the design of GHC's amazing parallel garbage collector (it runs in its own pthread), and ditch the current mark-and-sweep.
- wmf 17y agoMaybe if we're lucky Azul will go broke and Google will buy up the talent.
- telemachos 17y agoYou have to love a project where the designers are sitting on irc fixing build bugs as they come in. (No, this isn't unique for opensource projects, but it's always great to see.) Thanks for giving me something to do with all my free time for the next couple of weeks.
- johnbender 17y agoThe main selling point is compile time. Sweet...
- srw 17y agoI don't see why it's interesting. Frameworks and APIs are currently more important than languages.
- euroclydon 17y ago"However, in Go, any type which provides the methods named in the interface may be treated as an implementation of the interface" I've been wanting this in C# for a while now. Maybe one day...
- AndrewDucker 17y agoYeah, I'd kill for Duck Typing in C#.
- nailer 17y agoIronPython is duck typed and runs on the DLR. The same should be possible for a future C#...
- euroclydon 17y agoI never knew what duck typing referred to. Thanks.
- mbreese 17y ago(possibly redundant) It's based upon the phrase: if it looks like a duck and quacks like a duck, it's a duck. In this case, if the object has the methods of the duck interface, treat it like a duck object.
- nikils 17y agomight be influenced from this http://www.vitanuova.com/inferno/papers/limbo.html http://www.vitanuova.com/inferno/papers/limbo.html
- shabda 17y agoimport "fmt" what advantages this have over import fmt that a new language is choosing this sytax?
- mncaudill 17y agoIt keeps the grammar simple, for one.
- shabda 17y agoIMO, Thats no reason to make me type two extra chars each time I import.
- swolchok 17y agoYou're a programmer, right? So you type 70-100 WPM, right? That's 5-8 chars per second, so we're asking you for 0.4 to 0.25 seconds per imported module, or maybe 5-10 seconds per program. I do see the reason to design a language efficiently, but I emphatically disagree with optimizing away small numbers of characters. Typing is a basic skill for the job, and the overhead is dwarfed by the text of the program (not to mention that we're making everyone type braces and semicolons).
- shabda 17y agoIf its a conscious tradeoff decision, doesn't it need to have a positive however small, to counter that negative, however small? now That positive might be "close to c++ syntax", but I am wondering if there is any other.
- demallien 17y agoit allows module names with spaces/other special characters, for two.
- akamaka 17y agoCould it have something to do with allowing unicode in the source?
- swaroop 17y agoI wonder if Go is what will "replace" Python internally at Google? ( w.r.t. http://news.ycombinator.com/item?id=933493 http://news.ycombinator.com/item?id=933493 )
- swolchok 17y agoApparently, Go style is to use tabs (see go-mode.el). This is not Pythonic.
- jeremyw 17y agoYeah, this was most disappointing (I'm otherwise giddy). I hoped source tabs were dead and buried.
- blasdel 17y agoThere's also gofmt, which automatically applies the full house style using tabs. If anyone can bring about a tab reniassance, it's bwk, ken, rob, rsc, and gri. These titans wrote your operating systems and your programming languages. They all wrote their own editors (not sure about gri) -- hell, the Go tests use ed! Tabs have been lost in the wilderness for too long, it is about time they are reborn!
- johnmw 17y agoI am curious if someone could explain how a project in Go would compare to a project in Python or Ruby + a fancy array of custom C modules? This implies that it is possible to implement the nicer features of Go (for example concurrency support) in the modules supporting these languages. Or instead making kickarse fast compilers for higher level languages? Is it too simplistic to say that at one end you have expressive languages designed for humans and at the other you have low level languages designed for speed? edit: not meaning to insult humans who like fast languages.
- makecheck 17y agoIt's a very promising language, and the tutorial's not bad. The main quirk I see right now is that the syntax feels more like a shuffling of characters, rather than actually simplifying anything. For instance, they save parentheses in for loops (great idea!), yet suddenly I need a useless "func" before every function. It also seems like there needs to be a default type for arguments, either "int" or "string", for it to feel truly simplified. A feature I would really, really like to see in a language is the notion of automatically printing lone strings, or automatically printf()-ing lone string format lists. It's a little irritating after all this time that one must "echo" or "print" or System.out.println() or fmf.Printf() everything (much less import standard libraries to do it), when it is such a common task.
- dfarm 17y agoIt does certainly smack of "Not-Invented-Here Syndrome," but compared to the Dilbert like project management culture of my job I rather admire it. I've just been getting in to generic programming with C++ (Stepanov's new book, awesome). So the fact that they don't have templates or operator overloading (the two critical pieces to STL style) was a bit of a downer. That being said the interfaces concept reminded me of generic functions (in CLOS). Sounds pathetic but I probably will give it a try just because it's from Google -- but I'm quite skeptical. With the really interesting work going on with Haskell, Clojure, Fortress, etc. it seems a shame to stay so close to C.
- jacquesm 17y agoHave a look at some of the names behind it and see if you stick to your 'Not Invented Here'.
- ionfish 17y ago"Reinventing the wheel we invented earlier"? (That's not a criticism—language design shouldn't always be in the revolutionary mode.)
- dfarm 17y agoI don't think you understand what "Not invented here syndrome" means. See: http://en.wikipedia.org/wiki/Not_Invented_Here http://en.wikipedia.org/wiki/Not_Invented_Here What I mean is that Google always has to do things the Google way whether that's an improvement or not. Whether this turns out to be a valuable contribution to the field will play out over the next few years. We'll see. But a company that makes their own DB, their own phone, their own programming languages, etc. is pretty much a prototypical "not invented here" company.
- jacquesm 17y agoI was familiar with the term, but thank you for your attempt at educating me. Google has some unique problems, they also have a unique position in that they probably have pooled the largest number of IT talent world wide. That gives them clout enough to do these things, just like Erlang came out of a phone company (why, couldn't they have used some existing language ?) and Apple made their own phone (I'm sure they could have afforded a Nokia or two) google can and does have the budget to branch out in other fields. That's not 'NIH', NIH is doing something even though better alternatives exist, for instance, writing your own bookkeeping software when you're a mid-sized company and you should be spending your time on serving your customers instead of writing bookkeeping software. Google even makes their own servers, at their levels of scale a lot of things that do not make sense for smaller companies actually improve the bottom line. Google suffers from many defects, bad customer support would be the top of my list, but NIH isn't one of them, at least not in this case. That's almost like accusing Xerox in their heyday of having NIH, and I'd hate to think what the world of software would look like today if it hadn't been for that.
- Slashed 17y agoThis new programming language from Google is quite a buzz on the web now. To be honest, I always got excited about tools that promised to speed-up and simplify development. But most of the time, those trendy tools are just even more time wasters. One language I find to be [almost] ideal is Scala. I believe that Scala will replace Java. Also, writing code for JVM gives you a huge advantage - you can create OSGi bundles. IMO, OSGi framework is the most mature module system. So I think that there's nothing good about this language except that it's created by Google.
- swolchok 17y agoI had a friend who was worried about the overhead of interfaces (are methods called by hash lookup on name or by something like a vtbl?), so I compiled a simple example program to test how dynamic dispatch works: http://scott.wolchok.org/vtbl.go http://scott.wolchok.org/vtbl.go The binary is at http://scott.wolchok.org/6.out http://scott.wolchok.org/6.out . If you search for deadbeef, you'll find a sequence of instructions ending in an indirect jump, so it is decidedly not some kind of string comparison. The function in the compiler that generates calls through interfaces seems to be cgen_callinter in go/src/{6,8}g/ggen.c, but I can't decipher the terse code therein. Would be interested to learn more about Go method dispatch, especially as regards to dynamic linking -- does Go have it? What if I create a new interface that encompasses objects in a library built before I created that interface? Do I have to rebuild the library?
- gchpaco 17y agoSome of the style reminds me of Alef from Plan 9; in particular the communication channels, but also a fair chunk of the syntax.
- wendroid 17y agoThat will be because that's what it's based on.
- FreeRadical 17y agoCan someone give me some examples of where this might be used (and to do what)?
- deleted 17y ago[deleted]
- blasdel 17y agohg log --rev 0:4 --template '{date|isodate}\t{author}\n\t\t\t\t{desc|firstline}\n\n' 1972-07-18 19:05 -0500 Brian Kernighan <bwk> hello, world 1974-01-20 01:02 -0400 Brian Kernighan <bwk> convert to C 1988-04-01 02:02 -0500 Brian Kernighan <research!bwk> convert to Draft-Proposed ANSI C 1988-04-01 02:03 -0500 Brian Kernighan <bwk@research.att.com> last-minute fix: convert to ANSI C 2008-03-02 20:47 -0800 Robert Griesemer <gri@golang.org> Go spec starting point.
- antirez 17y agoOk, a language for engineers not for people that want to be truly expressive with the code they write. This is my impression when looking at the examples, they have something odd in the way the code looks like. Now from the technical point of view, there are a few interesting points like the threading approach, but in general the language does not appear to provide great new ideas, nor to be a language where consolidated ideas are put together very elegantly. It seems like that for system programming the "better C" that one could need is different than this, while for general programming what is really missing is something like Ruby and Python but made as fast as C and with low memory usage by mean of doing the right sacrifices to the language, but still retain most of the abstraction level. Go is not as powerful as C++, not as high level as Java, not as raw as C for low level stuff. I don't like it.
- blasdel 17y agoNeither C++ nor Java implement Hoare's CSP, or have any primitives fundamental enough to implement them in terms of. Go is exactly what you're asking for in your third paragraph -- it seems you were blinded by the curly braces...
- antirez 17y agoYes CSP is a good abstraction that Go implements, but programming languages are not just a matter of features like call-cc, tail-calls, closures and so on. This are very important things, but it's not enough.
- fauigerzigerk 17y agoThe language breaks with a tradition established in the past 15 years, which says that every new language must be at least a few hundered times slower and less memory efficient than everything that came before it (I know there are exceptions) Go is simple and fast. It has garbage collection, it facilitates parallel programming and it does away with lots of useless OO cruft. At first sight I like it.
- jgrahamc 17y agoFor my doctorate I did everything in CSP and Occam, so it's wonderful to see the channel communication methods defined for this language. http://golang.org/doc/go_mem.html http://golang.org/doc/go_mem.html If you do things via synchronized channel communication then it eliminates (mostly) the need to spend all your time with mutexes and the like because the channel sync does that work for you. At the beginning it'll probably take people time to get there heads around it, but my recollection was that it was a game changer once you understood how the synchronization worked.
- olaf 17y agoI would like to see Google "eat their own dogfood" before I invest in Go. Or do they already use Go in production?
- uriel 17y agogoglang.org runs Go.
- olaf 17y agoI meant real business like GMail or similar.
- ekiru 17y agoDo you want your email server to use a language that even the developers admit isn't yet ready for production?
- tedunangst 17y agoYou have reversed the sense of olaf's point.
- olaf 17y agoNo, I did not write that, but since there is no serious Go-application inside Google, their management could very easily "pull the plug" and no longer support this experiment. I would probably fear that, if I would invest time in learning Go. I don't understand why the team did release Go to the public at this early stage of development, what they expect from the developer community.
- Semiapies 17y agoI agree as to "investing", but as to experimenting with and trying out, I don't see why not. And the site running on Go seems to be puttering along nicely...
- c00p3r 17y agoAnd finally C 2.0 sponsored by Google. Good move against Apple. It (go + native client) might become a next major platform. Just think about low-level (and easier to code than C[++]) Javascript alternative.
- rsaarelm 17y agoA lot of this looks very nice. One very simple thing I noticed was missing was a binary integer literal syntax. With a systems programming language, it would be nice to be able to write bit sets without shifts sometimes. Just use the obvious '0b10100101' syntax. Also, I think the zero-prefix convention for octal literals is very confusing and possibly error-prone, but it seems to be used even in modern programming languages. Is there a good reason to keep using '0765' instead of something '0o765'?
- pageman 17y agowhere's the hidden features? http://stackoverflow.com/questions/1716813/hidden-features-of-go http://stackoverflow.com/questions/1716813/hidden-features-o...