News for hackers. Stuff that matters.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by noir_lord on Sunday March 19, 2017 @09:55AM (#13907078)
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).

Re:Three Months of Go, from a Haskeller’s perspective (2016) by coldtea on Sunday March 19, 2017 @10:30AM (#13907264)
>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) by fauigerzigerk on Sunday March 19, 2017 @01:28PM (#13908427)
The problem with "too clever" isn't just about cleverness that is actually in the code. It's also very much about cleverness that could potentially lurk behind any particular syntactical expression.

When you look at a line of code, what can you tell about its semantics without considering non-local information? What is invariant and what could potentially be redefined?

I think the answer to this question is extremely important for readability when you're not already familiar with a codebase.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by didibus on Sunday March 19, 2017 @01:51PM (#13908578)
That's a great call out, though I see this in most languages, Haskell and go equally have implicit non local behaviours, but I find the functional paradigm tend to have less, because of side effect free functions.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by lilactown on Sunday March 19, 2017 @04:42PM (#13909497)
I find laziness (coming from more imperative, non-lazy languages) to be a huge source of implicit non-local behavior. Trying to figure out how efficient my code is without specific knowledge of how certain functions in the standard library work/how the compiler interprets my code is a impossible.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by didibus on Monday March 20, 2017 @01:17AM (#13911912)
You're right, the execution context is non local. I'm actually not a big fan of laziness as the default myself. I love the option of lazy evaluation, because sometimes, it makes things really easy, like for infinite sequences, but most of the time, it does add complexity in reasoning about the code.

There's functional alternatives to Haskell which adopt the non-lazy as default, such as Elm, Rust, SML, Lisps, Fantom, Elixir, Scala, etc.

I have to admit though, this is a bit of a trade off situation. Working with pure functions is very simple, but to map those to unpure behavior, like IO, you need something that isolate that, and without laziness, I'm not sure how you can get that to be practical.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by fauigerzigerk on Sunday March 19, 2017 @02:22PM (#13908758)
I'm not yet familiar enough with Haskell to be honest, but languages like Scala, C++ (to the extreme) and to a lesser degree C# and Swift have a lot more support for non local redefinition of syntactic expressions than Go.

I totally agree with you about pure functions. They can be a real simplification, but only if any deviation from purity requires special syntax at the call site. Otherwise you're back in the guessing game.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by chongli on Sunday March 19, 2017 @07:54PM (#13910600)
but only if any deviation from purity requires special syntax at the call site.

Haskell makes it easy to write data and function types that enforce purity at the call site, throwing a type error if you make a mistake. Not just purity though, you can restrict these types to any arbitrary set of methods of your choosing. This lets you do things like parsing a blob of JSON and having all functions that depend on the result be guaranteed not to have to deal with a failed parse or otherwise invalid data. The fact that the data is good has been encoded in the types, preventing you from passing bad data by throwing a type error.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by tel on Sunday March 19, 2017 @04:32PM (#13909447)
> special syntax at the call site

Definitely Haskell's game then

Re:Three Months of Go, from a Haskeller’s perspective (2016) by canes123456 on Sunday March 19, 2017 @10:59AM (#13907424)
No one is arguing to roll your own when there a generic sort in the standard library. The issue with clever things is that people try to make a all purpose solution for what could be a simple one off solution. The all purpose is only used for 2-3 uses and it never battle tested.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by unscaled on Sunday March 19, 2017 @11:14AM (#13907547)
Clever things like a sort function that can sort both ints and floats and any new type that implements a comparison function?
Re:Three Months of Go, from a Haskeller’s perspective (2016) by voutasaurus on Sunday March 19, 2017 @01:34PM (#13908469)
Re:Three Months of Go, from a Haskeller’s perspective (2016) by canes123456 on Sunday March 19, 2017 @12:29PM (#13908032)
I am not arguing for Go. I am arguing that there is an issue with some complex languages. Go is trying to avoid that issue. I agree that the issue is real but also think go takes it a little too far.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by daxfohl on Sunday March 19, 2017 @12:17PM (#13907954)
Or a quicksort in constant memory.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by coldtea on Sunday March 19, 2017 @12:53PM (#13908181)
Haskell, if that's where the sneer is addressed to, absolutely gives you that.

It's just toy first-timer Haskell examples of quicksort (that still work, mind you) that don't.

But then again, take a language like C, and consider how many things (like proper error handling) are missing from 99% of the toy tutorial examples available.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by didibus on Sunday March 19, 2017 @01:54PM (#13908591)
I feel like you are arguing against Java, not against Haskell.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by ruslan_talpa on Sunday March 19, 2017 @12:11PM (#13907919)
If by clever things you mean "pointfree" all over the place then i agree but if you mean "abstractions" in general then that's a different thing and this says it best.

“The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise.”

~ Edsger Dijkstra

I think i can honestly say i did not fully get that quote until i learned Haskell

Re:Three Months of Go, from a Haskeller’s perspective (2016) by didibus on Sunday March 19, 2017 @01:56PM (#13908610)
Great quote. I think if people think of level of abstraction it makes more sense. All code is an abstract representation, but to solve a problem, it's easier to work within an abstraction level that fits the problem.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by tazjin on Sunday March 19, 2017 @10:08AM (#13907147)
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) by ajmurmann on Sunday March 19, 2017 @10:39AM (#13907331)
I think it depends what type of "power" we are talking about. Ruby's meta programming stuff certainly falls into the problematic area. A powerful type system might be seen as quite the opposite because it can make code more predictable.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by crimsonalucard on Sunday March 19, 2017 @12:47PM (#13908138)
Powerful languages do clever things under the hood so you don't have to(TM). All programmers use this same abstraction so there is no confusion.

Less powerful languages force the programmer to come up with their own clever abstractions so that if you have multiple programmers you'll end up with 20 different clever ways of doing the same thing.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by julian_1 on Sunday March 19, 2017 @05:16PM (#13909689)
I hate "clever things" as well, but it's worth being precise about what constitutes cleverness in different languages.

Dynamic languages - ruby, python, bash, objective C etc - allow all sorts of cleverness - such as monkey patching, attribute injection, dynamic lookup - because of their dynamic runtime. All the checks about whether the code makes sense is performed at runtime.

Languages with more mature/strong/static typesystems are initially restrictive - but the emphasis in cleverness is to be able to know upfront - and at compile time - if the code expressed is consistent in the way data and effects are represented and expressed.

Of course - there are other kinds of code complexity -in terms of ease of understanding, and maintainability - that will always involve tradeoffs considering the task at hand and nature of the programming environment (solo, community, commercial, academic etc).

Re:Three Months of Go, from a Haskeller’s perspective (2016) by avisser on Sunday March 19, 2017 @10:09AM (#13907149)
This is 100% my recollection of my 2 months of Scala.