16 ms·
Go 1.4 is released
- krat0sprakhar 12y ago> The most notable new feature in this release is official support for Android. Using the support in the core and the libraries in the golang.org/x/mobile repository, it is now possible to write simple Android apps using only Go code. This is fantastic! Are there any example Android apps released by the Go team to help get started ?
- bradfitz 12y agohttps://github.com/golang/mobile/tree/master/example https://github.com/golang/mobile/tree/master/example
- guelo 12y agoAs far as I can tell these samples are immediately bailing out of the Java framework and calling Go using JNI. Which means you don't get the niceties of the UI Framework. You could make OpenGL calls from the Go code like for a game or something. Maybe someone will come up with a Go game engine for Android.
- deleted 12y ago[deleted]
- melling 12y agoIs there any way to integrate the Java framework? Even something tedious could be crowdsourced with enough help.
- TillE 12y agoThat would be the JNI. I have a little bit of experience with making a Python interface to the Android API, and tedious is exactly the right word.
- alfiedotwtf 12y agoAnd now things just got interesting. I'll put my money on the availability of Go on Android being the catalyst for its future hockey stick growth.
- pjmlp 12y agoFor that really to happen, the Android team needs to give some love to alternative languages. From their Fireside talk I won't expect any change.
- Kiro 12y ago> From their Fireside talk I won't expect any change. Why?
- pjmlp 12y agoThey stated that Java is the language platform, laught at the idea someone would like to try to use Scala instead and mentioned you are pretty much on your own if you feel like using the NDK. Search for Google IO 2014 Android Fireside, video is available.
- nly 12y agoThey'll change their tune when Android starts losing market share.
- Dewie 12y agoI don't really see it - a language made for systems programming (read: non-application development) being used for developing Android apps? Or is there some other kind of Android development in mind, here?
- laumars 12y agoPretty much any language can be used to program pretty much anything these days. After all, a decade or so ago people would have sniffed at the idea of Javascript running on the server side, Python being used in physics labs and anything other than C++ or Perl for UNIX systems programming (a touch of an exaggeration, but you get my point :)) These days the limitation of a programming language is the programmer him or herself.
- hyp0 12y agoIf go code can now run on android, the go compiler can run on it...? Allowing go coding on-the-unit.
- lrem 12y agoNot necessarily, this could still be cross-compilation. On the other hand, why wouldn't it?
- howeyc 12y agoThere has been some work by the community. A user created an app with a button and a webview using go 1.4beta[0]. I modified it to only be a webview with a Go web server[1]. I also wrote an app for myself in the same manner here[2]. I found the whole android developer ecosystem a bit of a pain to setup, but it works now. The amount of java I have to worry about is quite low, so that's a win for me. --- [0] https://github.com/MarinX/godroid https://github.com/MarinX/godroid [1] https://github.com/howeyc/godroid https://github.com/howeyc/godroid [2] https://github.com/howeyc/spipedmobile https://github.com/howeyc/spipedmobile
- deleted 12y ago[deleted]
- _RPM 12y agoCan someone give me a compelling reason to start programming in Go? My default language at the moment is C, or C++.
- bradfitz 12y agoYou can also add numbers on an abacus. It _works_. Put in a less snarky way, C is often way more low-level and tedious than you need. The great thing about Go is that it lets you blend high-level and low-level programming in the same program, only getting low when you need to. It feels like a great mix of C and Pythonubyerlhphavascript. I've given many talks on this, e.g. http://talks.golang.org/2014/gocon-tokyo.slide#1 http://talks.golang.org/2014/gocon-tokyo.slide#1
- coldtea 12y ago>You can also add numbers on an abacus. It _works_. Well, I wouldn't go there (C is antiquated/under-equiped like an abacus) if I was advocating Go. After all, Go, just like an abacus doesn't have generics, or, besides channels and goroutines, most other facilities modern languages offer for that matter (GC and some basic data structures built-in is so 1980).
- lazyjones 12y ago> Go, just like an abacus doesn't have generics, or, besides channels and goroutines, most other facilities modern languages offer for that matter If you need mainly a large number of features in order to program, Go probably isn't for you. But from the perspective of a C/C++ programmer, this isn't likely to be an important point. Languages with more features than C have been available for 40 years (depends on what you'd count as a feature), so there were plenty of "better" choices in that regard available for said people. For me, the lack of some "features" is a great asset for Go, I probably wouldn't have bothered to learn a new language if it had boasted the complexity of Rust or Haskell.
- jacques_chester 12y ago> The great thing about Go is that it lets you blend high-level and low-level programming in the same program Where are map, reduce, select, filter, fold, zip ...? I don't consider hand-rolling them in for/range as equivalent. Can I wind up with the same result? Yes. But I could do it with gotos too. And I've seen "loops are the same as map/reduce etc" advanced as a serious argument by people who weren't, so far as I could tell, trying to tug on my leg.
- hanief 12y agoCan you build Android UI using Go? I have not found a good UI library in Go.
- kev6168 12y agoAlso can someone please give a brief description of whole process to write a simple Android app in Go? What are the bare bone setup(Go, JDK, Android SDK??, etc.), so I can develop and compile? Is the final result an apk file? Thanks.
- faitswulff 12y agoI'm not an Android developer, but have you seen the examples yet? https://github.com/golang/mobile/tree/master/example https://github.com/golang/mobile/tree/master/example
- kev6168 12y agoI am also not an Android developer, so don't know how to get started using Go for Android. Do I need to set up a Java skeleton first so it can call my Go code? Use Android Studio or other IDE? libraries needed? You know the basic set up and steps for producing a 'Hello World' app. If the instruction is already out there somewhere, I will be very glad to check it out. Golang for Android app, this is exciting.
- tjohns 12y agoYou can access OpenGL, but the full Android framework isn't directly exposed. It's similar to developing in C++ using the Android NDK. From the documentation (https://godoc.org/golang.org/x/mobile/app https://godoc.org/golang.org/x/mobile/app): An app can be written entirely in Go. This results in a significantly simpler programming environment (and eventually, portability to iOS), however only a very restricted set of Android APIs are available. The provided interfaces are focused on games. It is expected that the app will draw to the entire screen (via OpenGL, see the go.mobile/gl package), and that none of the platform's screen management infrastructure is exposed. On Android, this means a native app is equivalent to a single Activity (in particular a NativeActivity) and on iOS, a single UIWindow. Touch events will be accessible via this package. When Android support is out of preview, all APIs supported by the Android NDK will be exposed via a Go package. Alternatively, you could write your UI code in Java and call into a Go shared library via JNI methods, if you aren't worried about graphics and just need code portability. Again, this is similar to working in the NDK.
- Kabukks 12y agoJust to make sure I'm not missing it: fsnotify didn't make it into Go 1.4, right? 1.5 maybe? :)
- dsymonds 12y agoIt didn't make it in, but there's no real strong moves for it to be in the standard library anyway. It works well enough in a go-gettable package.
- bradfitz 12y agoThe original motivation for putting it into the standard library is so the 'go' command can use it, to watch the filesystem and know what needs to be rebuilt before you even run "go install" or "go build".
- krat0sprakhar 12y agoPardon my ignorance but if fsnotify is not available how is Hugo (static site generator) listening for events in the filesystem (to reload the server)
- deleted 12y ago[deleted]
- mischanix 12y agoBy using platform-specific cgo calls.
- regecks 12y agoProbably unimportant for the asker, but go-fsnotify uses syscalls, not cgo.
- Laremere 12y agoLooking at Hugo's dependencies, the copy on my machine (possibly outdated) uses this library: https://github.com/howeyc/fsnotify https://github.com/howeyc/fsnotify However, there's a moving notice on that page for this repo: https://github.com/go-fsnotify/fsnotify https://github.com/go-fsnotify/fsnotify Fsnotify will probably make it into the standard library or other core golang repository at some point, given that it could help speed up the compiler. However there's nothing particularly mystical about it that prevents a 3rd party library from being just as good.
- bgentry 12y agoDoesn't look like it's been pushed to the canonical git repo or Github just yet: https://go.googlesource.com/go https://go.googlesource.com/go https://github.com/golang/go/releases https://github.com/golang/go/releases Aside from that, this is yet another great release! :)
- codemac 12y agoAnd they actually stuck with their go generate design? What an unfortunate mis-step. Let the makefile's continue. I've seriously thought about moving to gccgo just to try and get a build system where I can actually inject dependencies on .go files builds again.
- bradfitz 12y agoYou seem to be confusing compilers and build systems. You can use whatever build system you'd like and with whichever compiler.
- Gracana 12y agoIs it possible to do away with the typical Go project directory structure? I thought all that was enforced by the tools, but it's possible that I didn't dig deep enough to uncover greater flexibility.
- codemac 12y agoNo it's not if you ever intend to type `go`. The go team has decided that the go language doesn't depend on any build system, but pushes a single build system one that requires source code compatibility and provides no benefit over many existing and easy to use build systems (makefiles, tup, etc).
- codemac 12y agoI'm not sure what you define as a build system, but it's even in the description of the go build tool (https://golang.org/doc/articles/go_command.html https://golang.org/doc/articles/go_command.html): > An explicit goal for Go from the beginning was to be able to build Go code using only the information found in the source itself, not needing to write a makefile or one of the many modern replacements for makefiles. If Go needed a configuration file to explain how to build your program, then Go would have failed. And the hope is that go generate would be a hook into the dependency graph of go build. Much like the architecture switches, the naming conventions, etc, it seemed like it really could have solved my project's protobuf problem. But it's not, and for reasons that rob pike's doc and the mailing list did not make clear. It looks like a mis-step to me, and I don't think it's due to my misunderstanding of what `go build` and 6g/gccgo are
- nXqd 12y agoNow you can write Android application and eventually iOS ( I don't know if I need that ), this is quite interesting. Congrats go team !
- saosebastiao 12y agoDid I miss something? I didn't see anything about iOS.
- bradfitz 12y agohttps://groups.google.com/forum/#!searchin/golang-nuts/ios/golang-nuts/mmB2q8RqB-Y/LDog1d7ZM5kJ https://groups.google.com/forum/#!searchin/golang-nuts/ios/g... Quote: gophers, I'm happy to announce that the iOS port of Go recently gained full cgo and external linking support. I've also got a simple C based application working on a real iPad. The port lives in ios3 branch of https://bitbucket.org/minux/goios https://bitbucket.org/minux/goios. Read misc/ios/README for some rudimentary documentation. The port is Go 1.4+, and it's based on upstream dev.cc branch. I intend to propose for inclusion into Go 1.5 after finding a way to test it (either build each test as an App, or use the open source xnu/arm port). Brad mentioned that inclusion of iOS support might happen in Go 1.5 in his talk the state of the gopher (http://talks.golang.org/2014/state-of-the-gopher.slide#40 http://talks.golang.org/2014/state-of-the-gopher.slide#40), now I believe it really will happen. The iOS port is my first Go OS port, but it's the only one that takes almost 3 years to complete. :) Go build iOS Apps. Let's see when can we see a Go based App in the store. Minux
- tptacek 12y agoI love Rob Pike's contribution to the thread: Ken and I ported Plan 9 to the SPARC in 6 days over one fun Christmas break. I wrote the disassembler (for the debugger) and Ken wrote the assembler, so we could cross-check each other's work. The hardest problem other than fighting register windows occurred when we both misread the definition of an instruction the same incorrect way.
- cryptos 12y agoI wonder why they didn't move the main code repo to GitHub as well. https://go.googlesource.com/ https://go.googlesource.com/ is somewhat poor compared to GitHub.
- dsymonds 12y agoBecause we want a good code review system, and GitHub doesn't have that. More discussion: https://news.ycombinator.com/item?id=8715529 https://news.ycombinator.com/item?id=8715529 https://news.ycombinator.com/item?id=8605204 https://news.ycombinator.com/item?id=8605204
- touristtam 12y agoGerrit looks pretty horrid to use to be honest.
- smegel 12y agoWhat is google source? Is it a successor/alternative to google code?
- frik 12y agoPowered by Gitiles (footer on https://go.googlesource.com https://go.googlesource.com ) and links to: https://code.google.com/p/gitiles/ https://code.google.com/p/gitiles/ Gitiles is a simple git repository browser built on JGit. Emphasis on simple: the goal is to make it easy to see your files and changes, leaving complex tasks to other tools. Gitiles is the source browser used by the Android Open Source Project. To see it in action: https://android.googlesource.com/ https://android.googlesource.com/
- makeramen 12y agoAt first glance it seems like you will be able to use go on Android the same way you can use C and C++ through a jni bridge between the java and go code: https://github.com/golang/mobile/blob/master/example/libhello/README https://github.com/golang/mobile/blob/master/example/libhell... I'm very curious to how the go runtime and GC will work.
- pjmlp 12y agoEven if I don't agree with all design decisions, Go is certainly coming forward. Congratulations to everyone involved.
- teddyh 12y agoThis relatively recent trend of company-specific languages annoys and disturbs me. I don’t ever want to be tied to a language and library ecosystem under the thumb of a single (large) corporation. Not Visual Basic, not .NET, not C#, not Objective C, not Go (It’s even named after the company, for crying out loud! Yes it is. Don’t try to claim otherwise). I’ve used Basic, I’ve used Pascal, I’ve used C, I’ve used Python, I’ve used Lisp, and so on and so on. Those were open platforms, with different companies in the “lead” position in any one time (Microsoft Basic, Turbo Pascal, Borland C, GNU C Compiler, CPython, PyPy, etc.), but the language was not “owned” by a single company which would loom in everyone’s mind, always the unspoken fear being “what if <company> doesn’t like it?”. I will not use tools which make me afraid. I will not live a life in fear.
- nodata 12y agoIt's open source.
- teddyh 12y agoWhile technically true, this has almost nothing to do with what I wrote. Huge code bases thrown over the wall, while technically “open source” does not a community make. A language named after a company with the overwhelming majority of development sponsored by that same company is not something you realistically envision someone forking, so the fear I spoke of is still there. Now, if the language was, say, maintained by 80% or more by submissions and monetary contributions from outside the company (and if the name was changed), then it would approach being a neutral platform to the benefit of all. As it is, we’re all being invited into Google’s yard to play, but we don’t own the house.
- paddyoloughlin 12y agoHow would communities around anything come to exist if everyone had the same attitude?
- teddyh 12y ago
- rcarmo 12y agoNice. Now all I need is for someone to turn https://github.com/jcla1/gisp https://github.com/jcla1/gisp into a slightly more complete LISP and I'll have a nice environment for all kinds of ARM systems. Edit: typo/autocorrect
- frik 12y agoWhat's the current roadmap for dynamic linking / shared library support? Is this the current one? https://docs.google.com/document/d/16Y4IsnNRCN43Mx0NZc5YXZLovrHvvLhK_h0KN8woTO4/preview?sle=true&pli=1 https://docs.google.com/document/d/16Y4IsnNRCN43Mx0NZc5YXZLo...
- valevk 12y agoThere is a new range syntax[1]. The release notes say it's rarely used, but makes code cleaner. In which cases would the syntax be useful? [1] https://golang.org/doc/go1.4#forrange https://golang.org/doc/go1.4#forrange
- thomasahle 12y agoIf they added support for `range 10` to iterate 0-9 this would be useful for doing things a certain number of times. Now it's probably mostly useful for emptying iterators.
- andrewchambers 12y agoWhy do they need to add support for this? it already exists... https://github.com/bradfitz/iter/blob/master/iter.go https://github.com/bradfitz/iter/blob/master/iter.go
- thomasahle 12y agoI don't think that would be considered good Go code. It's no shorter than writing out the 3-part for loop, and it is probably slower.
- andrewchambers 12y agowhat extra operations do you think range on a slice would do? The generated assembly is probably the same. Stylistically it is odd however.
- deleted 12y ago[deleted]
- dsymonds 12y agoOne use case would be to exhaust a channel (that is, read everything off it until it is closed). Another might be to loop over something of a fixed size to correlate with a corresponding number of other things.
- fxbois 12y agoMobile development will soon be exciting with the fight Go vs Swift
- cyber1 12y agoSuper!
- xrstf 12y agoDamn, another project giving up on Mercurial and switching to Git. :-/ A few more major ones and basically nobody is using Mercurial anymore. How sad.
- pjmlp 12y agoI am you there. Mercurial was more friendly to us Windows developers. But with Microsoft embracing Git this isn't any longer the case.
- swah 12y agoGit is equally hostile to everyone! Long live Git. (Maybe the way to advance the poor Gui user interaction experience is to write frontends for it?)
- radicalbyte 12y agoIf they're smart, Perforce will integrate their UI tools with Git. They have by far the best UI for a Git-style SCM.
- omellet 12y agoPerforce is not Git-style, it's got a single central repository.
- jksmith 12y agoSpeaking of which, of all the shops moving to Git, prolly only a handful exercise the full value of dvcs.
- curun1r 12y agoThe one feature I miss from Mercurial is the "hg serve" ability. When combined with the zeroconf extension, it made it really easy to push/pull changes to/from other developers. Since switching to git, I don't think we've had one (vcs) push that included commits from multiple developers, but we used to do that all the time. I know git can coerced into doing something similar, but hg made it so damn easy that developers actually used it. Addressing your actual point, most shops won't use the full value of a dvcs, but they'll all get some benefit of it being a dvcs because each and every developer's machine has a backup of the central repo which, in the event the main git server dies, can be used to restore everything to it's previously happy state. When you use a vcs like svn, you need to be a lot more paranoid about backing up the central server or you risk losing revision history.
- JulianMorrison 12y ago"Package glsprite blah blah blah TODO". Okay then :-D
- BarkMore 12y agoI was going to suggest that you report this as an issue at https://github.com/golang/mobile https://github.com/golang/mobile, but issues are disabled on that repo.
- fhs 12y agoThey're using one issue tracker for everything: https://github.com/golang/go/issues https://github.com/golang/go/issues Issues for sub-repositories like this go there also.
- bpatel576 12y agoGood god. Seriously, another language. I'm just starting out learning how to program, and I find it irritating that there are so many languages and it's not that easy figuring out which ones you should learn and which ones you shouldn't.
- FraaJad 12y agofocus on step 1. getting good at solving problems in one language step 2. get really good at that language. (ie., know how to avoid pitfalls, get best performance, know corner cases) step 3. learn new languages that expose you to newer paradigms (ie., you know "OOP" languages, learn FP langauges next).
- JulianMorrison 12y agoI think they ought to add a one argument version of the copy() keyword to bitwise-duplicate and fix up the pointers on the built-in slices and maps. This would support the copy-change-replace semantic their example for Value follows.