News for hackers. Stuff that matters.
Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @10:37AM (#26541422)
> Ignore comments about how go is simple to write. There's a fair amount of bad go code and people break rules all the time.

This is one of the most famous straw man arguments made in software development and I've seen it used against a plethora of different programming languages -- each time completely missing the point that you can get bad developers writing bad code in any language. The fact it happens in Go isn't a testament not to how difficult it is but rather how good of a job the language has done attracting newer developers.

> Go is not a simple language. Please learn from my mistakes, and ignore arbitrary metrics like how go has fewer keywords. The complexity doesn't go away, it's hidden away somewhere.

I completely disagree. Having fewer keywords does make Go simpler to learn and simpler to read other peoples code. The opinionated nature of Go also makes it simpler to collaborate.

Writing software isn't simple but that complexity of turning ideas into code doesn't change significantly from one language to another (generally speaking). You still have to solve a problem using logic and functions. I find the harder problems with software development is collaboration (eg ensuring everyone is following the same coding styles) and reading back old code. Go makes those things easier than some -- not all but definitely some -- languages.

I say this based on 30 years of experience writing software in more than a dozen different programming languages.

Re:The ecosystem of the Go programming language by TheDong on Monday March 22, 2021 @03:30PM (#26545594)
> Having fewer keywords does make Go simpler to learn and simpler to read other peoples code

Go carefully touts how few reserved keywords it has, but I think it would actually be a simpler to reason about language if it had more reserved keywords.

For example, you may notice that "true", "false", "len", "new", etc all aren't reserved keywords.

This sometimes does lead to bugs, for example someone may make a function, like "func memoize(new func(...interface{}) interface{}) func(...interface{}) interface{}", which shadows a common builtin function with a function argument.

Usually, the above leads to a compiler error when you try to use the "copy" argument (a value) as a function, but every once in a while, you end up with a type-compatible shadow, at which point things can really break.

It would be less confusing if things like "new", "len", "copy", and "true" were keywords, rather than builtins that someone may accidentally alias and shadow.

If you account for things like rather essential builtins as well, go's list of keywords starts to look far less impressive, and on-par with java or C#.

Re:The ecosystem of the Go programming language by colejohnson66 on Monday March 22, 2021 @05:47PM (#26547683)
Speaking of reserved words, I remember reading once about how PL/I had no reserved words. Which has the nice quirk that this is valid code:

    IF IF = THEN THEN THEN = ELSE ELSE ELSE = ENDIF ENDIF
...assuming IF, THEN, ELSE, and ENDIF are all variables.
Re:The ecosystem of the Go programming language by gher-shyu3i on Monday March 22, 2021 @04:38PM (#26546619)
true := false is valid golang code
Re:The ecosystem of the Go programming language by makapuf on Monday March 22, 2021 @05:21PM (#26547296)
Re:The ecosystem of the Go programming language by DangitBobby on Monday March 22, 2021 @11:08PM (#26550569)
Wow, WTF? Why are true/false not reserved?
Re:The ecosystem of the Go programming language by oblio on Tuesday March 23, 2021 @07:05AM (#26553554)
They were worried about internationalization and they though reserving vrai/faux, adevărat/fals, etc would be overkill.

I'm kidding. It does seem like a strange decision...

Re:The ecosystem of the Go programming language by jcelerier on Monday March 22, 2021 @11:48AM (#26542495)
> Having fewer keywords does make Go simpler to learn and simpler to read other peoples code.

that sounds like saying that latin-alphabet languages are easier to read than chinese or japanese because they have fewer characters. the complexity just goes in the way those characters are assembled together.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @11:54AM (#26542559)
Funny you should use that as an example because one of my lockdown projects has been to learn to read simplified Chinese and I'd say your point about Latin-alphabet languages was also true despite it being intended as a falsehood. Learning all the different Hanzi is immensely harder because of the number of characters and how intricate they often are. I'd also say that last point means it's also easier to write Latin characters too.
Re:The ecosystem of the Go programming language by jcelerier on Monday March 22, 2021 @12:13PM (#26542819)
> Funny you should use that as an example because one of my lockdown projects has been to learn to read simplified Chinese and I'd say your point about Latin-alphabet languages was also true despite it being intended as a falsehood.

but that's because you come from a latin background. I lived with a japanese girl for a long time and she was adamant that kanji were much easier and faster to parse for her than western text

Re:The ecosystem of the Go programming language by alisonatwork on Monday March 22, 2021 @01:45PM (#26544061)
I can see some kind of argument that logograms are easier to parse than an alphabet because you can communicate more information in a smaller space, but that's only true if you already committed the thousands (!) of logograms to memory in the first place. This is no trivial task!

The question is if it's worth putting a 5+ year barrier in front of people in order to become fluent in a written language that maybe, possibly, might be "faster" once you are fluent. For native speakers, perhaps that's worth the effort (although there are plenty who argue otherwise). For second-language speakers, I think the answer is almost certainly no.

So bringing it back to Go. Perhaps Go seems more difficult and slow to people who already invested the years required to become fluent with something like C++. I doubt that, but I guess it's possible. But Go isn't designed for that case. It's designed as a second language that any programmer can learn quickly and become reasonably productive in.

If you have a company with 1000 programmers who all know different languages, and you want to start creating good software right now, would you standardize on the language that all 1000 programmers can learn in a couple of weeks, or the language that 100 programmers know inside out and the other 900 are going to spend a year figuring out?

Re:The ecosystem of the Go programming language by blacksmith_tb on Monday March 22, 2021 @12:52PM (#26543354)
I took a year of Mandarin as an undergrad, and learned ~1,500 characters (at my best). The two approaches are just radically different (pun intended), with an alphabetic writing system (not just Latin, but Arabic, Cyrillic, etc.) if you know the system, you can read texts in other languages that share that system aloud - without knowing what you're saying. With logographic systems like Hanzi, you may be able to guess at the meaning of a character you don't know by looking at its radical, but you have no idea how to pronounce it. I do think broadly speaking alphabets are easier to teach and to learn, though still not easy (ask any small child).
Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:35PM (#26543147)
> but that's because you come from a latin background. I lived with a japanese girl for a long time and she was adamant that kanji were much easier and faster to parse for her than western text

You could make your same argument here and say "that's because she comes from a Japanese background" ;)

Re:The ecosystem of the Go programming language by jcelerier on Monday March 22, 2021 @01:13PM (#26543642)
but that is precisely my original argument. in the end everyone finds "simple" what they're accustomed to, and you end up with more-or-less the same amount of complexity overall, no matter the system used to express logical thoughts, if you let humans try to optimize it over decades (but systematically, for programming languages) or generations (but less systematically, for spoken languages).

I'm mostly programming in C++ and I find understanding what happens in some Python scripts much harder than some template metaprograms I've worked on for instance.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @01:19PM (#26543721)
You're conflating different things now: simplicity vs familiarity.

If someone is already a C++ guru then writing something in C++ for them will be easier than learning Go. But that doesn't mean that Go is easier to learn than C++.

When talking about simplicity people generally compare all languages as if one has little or no familiarity with them. Otherwise it's not a fair comparison.

Re:The ecosystem of the Go programming language by jcelerier on Monday March 22, 2021 @01:43PM (#26544033)
> You're conflating different things now: simplicity vs familiarity.

we're talking about humans, you cannot not conflate them.

> When talking about simplicity people generally compare all languages as if one has little or no familiarity with them.

that's a philosophically pointless exercice. Things have to be assessed in their actual, real-world context to bear any relevance !

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @04:25PM (#26546440)
...and you asses something by comparison. Having different starting points isn't a comparison, it's a bias. I don't have an issue with people having a bias (we all have our own preferences, our own strengths and weaknesses, and stuff we just enjoy more than other stuff). But lets not pretend it's anything more than a bias if you're not willing to compare things from an even starting point.
Re:The ecosystem of the Go programming language by flippinburgers on Tuesday March 23, 2021 @03:32AM (#26552087)
All you need to do is look at how many, many more hours Japanese students have to put into studying kanji to know that your perspective isn't accurate. The basics of learning Japanese are much more difficult that a latin language. What is more, the complexity means that people are very prone to forget how to even write kanji. To the degree that is is often a game show topic.
Re:The ecosystem of the Go programming language by turtlebits on Monday March 22, 2021 @01:30PM (#26543844)
Part of the hard part in learning Chinese and Japanese is that there is a separate phoenetic "alphabet" you have to learn to properly pronounce characters. (at least in Taiwan, kids learn bopofomo)
Re:The ecosystem of the Go programming language by fomine3 on Monday March 22, 2021 @08:09PM (#26549251)
Native Japanese never learn alphabets for pronounce.
Re:The ecosystem of the Go programming language by CobrastanJorji on Monday March 22, 2021 @05:32PM (#26547442)
Can I derail this to ask how you've been going about your project? I had the same lockdown project but with Japanese. It's been going well. I've found a little company called Wanikani that does a great implementation of a spaced repetition system. I've never rigorously used one before, but based on my progress, I'm now a believer in the technique and am a bit mad at myself for not doing this for school subjects as a kid.
Re:The ecosystem of the Go programming language by derefr on Monday March 22, 2021 @02:37PM (#26544867)
The argument may be wrong, but the conclusion is true: literacy rates are actually lower in countries with ideographic languages — likely because there are more properties of words in ideographic languages that need to be memorized "literally", and fewer properties that can be intuited, or easily "sketched" verbally in order to ask the real spelling/pronunciation/etc.

One study I recall (on my phone now, will cite later) reported that fewer 20-year-olds have "fluent" levels of reading comprehension for what they read in the [ideographic] newspaper in Japan or China, than in neighbouring countries with alphabetic languages derived from those same historical ideographic roots (Korea, Vietnam, Thailand.)

Another study (will cite later) reported that the reading-comprehension rate for ideograph-heavy works in Japan is also decreasing over time, as more people spend their time reading mostly explicit "[ideograph-]light" novels, rather than literature that would actually teach them kanji. (Which is a vicious cycle.)

Given that ideograph radicals are kind of analogous to alphabetic morphemes, this is kind of surprising. I think it's mostly because it's self-evident how to pronounce alphabetic morphemes if you know the pronunciation rules of the language, while

1. the names for ideographic radicals need to be memorized, more like the names of alphabetic letters (but with there usually being far more radicals in common use per ideographic language, than there are letters in an average alphabet.) And

2. ideograms aren't usually linear, but rather structured (things above/below/beside things, things inside things, things bonded to other things and reduced in the process, etc); and there's no universal cultural fluency for speakers of these languages in an ordering system for spelling out these radicals. You usually have to see a character written before you can truly know how to "spell out" its radicals.

Because of these two problems, you can't just look at an ideograph you don't know, and casually, conversationally spell it out to someone else, in order to ask how it's pronounced / whether you're pronouncing it correctly. Unless, that is, you both know the names of all the involved radicals, and have a good geometric guess for the ordering. In practice, most people don't try to ask this question verbally, but either need to show someone the character written; or need to use a dictionary.

I've noticed that this actually results in distinct approaches to how people treat "literature with words they don't know", between people whose first language is an alphabetic one vs. people whose first language is an alphabetic one. Given an alphabetic-language work with word they don't know, alphabetic-native people seem to be much more confident in just jumping in and looking words up as they go; while ideographic-native people seem to be more reticent. I believe they're subconsciously expecting new [alphabetic] words to be a much larger barrier for them than they actually would be, as they're used to thinking in terms of the barrier that novel ideographs impose.

Re:The ecosystem of the Go programming language by yorwba on Monday March 22, 2021 @04:07PM (#26546167)
> literacy rates are actually lower in countries with ideographic languages

The World Bank puts China (97%) behind Korea (98%), but ahead of Vietnam (95%) and Thailand (94%). They don't have data on Japan, but I'd be surprised if their literacy rate were much lower. (I'm also on my phone, but here's the link: https://data.worldbank.org/indicator/SE.ADT.LITR.ZS?location... )

I think those literacy rates mostly reflect the quality of these countries' respective education systems, rather than any inherent properties of the scripts used.

Re:The ecosystem of the Go programming language by anthk on Monday March 22, 2021 @03:14PM (#26545378)
IDK why do they downvote you; the issues with logographic languages are evident. With Spanish for example, you have a very regular spelling plus far fewer symbols. You can guess the spelling of the word by just reading it, and the opposite it's true. You may transpose a b/v, or omit an h, but that's it.
Re:The ecosystem of the Go programming language by gilbetron on Monday March 22, 2021 @01:07PM (#26543564)
It would be interesting to find someone that grew up knowing a third type of language (no idea what that is, though!) and that then learned latin alphabet and chinese (say) as an adult and hear what they say :)
Re:The ecosystem of the Go programming language by cratermoon on Monday March 22, 2021 @01:09PM (#26543599)
Arabic, Hebrew, or one of the Indian subcontinent languages.
Re:The ecosystem of the Go programming language by autarch on Monday March 22, 2021 @01:45PM (#26544072)
Those all use alphabets or syllabaries, so it's just a matter of learning a small new set of symbols.
Re:The ecosystem of the Go programming language by cratermoon on Monday March 22, 2021 @02:06PM (#26544394)
Yes and no. There are complex rules around joining letters depending on where they fall in the words. Also there are no vowels but sometimes there are vowel markers.
Re:The ecosystem of the Go programming language by autarch on Monday March 22, 2021 @05:41PM (#26547575)
I meant that if you know Hebrew, Arabic, or Hindu, learning the Latin alphabet is a lot easier than learning Chinese characters. And Latin user will probably find Arabic easier than Chinese too, even though the Latin alphabet is a bit simpler than Arabic.
Re:The ecosystem of the Go programming language by cratermoon on Saturday March 27, 2021 @02:36PM (#26604359)
It also depends a lot on the language. There are dozens of languages that use the same core Latin characters plus a few decorators. Someone coming from a strongly inflected, gendered language trying to learn English is going to struggle compared to trying to learn Spanish or French.
Re:The ecosystem of the Go programming language by oblio on Tuesday March 23, 2021 @07:08AM (#26553576)
I guess it depends on which Latin alphabet variation. Vietnamese or Polish speakers will probably not feel intimidated by Arabic :-p
Re:The ecosystem of the Go programming language by preommr on Monday March 22, 2021 @12:40PM (#26543213)
> This is one of the most famous straw man arguments made in software development and I've seen it used against a plethora of different programming languages -- each time completely missing the point that you can get bad developers writing bad code in any language.

This is a fair point since I wasn't very clear, and I am talking about something that's fairly subjective and abstract. I think the more claims a language makes, the more open it is to failure. I just googled is "rust difficult to learn", and the first answer is "no". It's all relative, but I am sure that most of us have heard that rust does have a steep learning curve. The only other language that I can think of that advertises itself as easy is python. And I think it has a lot of faults in those claims too. But python does a much better job of being easy than go does. It's completely different leagues.

Again, this is a messy point to make, either somebody understand what I am trying to say or they should leave it at that because trying to qualify ideas like this is fuitless.

> I completely disagree. Having fewer keywords does make Go simpler to learn and simpler to read other peoples code.

I really don't think skipping keywords like public and using casing makes things simpler. A quick google search shows that go has 6 less keywords than c. I mean, c'mon...

> I say this based on 30 years of experience writing software in more than a dozen different programming languages.

If you've had years of experience in old school c/cpp, then (I would assume) go will be a lot easier, and a lot better in comparison.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:51PM (#26543341)
> If you've had years of experience in old school c/cpp, then (I would assume) go will be a lot easier, and a lot better in comparison.

In my opinion old school C++ was a lot easier to learn than modern C++. I'm talking about the language specification specifically. The tooling is undoubtedly better.

Visual Basic 6 easily wins the "easiest language" award in my opinion though. But it's often seen as a faux pas to mention VB amongst developers

Re:The ecosystem of the Go programming language by croes on Monday March 22, 2021 @12:59PM (#26543459)
But some languages make it easier to write bad code than others.
Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @11:25AM (#26542154)
> Having fewer keywords does make Go simpler to learn and simpler to read other peoples code

I partly disagree. It might be easier for you with 30 years of experience. Sysadmin with 8yrs of experience and having to manage operations utilizing Go is not easy.

The code looks neat on the page; under the hood is really un-understandable at times unlike Perl, Ruby, TCL where the code is staring you in the face. The importation of modules off github is fundamentally wrong too.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @11:47AM (#26542475)
> The code looks neat on the page under the hood is really non-understandable at times. Unlike Perl or TCL where the code is staring you in the face.

Are you able to elaborate on this a little more? I love Perl and in fact that was my favourite language for a long time (despite all of its warts). But languages like Go are a lot more explicit that Perl so I'm not really sure what you mean by "under the hood" and "code is staring you in the face.

> On vent: I also really loathe importing modules off github.

I must admit that really annoyed me too but in fairness it's a pretty common pattern (eg brew, npm, etc). In a way Perl (CPAN) is an edge case rather than the norm. The difference is other systems add a shim around the code source even if they do still pull directly from (or from a cache populated directly from) Github et al

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @11:59AM (#26542635)
Sure.

We use Prometheus exporters, most of the exporters are written in Go. And this is a snip from the vmware-exporter for our VMware estate.

    metrics.go
The first throw was this:

    import (
 "context"

   "github.com/prometheus/client_golang/prometheus"
 log "github.com/sirupsen/logrus"
 "github.com/vmware/govmomi/find"
 "github.com/vmware/govmomi/view"
 "github.com/vmware/govmomi/vim25/mo"
 "github.com/vmware/govmomi/vim25/types"
So as it currently stands I have no idea what those modules are and what I am loading. Browsing each of those repos sure will tell me, but that's not my role. My role is to make X operational.

And if that repo doesn't exist anymore and you go to compile, it fails. More overhead if I need to make changes to any of those modules. I would need to git clone it somewhere, make the change and then either recommit it to git, or do something to make it locally available. At least with NPM, CPAN they are local to the file system.

So lets start:

     var (
 prometheusHostPowerState = prometheus.NewGaugeVec(prometheus.GaugeOpts{
  Namespace: namespace,
  Subsystem: "host",
  Name:      "power_state",
  Help:      "poweredOn 1, poweredOff 2, standBy 3, other 0",
 }, []string{"host_name"})
I understand all of that. Power_state, display the help, power status description etc, however prometheus.NewGaugeVec -- Sounds great. What is it? Where do I find this? What module is this related too?

That's where it falls down for me. I now have to duck in to the rabbit hole of github to find out where that function is phrased and in this sense "under-the-hood" could also count for library .pm files in perl, but now having to navigate GitHub really messes with my workflow.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @12:18PM (#26542895)
> So as it currently stands I have no idea what those modules are and what am I loading? vim25? Is that the text editor vim?

Take any of these imports, append it to https://godoc.org/, and see.

For example, github.com/vmware/govmomi/ becomes http://godoc.org/github.com/vmware/govmomi/ , which tells you:

    govmovi: A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter).
Everything underneath govmovi is subpackages of it, so `find`, `view`, `vim25/mo`, and `vim25/types` are all govmovi packages. You can also visit them on godoc to read documentation, if the code authors followed documentation best practices.

These are imports like in any other language. They are, however, nearly always based on a global URL, and thus have a godoc page that you can visit and read the docs for immediately. They are also always qualified, so if you wanna find all all uses of govmovi/vim25/mo, just C-f for "mo." in your codebase. No `from foo import *` equivalent exists in Go, which is one of my favourite features of this language.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:27PM (#26543027)
Sure. Fair to say that godocs is to cpan of perl.

But Go doesn't present you the code on disk. I have to hunt somewhere else with a reference. With a library file, I know that prometheus::exporter::blah is related to the perl module prometherus, exporter subroutine blah

I need the code in front of me to understand how it's interacting; the whole github ruins that for me.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @12:33PM (#26543101)
If you want to read the code, each godoc name can be clicked to directly redirect you to the source code of what you're looking for, eg. to a github page code viewer.

Depending on whether you use gomodules, GOPATH, or any other build system you also can find the files locally to grep through them or use your text editor to read them locally. You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches.

I do a _ton_ of code reading in my work, and I find using Godoc for that probably the best experience of any language (second only to maybe Haskell/Hoogle, but there you get much more difficult-to-grok-at-a-glance code).

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:41PM (#26543214)
> You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches.

So much overhead where time is limited. I shouldn't need to fork packages, I don't want to fork.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @12:45PM (#26543266)
It's one `cp -r` and a 1 line change in go.mod [1]. You can also just `go mod vendor` to have all modules land in a `vendor/` directory when you can edit things as you wish [2].

[1] - https://golang.org/ref/mod#go-mod-file-replace

[2] - https://golang.org/ref/mod#vendoring

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:33PM (#26543107)
> But Go doesn't present you the code on disk.

Yes it does. You couldn't compile the modules if they weren't on disk :)

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:37PM (#26543181)
But only at compile time.
Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @12:42PM (#26543228)
`go mod download`, if you're using go modules, will fetch you the deps.

This is no different, to me, than downloading a tarball of Python software with requirements.txt and not running setup.py or pip install. I don't understand the problem.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:47PM (#26543301)
Right, then it could be I wasn't aware there is a "go mod download". If it actually gives me a file I can modify without having to create any repo, special things to apply the changes then that will assist me in the future.

Go isn't my thing and the less time I play with it, the happier I am. This is only my experience of it, and my experience is it acts friendly, but is a faff.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:56PM (#26543412)
> the less time I play with it, the happier I am.

There lies the problem. If you don't want to invest the time to learn the tools then you can't really complain that your screwdriver is rubbish at hammering in nails. And it doesn't matter how easy or hard any programming language is, all languages will have a learning curve that people need to be prepared to undertake.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:59PM (#26543457)
It's not that I don't want to, it's more I don't have the time to invest upon. I'd read all the national library books if I could, but I just don't have the time.

End of shift, I walk away from my screen and try to do something other than. I'm burnt out enough by the tech field as it is.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @01:00PM (#26543482)
It seems to me that the problem here is your job, not Go. You could substitute Go here for any other language or technology that you don't know well and for which you're not given adequate time to learn the basics of, and you'd get the exact same result.
Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @01:06PM (#26543553)
My job is solid. I have time to do such. I would rather just use my time available on have more pressing issues then a language I don't really want to use.

Sure knowledge is boss, but my job is fine. It's not the job at fault.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @01:15PM (#26543679)
So it seems clear to me? You don't want to use the language, you don't want to learn the language, no-one is forcing you to use the language, then don't use the language.

What are your expectations? Is it that every language should be readable to people who know Perl? Is it that you shouldn't be reading or modifying the source code of open source projects? How could this work better in an ideal world? I am puzzled.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @01:28PM (#26543826)
Why are you turning this in to such a pedantic thing? I am not a programmer. I am a systems administrator who administrates systems. Is that not easy to grasp?

When my job is 98.9% something else than programming, I'd rather be learning AI, Robotics, History, Psychics, Gardening, Glass Blowing than a language I'll never use.

I've explained it a case of "Can you get this to work" Yes/No. If no, I move on to something else. That's my line of work.

If you want me to monitor,configure,administrate something, then it should be simple. Presented to me in one folder with all packages not downloaded from some corporate hell-hole of a website because it's the norm for younger developers. Am I not allowed to have that opinion?

I will research on how to operate but that's it. Life's busy enough that I don't have time to further research on how to setup individual environments. I've just wasted 10 minutes typing this message to reply rather then configuring an openldap server for user authentication, Luckily I'm on lunch.

Re:The ecosystem of the Go programming language by q3k on Monday March 22, 2021 @01:40PM (#26543989)
I'm not trying to be pedantic. Please do not assume bad faith.

I'm just trying to understand that worldview, which just seems drastically different from mine, even though we both seem to be generalists. If there is something that Go, or any other product, could do better to be better suited to your workflow, I would like to know what it is.

I don't write Perl, but if I had to qualify some piece of software that used it at work, I would make time then to learn as much of the basics of it that is needed to more easily get by. Even if it meant a day of reading Perl/CPAN docs to do 15 minutes of actual 'work', especially if the alternative is one or two days of blindly stumbling around to then not even be exactly sure if my 'yes/no' answer was correct. I don't even see much of a difference between learning something and just working with it - I can't imagine not having a browser window open with the docs/source code/whatever of what I'm currently working with.

In that way I've learned a fair bit of technologies I would have never touched otherwise, but now their knowledge, even at a surface level, is worth more than the sum of the products.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @02:00PM (#26544297)
I mean no offense and sorry for my angst if it came that way. It's frustrating when I can't paint my view and then get battled to death because of it.

TCL.

TCL is the only language workflow that has worked for without any stress.

    proc SomeProcedure {variable} {
     Code it to do something for yourself }
save, run and it works. No need to include modules, no need to download anything. I use my own TK/Gui interface which does stuff for me to make my life easier. And if I handed it to you, it would be in one folder with all files present no dependencies required. However I understand life is not like that unfortunately.

> I can't imagine not having a browser window open with the docs/source code/whatever of what I'm currently working with.

I don't. If at any point I need source code, I'll download it locally and compile/run it first. Then edit it learn the logic and flow of the program. I'm in terminal 99% of the time, orchestrating systems ranging from FreeBSD to Linux and AIX, if a browser is open it's for Slack, emails.

I am someone who wants to type "man something" and get a man page of it. vim Library/file.pm and be able to view the code under the hood for that specific project. That's simplicity and that's how it should be -- The over-hassle of downloading from git, forking it, apply push,pull changes just isn't my street specially assuming my box I'm working with has internet.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @04:33PM (#26546538)
The issue is you presented opinion as fact.

Opinion: I don't enjoy Go as much as Perl. [PASS]

Opinion: I'm more comfortable with Perl because I've spent more time in it. [PASS]

Both are perfectly acceptable.

However you made comments about objective truths that were incorrect:

Truth: Go doesn't download modules to disk. [FAIL]

For what it's worth, I really like Perl too. Us two are a dying breed in that regard. I was in two minds whether to reply because of that respect I have for fellow Perl hackers. But you kept repeating the same falsehoods as fact :(

Take your latest comment for example, you can bring up the Go docs for packages in the terminal as well:

    go doc $PACKAGE
So even there your Perl point is still equivalent to Go on an objective level. But I don't blame you for not liking/enjoying a language on a personal level.
Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @07:17PM (#26548779)
My original discussion was of that I thought Go was very hidden under the hood. I gave an example and got mobbed for it. I replied with emotion and misunderstanding and here we are.

The main thing I was going on is "Here's a GitHub link, add it to your code and you have an instant logger thing". Magic in my eyes and this blinding light throws me off.

Unlike Perl where the code is in a .pm file in front of you. That was what I was trying portray.

I'm going to leave this discussion to rest as it's all went wrong anyway. Tomorrow will be tomorrow and this will all be forgotten in a day.

Thank you for your responses and have a good evening.

Re:The ecosystem of the Go programming language by hnlmorg on Tuesday March 23, 2021 @07:36AM (#26553808)
But the point is Go and Perl behave exactly the same way with regards to all the points you argued where they differ. Literally every point you've raised people have proven false. The problem here isn't that Go has some hidden magic, it's that you've never bothered to spend even 10 seconds checking if the packages were downloaded; instead inventing some wild, made up, theories about how things might work. This lead you to make some pretty daft claims like the Go compiler can build code that doesn't exist on disk (even as a non-developer sysadmin you must realise that's a pretty stupid claim to make?)

To be honest, I wonder if you're even using Perl correctly because if you're installing CPAN modules correctly then the .pm file is stashed away in an alternative directory that's looked up via an environmental variable -- just like with Go. The Perl module shouldn't be present in your projects workspace (and actually Go makes things easier than Perl here by allowing modules to be "vendored").

Go and Perl are very similar in a great many ways:

+ Both languages order modules/packages by directory hierarchies

+ Both languages look up module/package paths via special environmental variables

+ Both have CLI tooling to download and install modules/packages

+ Both have CLI tooling to read module/package documentation

+ Both are very much command line orientated

+ Both are imperative languages who's object systems feel like a half-arsed after thought and thus both really feel more at home writing functional code than OOP.

+ Both allow functions to return multiple parameters (a trait that's not too common outside of Perl and Go)

+ Both are strictly typed, support duck typing, and have a fairly limited type system.

+ Both treat arrays/slices and hash/maps as special types where the runtime has to have special code for handling them (ie you couldn't create a custom data type like a array/slice nor hash/map using Perl/Go's own standard library).

In fact the very reason I warmed to Go was because it felt like a nice hybrid between Perl and C. This was why I was so baffled when you said Go had some hidden behaviours under the hood when in fact managing a Go project is actually very similar to managing a Perl project.

Re:The ecosystem of the Go programming language by mixedCase on Monday March 22, 2021 @01:20PM (#26543740)
Okay so you don't want to spend time learning new stuff but at the same time you don't want to be left behind.

You want a stagnant field. Sorry if I come across as too blunt, but you chose the wrong line of work if you don't like change. You'll still be able to work with the same old, boring but proven tech for the rest of your life, but face the fact that you'll be more inconvenienced by the reality you live in as time passes.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @01:31PM (#26543870)
What? I want change, I like change. I understand change and I will learn change.

However when I have more pressing matters and when I am not requiring to use Go for my day to day life I have no purpose to put further education in to it other then enough to get by with.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:47PM (#26543296)
You can import them at any time. Most people import early so that IDE's can inspect the packages (eg for completion tools etc).

Again, just like with Perl.

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:30PM (#26543062)
That's no different to importing a module in Perl. If you want to know what's in that module then you read the source of it.

> I understand all of that. Power_state, display the help, power status description etc, but prometheus.NewGaugeVec -- great. What is it? Where do I find this?

It's a function in the module `prometheus`: "github.com/prometheus/client_golang/prometheus"

It's the same thing as the following Perl code:

    use Prometheus;
    use Prometheus::Log;
    use Prometheus::Find;
    use Prometheus::View;
    use vmware::govmomi::vim25::mo;
    use mware::govmomi::vim25::types;

    my %prometheusHostPowerState
 = prometheus::NewGaugeVec(prometheus->GaugeOpts{
        "Namespace"  => $namespace,
        "Subsystem" => "host",
        "Name" => "power_state",
        "Help" => "poweredOn 1, poweredOff 2, standBy 3, other 0",
    }, @("host_name");
As you can see the code is actually really similar between the two languages in that regard. Bare in mind I'm not suggesting that the languages themselves are similar, eg how modules are created, methods written and arrays are handled are clearly different. But the concept of reusable imported modules and properties in a struct/hash are ostensibly the same.

Disclaimer: I've not written much Perl in the last 3 years so I might have gotten some of the syntax slightly wrong. But it should be close enough for demo purposes.

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:35PM (#26543146)
Then it would be fair to say I can't grasp the new-modern use of github module method then the traditional where prometheus.pm exists on disk and I can trace,trap and edit on the fly.

With the line above, prometheus::NewGaugeVec. I know it's related to the Prometheus module, NewGaurgeVec subroutine.

I'm not a programmer, I'm a systems admin who job is to take requests of such "we need a vmware exporter, I have this. Make it work".

Re:The ecosystem of the Go programming language by hnlmorg on Monday March 22, 2021 @12:44PM (#26543253)
The "new-modern use of a github module" is the same as for Perl. If a module isn't in CPAN you have to manually download and place in your project directory. Go just does this for you. And the module files in Go are on disk -- there's no way you could compile the project if half the source code wasn't on disk.

I think you'd probably have enjoyed Go more in the "old" days when $GOPATH was required and all modules were downloaded into your $GOPATH as it was more explicit were modules were and in a way it felt a little more like Perl with the file system being a more prominent part of modules. This was a very unpopular pattern for developers so things have moved on somewhat with modules now being pulled into a package directory. Personally I preferred the $GOPATH days too but it's fair to say the modules are still on disk.

Re:The ecosystem of the Go programming language by BarkMore on Monday March 22, 2021 @12:35PM (#26543137)
You do not need to go down the Github rabbit hole. The symbol prometheus is from the package github.com/prometheus/client_golang/prometheus. Use go doc github.com/prometheus/client_golang/prometheus to read the documentation from your local copy of the package. Use go list -f {{.Dir}} github.com/prometheus/client_golang/prometheus to find out where your local copy is located. If there is only one prometheus.NewGaugeVec in your workspace, then the command go doc prometheus.NewGaugeVec shows the documentation for function and reports the package where it's defined.
Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:40PM (#26543199)
Yes, it states the obvious, but I'm trying to point out what I mean. It's not always so golden as such.
Re:The ecosystem of the Go programming language by sleepybrett on Monday March 22, 2021 @12:14PM (#26542841)
godoc, same problem with any language that uses any kind of modules, you need to consult the documentation for that module. https://pkg.go.dev/github.com/prometheus/client_golang/prome... .. if fount that by googling `godoc prometheus newgaugevec` .. or you could just use `godoc`

Your argument seems to be, "I don't like reading documentation." Then by all means don't and write your own prometheus metrics module shrug

Re:The ecosystem of the Go programming language by doublerabbit on Monday March 22, 2021 @12:22PM (#26542955)
> Then by all means don't and write your own prometheus metrics module shrug

I'm a sysadmin, not a programmer. So I don't code for business operations. I compile them to make them work. I don't have time to read all the schematics of the application to make it work, but when it comes to perl, or TCL for that matter. All files are local, if my box has air-gapped and no access to github. Then what?

> Your argument seems to be, "I don't like reading documentation."

Not at all. I have limited time to spare on documentation. It's easier for me to read the code in front in practical form then it is to read documentation written on some wiki.

Re:The ecosystem of the Go programming language by BenTheElder on Monday March 22, 2021 @12:48PM (#26543304)
`go mod vendor` will populate all dependency sources into `./vendor/` in a modules project for easy grepping.

Some projects still use this to ensure sources work airgapped as well.

https://golang.org/cmd/go/#hdr-Make_vendored_copy_of_depende...

Re:The ecosystem of the Go programming language by Seb-C on Tuesday March 23, 2021 @08:02AM (#26554023)
> I'm a sysadmin, not a programmer. So I don't code for business operations. I compile them to make them work.

Sounds like you have an organizational problem, not a programming language problem.

I would expect developers to provide you with an actual application or at least automated way to build it, and you to deploy and handle the given application.

Instead you have developers providing source code and you trying to understand how to make it work.

There are plenty of tools, methods and ways to get a repeatable build process, including docker, CI, bash scripts...

Even a README file can contain a valid and repeatable build process.

Even a process called 'ask to Robert how it works' would provide you with the information you need

It's hard to imagine that this is not scripted or at least documented somewhere.

Re:The ecosystem of the Go programming language by onislandtime on Monday March 22, 2021 @06:56PM (#26548545)
To me, compared to other languages, I find Go easier for expressing my ideas in code. People seem to argue as if there was an objective truth. Different people may have different learning styles and working requirements. I'm not programming full-time so I prefer a simpler language so I don't forget. A full-time programmer may want to invest in a more "complex" language. See, you are all right.