Go: Planning the 1.5 release
groups.google.com
groups.google.com
(Screams come from the Old UNIX Admins.)
https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGh...
But shared libraries aren't the only way or even (often) the best way to share code. Especially when we're talking about UNIX tools, it's pretty easy to have one process run another process. Go has a really quick startup time which makes that practical.
I am looking forward to go someday being suitable for producing native shared libraries. If they ever prioritize and complete that work, that's something I'll absolutely be taking advantage of, and will extend the situations where I'm able to reasonably use go.
I guess I'm happy importing everything into monster huge static binaries and not worrying :)
So far my view is that I really like the language but I'm finding the tooling pretty unappealing. Wonder if I'm missing a trick?
I use GoConvey to automagically run my tests and tell me what I broke. I keep this running in a terminal window (so I can CTRL-C stop it) and a browser window.
I have another terminal tab on the same window for godoc, and that's serving another browser window.
I have a terminal tab for git commands and file manipulation (this is the one the terminal window is normally on).
I moved away from SublimeText to Atom (with go-plus) because while the load times suck, the go language support in the tooling is way better. Not that GoSublime is bad, it's not, but Atom just works better for me. I tried vim, and loved it, but the support for the go tools was never quite there, and configuring the bloody thing was a nightmare.
So every time I save a file it automagically runs gofmt, goimports, compiles and runs my tests in goconvey (and tells me what I broke), and colours my test coverage right in the editor.
It's not quite the integrated experience that Visual Studio is, but it's incredibly powerful, and conforms to the unix philosophy of lots of good, small programs working together.
And just for comparison; today I spent 20 mins trying to get a dark theme on VS2010 and had to give up (or hand-pick every colour in what looked like around 100 options)... whereas I have dark themes galore on everything else ;)
actually it's because I have a 2010 licence, but none for 2013. Another advantage of Go...
- DLLs are distributed with applications
- Dependencies to GAC libraries are enforced with full version
- we make use of application manifests when needed
> actually it's because I have a 2010 licence, but none for 2013.
Express and Community editions?
We just use MSDN subscriptions.
> Another advantage of Go...
I see some good uses for Go as an improved C, but tooling when compared with JVM and .NET eco-systems is not one of them.
On the other hand, on top of the JDK I have to install, eg, Eclipse, maven, etc. Not to mention all the crazy frameworks I would need to get any real project off the ground.
Similarly with .NET I have to install a whole host of stuff with Nuget, LINQPad, etc.
I rather use RAD tooling for GUI design, not spending hours doing design by code.
I also prefer to have visual representation of DB schemas and generate code from it.
I could go on with lots of other examples, Go tooling will get there some day when the language gets enterprise adoption.
An IDE is an integrated development environment; emphasis on integrated. Having to, by yourself, put together a mixed assortment of tools for your development environment doesn't seem to qualify as being integrated. Though of course someone could come and make a program that bundles a lot of tools together and present them as a coherent, integrated package.
(Personally I'm sceptical of IDEs myself and tend to believe more in being able to make your own work-flow and programming environment, which a lot of loosely coupled (ideally not coupled at all) tools makes simpler.)
Mono always supported static linking.
http://www.mono-project.com/docs/tools+libraries/tools/linke...
http://www.mono-project.com/docs/advanced/aot/
Sometimes I wish people would not mix toolchains with languages.
Whereas the go toolchain is very much a part of the language. The go team don't tell you whether tabs or spaces are canonical, they tell you to run go fmt on your code.
Go needs to support shared libraries if it wants to move to the next level of adoption.
Imagine each binary being 5 mb on average and multiply that by 100.
Are you sure it's because they are statically compiled?
Not because each binary has DWARF debug symbols in it so that there are useful stack traces?
> Imagine each binary being 5 mb on average and multiply that by 100.
I don't think it's a factor of 100 times, that seems a bit outrageous.
> I don't think it's a factor of 100 times, that seems a bit outrageous.
I think he means 100 utilities all weighing in at 5mb
Removing DWARF information with -ldflags -w reduces the size of the binary by 20%. The binary is 1.8MB originally...
$ go build hello.go
$ wc -c hello
1806192 hello
$ go build -ldflags -w hello.go
$ wc -c hello
1408880 hello
the rest is pretty much all runtime, the hello world itself should take about 10k, that's more or less the size of the C or dynamically linked Rust versions (Rust also uses static linking by default, and the hello world is 300k in that case) $ cat > t.go
package main
func main() {}
$ go build t.go
$ wc -c t
623280 t
$ nm t | wc -l
1029
$ cat > t.go
package main
import "fmt"
func main() { fmt.Println("hello world") }
$ go build t.go
$ nm t | wc -l
2541Shared libraries for the std lib would definitely be nice for utils, but they do have drawbacks too (dll-hell).
If you are severely resource constrained, and need to have lots of tiny programs resident in memory at once, then go with static linking is not a good choice, but does this preclude using go tools on modern servers, desktops, phones where many binaries are typically > 1MB today and many are only run for short periods anyway?
There is also .a/.lib hell, the only difference is when it gets handled.
In Windows dll-hell is a solved problem since Windows 2000 for any developer that bothers to follow Microsoft guidelines instead of copying dlls into systems directories.
I think gccgo allows for .so.
And the work for Android is adding .so support to the main toolchain.
"Unix system programming in OCaml" http://ocaml.github.io/ocamlunix/
Modern production environments often involve only one program per VM, or multiple instances of the same program. In such cases, shared libraries are a lose.
As you know, options have existing since the early days, but mentalities are hard to change.
I came to the conclusion that many issues in computing are only solved with change of generations.
The project has 2,100 open issues and 8,500 closed issues.
The stability more or less comes down to the community moving away from targeting nightly, and that can only happen when all of the fires are put out. There are still a lot of breaking changes and clean-up being done in the final hour.
Some people consider stable to mean that the language is "production ready", which often implies a complete set of common libraries. There is still a lot of work to be done in this regard after 1.0. Doing the nightly build whack-a-mole is too frustrating for many, though, so 1.0 will help a lot for developing the ecosystem that a "public ready" language needs.
https://github.com/rust-lang/rfcs#active-rfc-list
__________________________
discussion re: stdlib and 1.0 https://www.reddit.com/r/rust/comments/2mo0zb/the_race_towar...
This is a recent thread on the subject:
https://groups.google.com/d/msg/golang-dev/0_N7DLmrUFA/qGRb8...
For what it's worth to those new to Go, it's well-worth learning. It's not a perfect language but I've thoroughly enjoyed working with it. It strikes a lot of balances very well.
Will we be able to write at least a simple CRUD android app using pure Go?
It's entirely possible right now — we just need it to mature.
The NDK doesn't offer support for the Android APIs besides graphics, sensors and audio. POSIX is also only partially available.
So you will need to either use JNI or write your own UI with OpenGL.
So unless the Android team implements something like Windows Phone language projections (APIs metadata), it won't happen.
https://code.google.com/p/go-wiki/wiki/PackageManagementTool...
Last I checked godep, the only thing I didn't like was the weird things you had to do with your project layout, but the way ahead is promising (and maybe it's not so bad now). Certainly it's much better than gopkg.in.
Though I do agree. It would be nice to have this sort of tooling as part of the Go distribution.
FWIW, I have been using godeps and it seems nice so far. I'd definitely recommend taking a look.
Well, technically they are (whipped up a quick example): http://play.golang.org/p/e2qkKN4VY1
But it requires the use of interface{}, which reduces the usefulness of the type system, and you still can't do (what I guess must be crazy) stuff like return a slice.
What does the future hold for cgo? Yesterday I ran into erratic DNS success with a cross compiled program, win to lin. Haven't had a chance to look further, but I'm wondering when I'll run into similar snags again.
Have a Go: package main
import (
"fmt"
"net"
"os"
)
func main() {
hostname := "feeds.feedburner.com"
if len(os.Args) > 1 {
hostname = os.Args[1]
}
addr, err := net.LookupHost(hostname)
if err != nil {
fmt.Printf("err: %v", err.Error())
} else {
fmt.Printf("addr: %v", addr)
}
}
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0I do not have windows box to crosscompile any longer. I did test go 1.4 rc2 with CGO_ENABLED=0, which builds a static binary, and it gives -
addr: [74.125.192.118 2607:f8b0:4001:c00::76]
Are you seeing different behavior? Please describe...I'll see if I can look into it.
$ ./dns-win-xc.bin
err: lookup feeds.feedburner.com on [178.22.66.167]:53: no such host
$ ./dns-lin.bin
addr: [173.194.116.64 173.194.116.69 173.194.116.71 173.194.116.65 173.194.116.73 173.194.116.70 173.194.116.67 173.194.116.66 173.194.116.72 173.194.116.78 173.194.116.68 2a00:1450:400c:c0a::76]
Win 8.1, go1.3.3., Centos 7. There's a downvoter for some reason, maybe they have something to add...? Don't let me lead you astray - I haven't yet read that article I linked to, but a quick glimpse suggested to me that this isn't a bug.Secondly, your dns-lin.bin, is that with go built with CGO_ENABLED=0? Ie...if you ldd both files, do they both claim to be statically linked?
If you'd like to continue by email, please click my username.
Thanks
Speed of development is the killer feature that Go has. For me and most people I know who enjoy the language it provides an almost frictionless development experience that makes us more productive than any other language I know.
I'm a language geek so I totally get the whole "Why doesn't go have {Generics,Typeclasses,Hindley-Milner Type Inference,...}" arguments. Sometimes I miss them too. But then I remember how I literally cut months off a personal project's development time using Go. That's when I remember to be greatful for the core teams approach to making a purely pragmatic language that is geared toward frictionless development above all else.
By this you mean that people adopted Go because it is good (in a technical sense), and because of the speed of development rather than because it was "new and shiny"? Fair point.
> I'm a language geek so I totally get the whole "Why doesn't go have {Generics,Typeclasses,Hindley-Milner Type Inference,...}" arguments.
Why do you bring this up?
I was trying to be preemptive instead of presumptuous. Please accept my apology. I can see how it might have been misinterpreted.
puts on trollface.. possibly even generics :)