17 ms·
Google App Engine for Go
- deleted 15y ago[deleted]
- Kilimanjaro 15y agoGreat news! I'll start playing with it right away. I won't drop Python for my day to day coding, but having Go as an option is good to see what cool toys we can build.
- fortes 15y agoAny advantage (performance? memory use?) for using Go vs. Python? Or is just programming language preference?
- gecko 15y agoI've been enjoying using Go as a C replacement when I need more performance than Python, but don't actually need to use C. It's been fine for that purpose. I would note that they do keep changing the syntax on a fairly regular basis, the libraries are still young, and I do find the language oddly unexpressive in places compared to even C++ with boost. (E.g., no ternary operator, no list comprehensions, using the same word for all loop variants, and so on.) That said, if you're using it as a C replacement, rather than a Python replacement, I think those are fine trade-offs.
- Detrus 15y agoPretty interesting. What do you think of the quote from this article http://news.ycombinator.com/item?id=2518609 http://news.ycombinator.com/item?id=2518609 http://www.theregister.co.uk/2011/05/05/google_go/print.html http://www.theregister.co.uk/2011/05/05/google_go/print.html "Google has people who administer apps and services, and they need to, say, write tools that say scrape a few thousand machines statuses and aggregate the data," he says. "Previously, these operations people would write these in Python, but they're finding that Go is much faster in terms of performance and time to actually write the code." Clever marketing or could Google's problems actually be handled better by Go than Python, in time to code?
- gecko 15y agoI think this may be specific to Google's situation--at least for now. PyPI may not be as comprehensive as CPAN, but it's rare these days that I can't "pip install" my way into having half the solution done before I start writing code. The same simply isn't (yet) true for Go. Google has many custom components, though. I personally don't write Go nearly as quickly as I write Python, but I have 4+ years of writing Python in everything from tiny scripts up to large applications, both for the desktop and for the web. I have maybe twenty to forty hours of experience writing Go code, absolute tops. It's not a fair comparison. If we assume that the Googlers who are claiming to be more productive in Go than Python have a couple orders of magnitude on me, and that they don't need many prefabricated libraries, and I find the claim plausible. I don't believe it'd currently be true in the general case, though.
- stock_toaster 15y agoIn addition to your custom components point, I wonder if licensing restrictions come into play at all. I am not familiar with Google's policy on use of external code based on license of said code. If there is, hypothetically, a policy to use code for internal projects of only certain licenses, then pypi (generally) may be slightly less useful to them. If they were re-implementing a significant amount of code then go may indeed be more productive.
- heyrhett 15y agoMy general feeling is that Go is kind of like a lighter Java. Go is compiled, but also optimized for fast compile times, and it should be faster than python. However, from wikipedia: "Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic." Ken Thompson is a co-creator, and the language came from Google. I think Google is just showing that they stand behind their language, and it does seem to hit a sweet spot for a lot of web apps. Although, I don't know too many web apps that need better performance than python.
- uriel 15y ago> However, from wikipedia: "Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic." For many people (including me) the lack of all this "features" is a feature in itself. I certainly have not missed any of them.
- leon_ 15y agoI miss the occasional pointer arithmetic in string manipulations. But that's all I miss of the mentioned features.
- lars512 15y agoYou don't miss generics? In my limited time working with Go, the lack of generics felt like a glaring hole in the language. That said, maybe that feeling goes away as you spend more time with Go, and perhaps learn to program it more idiomatically.
- supersillyus 15y agoGo has generics, but only for the built-in chan, map, and slice types (and the associated operators). Since the majority of uses of generics (at least in my code) are from containers, this results in me not really feeling the lack too much. Interfaces and reflection cover most of the rest, though not ideally. After using Go for a while, I'm not yet sure if the lack of user-defined generics are a bug or a feature. It limits your expressive power a bit, yes, but it also makes the world so much simpler.
- supersillyus 15y agoFaster than Python, better memory use for many types of programs. Compared to Java, less memory use and (I assume) much less start-up time, since no VM is needed. Also, since you can use goroutines, it would seem like you'd be able to do concurrent requests without having to have a special async API like Java/Python have. Go seems like it'll be a pretty great fit for App Engine.
- MatthewPhillips 15y agogoroutines run in a single OS thread. Same reason for blocking threading on Java. Said this restriction maybe lifted in the future but I wouldn't hold my breath on that. EDIT: Clarification, on goroutines run in a single OS thread on AppEngine.
- supersillyus 15y agoGoroutines still provide concurrency with a single thread. It's not that useful for CPU-bound stuff, but I'd imagine it should allow multiple concurrent GAE API calls (as they are just IO, and certainly async under the hood), or you could do CPU-bound stuff while waiting for IO.
- DennisP 15y agoFrom a google developer, responding to complaints about the new per-instance pricing: "If you are using Java, we just launched the ability to make your instances multi-threaded allowing you to use fewer instances to handle the same traffic" https://groups.google.com/group/google-appengine/browse_thread/thread/54261b447e165812?pli=1 https://groups.google.com/group/google-appengine/browse_thre... I'd be surprised if they didn't do the same with Go, by the time it reaches production status.
- kingkilr 15y agoFaster than CPython maybe, last time someone did a benchmark of Go vs. Python webservers PyPy came out on top.
- supersillyus 15y ago
- leon_ 15y agoFor me it's only preference at the moment. My Go code isn't that performance critical that I couldn't implement it with Python. But having not to put up with the whitespace/indentation hell of python is a great relief. Though the Go ecosystem is nowhere near Python's.
- enneff 15y agoThe official blog post: http://blog.golang.org/2011/05/go-and-google-app-engine.html http://blog.golang.org/2011/05/go-and-google-app-engine.html And Hacker News thread: http://news.ycombinator.com/item?id=2533000 http://news.ycombinator.com/item?id=2533000
- kristianp 15y agoAccording to the blog post, deployment to app engine will only be available initially to those who sign up as a trusted tester via this form: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dGJ6LXlIYWk4MjhnM0dubUstUHFKVXc6MQ&ndplr=1 https://spreadsheets.google.com/spreadsheet/viewform?formkey...
- mhansen 15y agoWhy is the thread [dead]?
- MatthewPhillips 15y agoCan't wait to toss Eclipse into the trash!
- forgotusername 15y agoCan anyone confirm if this allows linking native libraries? From the looks of the "compiler", it seems it might be hacked to produce a binary statically linked against, say, SpiderMonkey. Beyond coolness, it seems a waste of effort to tailor this release to Go, when similar effort might have been expended, e.g. to define a simple protocol talked over a UNIX fd that any static x86 binary could implement to integrate with App Engine.
- enneff 15y agoThere's a lot more than sandboxing to rolling a good App Engine SDK. A large amount of effort went into designing nice, idiomatic Go APIs for accessing the App Engine services.
- wmf 15y agoIt looks like the answer is no. You upload your Go source code and App Engine compiles and runs it; you don't upload binaries.
- jordinl 15y agoWhat's the best way to get started with Google Go?
- dchest 15y agoStart from the left column (Learning Go): http://golang.org/doc/docs.html http://golang.org/doc/docs.html and continue to the bottom. Watch "Practical Go Programming": http://osdc.blip.tv/file/4432146/ http://osdc.blip.tv/file/4432146/ Watch "Writing Go Packages": http://www.youtube.com/gocoding#p/u/0/jDWBJOXs_iI http://www.youtube.com/gocoding#p/u/0/jDWBJOXs_iI Read language specification. Edit: If you prefer books, here's a CC-licensed, still in development, book by Miek Gieben "Learning Go": http://www.miek.nl/files/go/ http://www.miek.nl/files/go/ (grab the latest PDF; alternatively, here's Git repo: http://miek.nl/cgi-bin/gitweb.cgi?p=gobook.git;a=summary http://miek.nl/cgi-bin/gitweb.cgi?p=gobook.git;a=summary)
- bgentry 15y agoIt looks like this is still going to be limited to HTTP (port 80) web applications. So you won't be able to run a process like Doozer that communicates with other ports/protocols. EDIT: More details from the docs at http://code.google.com/appengine/docs/go/runtime.html http://code.google.com/appengine/docs/go/runtime.html An App Engine application cannot: -write to the filesystem. Applications must use the App Engine datastore for storing persistent data. Reading from the filesystem is allowed, and all application files uploaded with the application are available. -open a socket or access another host directly. An application can use the App Engine URL fetch service to make HTTP and HTTPS requests to other hosts on ports 80 and 443, respectively.
- bgentry 15y agoWhy the downvote? This is a legitimate limitation of the App Engine platform, and for Go specifically it eliminates many of the common usecases.
- dchest 15y agoWith the announcement of backends (http://googleappengine.blogspot.com/2011/05/app-engine-150-release.html http://googleappengine.blogspot.com/2011/05/app-engine-150-r...), I suspect long-running processes will be available in Go in the future as well.
- bgentry 15y agoThanks for the info, didn't realize they launched this feature as well. I doubt it will take them long to bring it to Go.
- streeter 15y agoGvR mentioned today at Google I/O that the Go runtime was championed by another group within Google. Apparently, the same thing happened with the Java runtime before it was brought into the App Engine team. He expected the same thing to happen with the Go runtime. So one would expect new features to come to the Go runtime slightly after the other "first class" runtimes (Python and Java).
- 15y ago
- wwkeyboard 15y agoNice of them to even mark the issue fixed! http://code.google.com/p/googleappengine/issues/detail?id=2382 http://code.google.com/p/googleappengine/issues/detail?id=23...
- chuhnk 15y agoGo appears to be gain more and more traction. I wonder how long before someone else supports it on their platform.
- arturadib 15y agoIt's going to be a tough sale for Google to convince people to adopt Go for their web apps when Node.js is taking over that scene. With Node I get the best of two worlds: high concurrency and speed -- presumably the top two selling points for using Go with web apps -- without having to teach myself yet another programming paradigm. Everyone and their mother knows some Javascript; good luck hiring help for your Go-based startup. IMHO, Google could be riding a much bigger wave right now...
- bjg 15y agoWhile I agree that go on appengine might not take off, in no way is node.js "taking over that scene". If by scene you mean the "web app" scene. Just because node.js articles are constantly blowing up hn, reddit does not necessarily correspond to real world deployments of node.js apps. An admittedly hastily prepared google trends graph: http://www.google.com/trends?q=node.js%2C+python+django%2C+ruby+on+rails%2C+gwt%2C+appengine&ctab=0&geo=all&date=all&sort=1 http://www.google.com/trends?q=node.js%2C+python+django%2C+r... I am a node fan, I subscribe to the node-dev list and have worked on a few applications my self. However I am in no way delusional about the current blog popularity vs actual projects deploying with it. Also you state that you are able to gain the same concurrency and speed with node that you are with Go. May I ask how you achieve this? Go usually comparable to C code in terms of performance [1]. Go also has amazing concurrency tools for efficient communication between two concurrent goroutines, for example the channel interface[2]. To my knowledge their is no way to run concurrent node processes. You can launch multiple instances of the same program but their is no way to let them communicate without sending data over a socket. You can of course use a reverse proxy to present a single entry point in which multiple node backends can take requests. However you can not claim this as concurrency in the same sense that is available with go. [1] http://golang.org/doc/go_faq.html#Performance http://golang.org/doc/go_faq.html#Performance [2] http://golang.org/doc/effective_go.html#concurrency http://golang.org/doc/effective_go.html#concurrency
- robfig 15y agoBut with Go can you write your client code and your server code in the same language?
- euroclydon 15y agoGo's a System language. Doesn't that mean it's more suitable for writing a web server, database, driver or OS than as a web site scripting language? I mean, no one would write System code in PHP, and it's rare to see web sites written in C, so why write a website in Go?
- leon_ 15y agoGo turned out to be a pretty nice general purpose language. You got garbage collection, sane native string handling, native maps and lists. Mix that with static typing and you got a pretty nice language that enables fast and sane web development.
- lars512 15y agoHaving done a lot of CJK development, I felt that Go's unicode strings were pretty kludgey last time I looked. Go's strings are all utf8, so unless you're working in its ASCII subset alone, you have to manually iterate over multi-byte runes to get the unicode codepoints out. That's really not what I'd call a friendly unicode handling comparable to scripting languages, or even Java. Please correct if things have changed. I haven't revisited Go for a little while now, and would be very interested as to any updates to its unicode handling.
- supersillyus 15y agoIteration over strings is rune-by-rune in Go. However, (somewhat counter-intuitively) string indexing/slicing is byte-by-byte, so you can't just go "str[0:10]" and get the first 10 code points. Then again, that's true in utf16 also, if I'm not mistaken. But if you want an array of runes instead of a utf8 encoded string, you can just do "[]int(mystring)" and it'll do the conversion for you.
- dchest 15y ago1. Range on a string iterates over Unicode code points (runes): s := "Какая-то строка" for _, rune := range s { // do something with rune 'К', 'a', ... } 2. Converting to []int gives you a slice of runes: s := "Какая-то строка" runes := []int(s) sub := string(runes[:8]) // "Какая-то" however, slicing a string directly will slice it by byte: s[:8] // "Кака" 3. With package utf8 (http://golang.org/pkg/utf8/ http://golang.org/pkg/utf8/) you can manipulate runes manually. While this is all not intuitive (you have to know what does what), I find it rather easy.
- chrisfarms 15y agoState my assumptions: GAE allows you to deploy multiple versions of your app and access the same datastore. Go should significantly out perform Python for certain CPU intensive tasks. ... If Backends are available at versioned URLs too (and I suspect they do/willdo) then there might be nice opportunities to build little Go Backends to do heavy lifting within your main Python applications. Sounds cool.
- xtfunlp 15y agoIt's about time! i always wondered why google left out Go! for the app engine last time i was there, since it's their language and stuff. Tough i guess it's ruby next? yeah probably not...
- zmmmmm 15y agoThis seems like a pretty big step to me: so far Go has seemed like a kind of geeky side project of Google's. But here they are promoting it into one of their production services. Makes me wonder if they are preparing to slowly edge Java out the door and replace it with something equally performant but not burdened by a hostile owner.
- rkalla 15y agoI think you nailed it. Consider they picked up Gosling for r&d I don't put championing their own future platform for all devices (you know Go is going to Android as part of the NDK or something by Android 4). Isn't this what Sun basically did with Java? I don't know the incumbent they were trying to edge out or if it was just a "look at our cool tech" play. Go seems like a C-esque version of python/ruby/java to me. A lot of very slick things in there. Lots of room to grow and a lot of community excitement.