News for hackers. Stuff that matters.
Re:On the Road to Pure Go X11 GUIs by UI_at_80x24 on Friday September 07, 2018 @03:05PM (#17936840)
Regarding Go:

>Yeah, but your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should.

Sorry couldn't resist. I'm a Systems Admin. An old-fart at that. Every single encounter I have had with Go has been a burning pile of unpleasantness. Most recently, the Go-Ethereum client.

So, referring back to the quote; could we just not shoehorn this into everything? It may be fast but it's fragile FWIW.

Re:On the Road to Pure Go X11 GUIs by laumars on Friday September 07, 2018 @03:23PM (#17936954)
As an old time sysadmin I'd expect you of all people should know better than to make assumptions about a programming language based solely on a small handful applications written in that language.

The ironic thing is what you described ("fast but fragile") better describes the traditional systems languages that are used to build X11 components: C and C++. If I had to describe Go as a systems language I'd say it was the exact opposite: slow but stable. Sadly it's also pretty inflexible for any real low level stuff (in my experience).

Re:On the Road to Pure Go X11 GUIs by fao_ on Friday September 07, 2018 @05:02PM (#17937607)
> Sadly it's also pretty inflexible for any real low level stuff (in my experience).

Which is what the poster above you meant by fragile. C and C++ rarely break in most spaces, these days. I can take a C library and expect it to build and just work 99% of the time, and I can build something in those languages and expect it to be flexible enough to work most of the time as well.

Re:On the Road to Pure Go X11 GUIs by majewsky on Friday September 07, 2018 @05:23PM (#17937772)
> I can take a C library and expect it to build and just work 99% of the time

You cannot imagine how many times I've heard that GCC upgrades broke builds. I've never heard of Go upgrades breaking builds.

Re:On the Road to Pure Go X11 GUIs by laumars on Saturday September 08, 2018 @02:24AM (#17939724)
If only that were actually true. I've done a lot of work porting C++ code to various different flavours of Linux and Unix as well as compiling stuff for Linux from working source and it's rare that things will "just work". Granted a lot of time the real pain point is manually having to deal with dependencies (even Go's old $GOPATH solution is better than the stanard C++ approach!). Then you have compiler flags, compile time options, distribution specific patch files, dependencies for the build scripts themselves, etc. And that's before you've even touched on compiler specific variations, language versions and undefined behaviours. There is a reason why the source-orientated repositories like FreeBSD ports, Gentoo's portage and Arch's AUR have wrappers around build scripts and it isn't because things "just work 99% of the time" ;)

Go does have its short comings, I'd be the first to admit that, but the actual reason I started writing Go was because it was far less brittle trying to write portable code than C++ and at the time I was having to do a fair amount of cross compilation on platforms of other CPU architectures as well as different host OSs (Rust wasn't mature at that point, .NET wasn't open source and I've never enjoyed working with Java so I thought I'd give Go a try)

Re:On the Road to Pure Go X11 GUIs by fao_ on Saturday September 08, 2018 @08:22PM (#17943583)
really? I find that usually automake systems, despite how disgusting they are to deal with from a developer-standpoint, almost always tend to 'just work' from a user-standpoint.

I can't really speak very much for C++ systems, as I understand the dominant build system for that is CMake, which personally I have found completely abhorrent from a user-perspective. (I once tried to build a 32bit program on a 64bit system, and CMake completely and totally refused to do so! There were no override flag that actually affected the program, and it didn't look as if there was any standard place to inject flags to the compiler, I still have no idea how one goes about doing it, to be quite honest).

Re:On the Road to Pure Go X11 GUIs by sumitgt on Friday September 07, 2018 @03:09PM (#17936865)
> Every single encounter I have had with Go has been a burning pile of unpleasantness.

Can you elaborate?

> It may be fast but it's fragile FWIW.

Go explicitly focuses on language stability over fancy new features.

Re:On the Road to Pure Go X11 GUIs by slaymaker1907 on Friday September 07, 2018 @03:21PM (#17936945)
> Go explicitly focuses on language stability over fancy new features.

I think that might be the problem... C is probably the most stable language around in terms of features, but it is probably the language that is most prone to bugs and security flaws that is in common use.

Re:On the Road to Pure Go X11 GUIs by laumars on Friday September 07, 2018 @03:35PM (#17937028)
C also has raw pointers, manual memory management and a bunch of other unsafe practices that Go doesn't. In comparison to C, Go is practically a scripting language.
Re:On the Road to Pure Go X11 GUIs by slaymaker1907 on Friday September 07, 2018 @05:00PM (#17937598)
Totally agree there. However, I think the metaphor might still hold that Go applications are brittle due to lack of features due to the ugly hacks you have to use to get around the lack of features. For instance, due to the heavy usage of manual error checking, it can be very easy to call a function and forget that it returns an error thereby ignoring that error. Bringing down your whole application due to a single error is bad, but silent failure is almost always much worse.
Re:On the Road to Pure Go X11 GUIs by zaphar on Friday September 07, 2018 @05:26PM (#17937791)
Go will complain loudly if you don't use a captured error value. It will also complain loudly if you don't capture the error value. This makes it harder in Go to ignore an error than most other languages. In fact a common complaint of Go is that it forces you to do something with the error when you would rather not.

I'm left to wonder what you are imagining would result in not handling errors on accident in Go.

Re:On the Road to Pure Go X11 GUIs by sumitgt on Friday September 07, 2018 @03:24PM (#17936962)
Yes, but it is very difficult to introduce the same kind of bugs in Go code considering you are no longer doing intricate memory management, etc.
Re:On the Road to Pure Go X11 GUIs by PopsiclePete on Friday September 07, 2018 @03:43PM (#17937091)
Considering that Go by default compiles to a static, native executable with close-to-0 system dependencies, I can't imagine why you'd hate it.

I deploy Go code all day long to various clusters consisting of hundreds of machines, and I'll take whatever Go deployment issues you can throw at me all day long, any day, over "simple" python/ruby issues.

It's all been moot since I went with Docker anyway.

Re:On the Road to Pure Go X11 GUIs by antaviana on Friday September 07, 2018 @04:54PM (#17937552)
I wrote my first Go application that was to be run on a very Linux instance (1 GB), serving results to HTML from an in-memory map of some 150MB. The memory growth was really out of control, panicking with "out of memory" under even low load until I added debug.FreeOSMemory after serving each search result. Even with that, I had to change the instance to 2GB. It was a one-off excperiment, but I missed releasing memory by myself to ensure a manageable working set.
Re:On the Road to Pure Go X11 GUIs by sagichmal on Friday September 07, 2018 @06:03PM (#17937997)
Your program certainly had a bug. Feel free to paste a link to it here, I may be able to debug it.
Re:On the Road to Pure Go X11 GUIs by courtf on Friday September 07, 2018 @06:19PM (#17938093)
Yeah definitely a bug.

I've worked on systems that allocated and freed hundreds of GB every 10 minutes, written in Go with no such issues.

Re:On the Road to Pure Go X11 GUIs by justinclift on Friday September 07, 2018 @06:41PM (#17938218)
Is the code online somewhere?

It really sounds like there was something not-quite-right in there. Might not be too hard for someone with time + clue to spot it. :)

Re:On the Road to Pure Go X11 GUIs by dcu on Saturday September 08, 2018 @09:49AM (#17940791)
that's called a memory leak: https://en.wikipedia.org/wiki/Memory_leak

I've seen happening in Go multiple times when people forget to close the response body after making a http request.

Re:On the Road to Pure Go X11 GUIs by jy3 on Friday September 07, 2018 @03:50PM (#17937146)
One would think that syadmins love native executables with no system dependencies.
Re:On the Road to Pure Go X11 GUIs by justinclift on Friday September 07, 2018 @06:39PM (#17938205)
Errr why?

They come with no associated bits to hook them into the rest of the system. eg no launch/process monitoring things (start-at-boot and similar, metadata and "package info" for being able to pull down upgrades along with other system packages.

Go stuff is fine for a lot of deployment cases, but in production situations the rest of the er... crap that normal packages come with does serve some important purposes. At least on *nix systems. :)