Live data from Hacker News

Three Months of Go, from a Haskeller’s perspective (2016)

barrucadu.co.uk

111–120 of 363 posts

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#111
post #8

It is, I think, going to be very difficult to enjoy writing code in a less powerful language when you are exposed to languages that hold awesome power. In fact, this has been the basis for much writing on Lisp too. Paul Graham has written entire essays along the same lines. If you work in a job that forces the use of a less powerful language than what you've been exposed to, you can, I think, go through a sort of dep…

I prefer less powerful languages (that have sufficient power to clearly express the domain). I've found that "powerful" languages allow me to do clever things(TM) and I hate clever things(TM) retroactively when I come back to them. This gets even worse when you have multiple people on the team doing clever things(TM).

Agreed, but I'd take this into a different direction and argue that code generation - as it is often practiced in Go - is a Clever Thing (TM).

A language like Haskell lets me write extremely complicated code, but it also lets me concisely express the constraints I want in the form of types without getting too verbose. Go lets me do neither.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#112
post #8

It is, I think, going to be very difficult to enjoy writing code in a less powerful language when you are exposed to languages that hold awesome power. In fact, this has been the basis for much writing on Lisp too. Paul Graham has written entire essays along the same lines. If you work in a job that forces the use of a less powerful language than what you've been exposed to, you can, I think, go through a sort of dep…

I prefer less powerful languages (that have sufficient power to clearly express the domain). I've found that "powerful" languages allow me to do clever things(TM) and I hate clever things(TM) retroactively when I come back to them. This gets even worse when you have multiple people on the team doing clever things(TM).

This is 100% my recollection of my 2 months of Scala.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#113

Earlier quoted context omitted.

You know, I think, maybe it's not a coincidence that almost all high-scale infrastructure tooling is written in Go nowadays.

Almost all high-scale infrastructure tooling? Are there many databases, parallelism frameworks, indexing systems, or machine learning frameworks in go? I’d be interested if you can name any fields where non-Google go projects dominate. I only know of containers.

Service Discovery and configuration (Consul, etcd), Monitoring (Prometheus and Influx), non-container cluster management (Nomad), databases (CockroachDB), messaging (NATS, Jocko), Terraform. Other than that, I think everybody noticed the frequent posts "xxx database written in Go". Also, most high scale computing companies now use Go for their infrastructure parts.

EDIT: You can also check out all the stuff the CoreOS team puts out.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#114
post #65

Earlier quoted context omitted.

I mean that you will need to write more, and more duplicate code, to express the same, it’ll be less clear, and less safe. Generics, and annotation processing with code generation integrated in the compiler, are two example features supported by Java that improve this. Haskell obviously is a lot better even. Additionally, it’s also a question if, in the language, any state of the program is immediately obvious from t…

Very little people who have tried errors by value or Either monads (they are basically the same concept in some sense) think that exceptions are better. Exceptions cause your code to be non-linear. Also, it makes them seem like something exceptional (pun intended), whereas you should really carefully handle each error and decide what it implies. Also, just something I noticed after almost two years of Go. Thanks to l…

Go does not have Either monads, or real errors by value. It has a multi-assignment syntax similar to tuple return, but nothing else.

For Java, with a tiny library, you can have real Either monads: https://github.com/spencerwi/Either.java

I use them in lots of code.

For Go, you end up with an assignment syntax where you have to manually check, and get no compiler safety. At all.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#115

Earlier quoted context omitted.

Almost all high-scale infrastructure tooling? Are there many databases, parallelism frameworks, indexing systems, or machine learning frameworks in go? I’d be interested if you can name any fields where non-Google go projects dominate. I only know of containers.

Service Discovery and configuration (Consul, etcd), Monitoring (Prometheus and Influx), non-container cluster management (Nomad), databases (CockroachDB), messaging (NATS, Jocko), Terraform. Other than that, I think everybody noticed the frequent posts "xxx database written in Go". Also, most high scale computing companies now use Go for their infrastructure parts. EDIT: You can also check out all the stuff the CoreO…

I’ve actually never used any of them, and none of the devs or ops people I usually talk to used them either.

We never even heard of any of those except for CockroachDB.

Are you sure these are "dominating the entire industry"-products, as you mentioned before? Or is it more that they’re only used in SV?

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#116
post #2

I hate to sound like the rust evangelist strike force... I really do. But your complaints are exactly what it would solve... Sigh I hate to say this I really do. But here goes... So have you checked out rust?

> I hate to sound like the rust evangelist strike force... I really do. But your complaints are exactly what it would solve...

Rust doesn't have lazy evaluation, or a particularly extensive standard library. I'm not aware that Rust has heap or thread profiling any better than Go's.

For everything else, though, yes. I found Rust pretty easy to learn (coming from Java with a bit of Python background); i haven't mastered lifetimes or coherence, but i manage my day-to-day work without needing to. No GC means no GC pauses, and if there are big slow drop cascades, they are at least confined to one thread. Rustfmt seems to be mostly reasonable. Library versioning is done properly. The type system provides generics, sum types, and strong, if unconventional, control over side effects. Godoc uses source order and Markdown. Struct fields have to be initialized. Boilerplate is minimal; in particular, checking errors is one character, and sorting detects and uses an existing. ordering, or takes a single function to define one.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#117

Earlier quoted context omitted.

Very little people who have tried errors by value or Either monads (they are basically the same concept in some sense) think that exceptions are better. Exceptions cause your code to be non-linear. Also, it makes them seem like something exceptional (pun intended), whereas you should really carefully handle each error and decide what it implies. Also, just something I noticed after almost two years of Go. Thanks to l…

Go does not have Either monads, or real errors by value. It has a multi-assignment syntax similar to tuple return, but nothing else. For Java, with a tiny library, you can have real Either monads: https://github.com/spencerwi/Either.java I use them in lots of code. For Go, you end up with an assignment syntax where you have to manually check, and get no compiler safety. At all.

You do have errors by value. You return for example two values, the response and error.

What do you mean with no compiler safety exactly?

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#118
post #8

It is, I think, going to be very difficult to enjoy writing code in a less powerful language when you are exposed to languages that hold awesome power. In fact, this has been the basis for much writing on Lisp too. Paul Graham has written entire essays along the same lines. If you work in a job that forces the use of a less powerful language than what you've been exposed to, you can, I think, go through a sort of dep…

I prefer less powerful languages (that have sufficient power to clearly express the domain). I've found that "powerful" languages allow me to do clever things(TM) and I hate clever things(TM) retroactively when I come back to them. This gets even worse when you have multiple people on the team doing clever things(TM).

>I've found that "powerful" languages allow me to do clever things(TM) and I hate clever things(TM) retroactively when I come back to them.

They also allow you to do sensible things(TM) like use the one and single, battle tested, standard library's generic sort, btree, etc implementation, instead of having to roll (and then read) 1000s of your own over the span of a year...

And it's a false dichotomy that you can't have the sensible things(TM) without the too-clever-for-their-own-good-things (TM) you allude too.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#119

Earlier quoted context omitted.

Service Discovery and configuration (Consul, etcd), Monitoring (Prometheus and Influx), non-container cluster management (Nomad), databases (CockroachDB), messaging (NATS, Jocko), Terraform. Other than that, I think everybody noticed the frequent posts "xxx database written in Go". Also, most high scale computing companies now use Go for their infrastructure parts. EDIT: You can also check out all the stuff the CoreO…

I’ve actually never used any of them, and none of the devs or ops people I usually talk to used them either. We never even heard of any of those except for CockroachDB. Are you sure these are "dominating the entire industry"-products, as you mentioned before? Or is it more that they’re only used in SV?

Totally not, I'm working in Poland. And, I'm sorry to say, if you haven't heard about Consul, then you're really not in a position to judge if infrastructure tools are or aren't written in Go. Consul is the de'facto industry standard for service discovery for a few years already.

EDIT: Cockroach is actually the most SV'ish of all those.

Re: Three Months of Go, from a Haskeller’s perspective (2016)

#120
post #82
post #79

Earlier quoted context omitted.

Counterpoint: Programmers don't choose the best language, they choose the language they are comfortable using. Source: at a previous job we had a "use whatever tool you want, just get the job done" policy. After two years we had everything from Perl to JavaScript in the same project. Edit: ... and this project was a desktop application!

This is true, from my experience. When I'm screening candidates, I often ask them to solve a problem in their language of choice. They choose PHP, even though I know the same problem solution can be expressed far clearer and shorter in Ruby. Perhaps we are unearthing various kinds of choices i.e choices for best fit vs best convenience. Perhaps that's a case of engineering vs something other.

Despite its checkered past, isn't php these days a more powerful language than ruby?
Post reply on HN