Live data from Hacker News

I learned Haskell in just 15 years

duckrabbit.tech

231–240 of 240 posts

Re: I learned Haskell in just 15 years

#231

Earlier quoted context omitted.

This is not really what maintainability means to me. To me, it just means you have a good memory. To be able to maintain something you need to be able to transfer the ownership of the piece of code to someone else. You need to be able to amend the code easily to extend or to remove functionality. It means that the code can be easily split into pieces that can be given to multiple developers to work simultaneously tow…

> To be able to maintain something you need to be able to transfer the ownership of the piece of code to someone else. You need to be able to amend the code easily to extend or to remove functionality. It means that the code can be easily split into pieces that can be given to multiple developers to work simultaneously towards a common goal. > Haskell scores poorly on any of those points Interesting. I work at a comp…

I worked for a company that had a product with several million lines of C, couple hundreds of lines of Java, same for Go, Ruby and Python.

And it worked great! And you know why? -- The programmers were skilled at what they were doing. There were about 60 employees in total, and they managed a relatively big codebase for a complicated product (distributed filesystem). Btw, our build system was written in Haskell.

And why do I mention this? -- because I also worked in many other companies, who used all the same languages, typically for much smaller codebases compared to the number of people working on them. And the effects were usually awful.

In conclusion: the choice of language doesn't define the outcome. You may be successful choosing a bad language if you hire good programmers and other stars align to make it happen. You can also easily fail if you use a good language, but other, more important conditions don't hold.

Your individual success is at best an indication that it's possible to use Haskell to achieve your goals. It doesn't mean it's a good tool. You didn't even try to have a test that'd compare Haskell to other languages, you don't have any explanation for why Haskell is good for your case. It just worked "somehow".

What I say, I saw from a more general perspective, and with some justification. But if you need examples rather than justification: at one point in the past, Japanese high-schools used Haskell to teach computer science. I was able to compare the experience to Basic and Pascal which I experienced personally. In the hands of a mediocre-bad programmer Haskell is an awful tool and produces far worse results than Basic or Pascal. And, surprise, most programmers in the world are mediocre-bad. You cannot take your example and extrapolate from it that if everyone used Haskell software would've been better. In fact, there's every indication it wouldn't. In most likelyhood it'd be a lot worse.

Re: I learned Haskell in just 15 years

#232

Earlier quoted context omitted.

You don't need to know the author personally to appreciate the result of their work... > Gosh, what am I doing with my life? I would ask the same question, but unironically. No, you didn't make up those programs of course. I didn't claim that real-world programs are impossible to write in Haskell. I claimed that Haskell is a bad tool for writing real-world programs. People make sub-optimal decisions all the time. Tha…

I think we can drop the "real-world," qualifier as it is unlikely there is an "imaginary-world" that we write programs for. What engineering merits did you have in mind?

Real world in this contexts contrasts the world of programs that nobody needs or uses. Programs that are written for amusement or with no stringent requirements.

Re: I learned Haskell in just 15 years

#233

"It’s quite natural to program in Haskell by building a declarative model of your domain data, writing pure functions over that data, and interacting with the real world at the program’s boundaries. That’s my favorite way to work, Haskell or not." Are there any good resources you can share to learn this specific way of programming?

https://pragprog.com/titles/swdddf/domain-modeling-made-func..., even though it's F# rather than Haskell. And maybe https://leanpub.com/algebra-driven-design depending on the exact use case.

Re: I learned Haskell in just 15 years

#234
post #202

Earlier quoted context omitted.

> I mean, how else would you call the arguments of > splitAt :: Eq a => a -> [a] -> [[a]] Those don't seem to be names of parameters, but rather of types. It's missing parameter names entirely. I spent a good 2 minutes looking at that signature trying to figure it out (and I've read some Haskell tutorials so I'm at least familiar with the syntax). This would've helped: def split_by (separator: T, list: List[T]) -> Li…

> Those don't seem to be names of parameters, but rather of types. It's missing parameter names entirely. The rest of the definition is at the end, to see it as a whole: splitAt :: Eq a => a -> [a] -> [[a]] splitAt x xs = ... To clarify, I assumed that by using the constraint `Eq a` and the name splitAt there was no need for extra clarification in the names of the parameters but apparently I was wrong.

I think some of the confusion is because you're referring to the type variables as parameters. Parameters and type variables are not the same thing. A is a type variable, X is a parameter in your example.

Re: I learned Haskell in just 15 years

#235

Earlier quoted context omitted.

It is pure in the same way that Rust is memory safe. That is too say there are a tiny number of exceptions/escape hatches, but they are not meant to be the norm. Every day programming doesn't involve them. Exceptions aren't impure anyway.

Exceptions define an effect. Code with exceptions aren't actually pure in the sense that their return type doesn't fully describe what the code does, so it doesn't just map an input into an output: there is something else going on In some pure functional languages, the pure fragment doesn't have exceptions, and you add exceptions as an effect (or as a monad) (If you reify the effect with a type like Either or Result,…

> in the sense that their return type doesn't fully describe what the code does

Sure they do, at least in Haskell. Bottom inhabits all types.

Re: I learned Haskell in just 15 years

#236
post #226
post #125

Earlier quoted context omitted.

An execution pipeline in a functional language is just half a relation in Prolog. Prolog allows you to also run it 'backwards', you can provide the output and have it figure out what the inputs would need to be.

How would this work with the XOR operator? Would it give all possible inputs?

Would depend on the implementation, I think. You could probably write one like that, but as usual there will be trade-offs. I suspect it would also matter if you're targeting booleans or numbers.

The typical, obvious case how these things work in Prolog is in list concatenation. If you only supply variables it'll start outputting lists of increasing length with placeholder variables. It's a somewhat simple engine for traversing a problem space and testing constraints that uses backtracking to step through it. Some implementations allow you to explicitly change the search strategy.

Re: I learned Haskell in just 15 years

#237

Earlier quoted context omitted.

> To be able to maintain something you need to be able to transfer the ownership of the piece of code to someone else. You need to be able to amend the code easily to extend or to remove functionality. It means that the code can be easily split into pieces that can be given to multiple developers to work simultaneously towards a common goal. > Haskell scores poorly on any of those points Interesting. I work at a comp…

I worked for a company that had a product with several million lines of C, couple hundreds of lines of Java, same for Go, Ruby and Python. And it worked great! And you know why? -- The programmers were skilled at what they were doing. There were about 60 employees in total, and they managed a relatively big codebase for a complicated product (distributed filesystem). Btw, our build system was written in Haskell. And…

I’ve been in this industry for over twenty years. I’ve written a fair share of code in other languages. There’s not enough empirical evidence to suggest that one language is better than any other.

My example is only a counter argument that Haskell isn’t suitable because of the reasons you stated. Clearly it can be maintained, work can be split among groups, and delivered with reasonable efficiency… like a lot of software can be in other languages.

Re: I learned Haskell in just 15 years

#238

Earlier quoted context omitted.

Exceptions define an effect. Code with exceptions aren't actually pure in the sense that their return type doesn't fully describe what the code does, so it doesn't just map an input into an output: there is something else going on In some pure functional languages, the pure fragment doesn't have exceptions, and you add exceptions as an effect (or as a monad) (If you reify the effect with a type like Either or Result,…

> in the sense that their return type doesn't fully describe what the code does Sure they do, at least in Haskell. Bottom inhabits all types.

There's a difference between "doesn't return because it has an infinite loop" and "doesn't return because it threw an exception"

Haskell can't express the difference, but languages with effects, like Koka and F*, can!

The first effect is called div in Koka and the second is called exn, section 2.2 here

https://www.microsoft.com/en-us/research/wp-content/uploads/...

Re: I learned Haskell in just 15 years

#239

Earlier quoted context omitted.

> in the sense that their return type doesn't fully describe what the code does Sure they do, at least in Haskell. Bottom inhabits all types.

There's a difference between "doesn't return because it has an infinite loop" and "doesn't return because it threw an exception" Haskell can't express the difference, but languages with effects, like Koka and F*, can! The first effect is called div in Koka and the second is called exn, section 2.2 here https://www.microsoft.com/en-us/research/wp-content/uploads/...

It's fine if the poster above me wishes to change languages. Anyone who chooses to stick with Haskell should get comfortable with the notion that functions can diverge, and accept that this is fully consistent with the Haskell type system. The return types may seem unhelpful, but they are accurate.

Re: I learned Haskell in just 15 years

#240
post #110

Earlier quoted context omitted.

Pandoc is the standard for markdown conversion. Check out the comments in this recent thread (or pretty much any thread where markdown is mentioned): https://news.ycombinator.com/item?id=40695628 https://hn.algolia.com/?q=markdown

I don't think markdown conversion is a mass market application, but maybe personally I will indeed use it soon, so that would be something I guess ..

You originally asked about a program that you use (or would use?) written in Haskell. Someone brought up Pandoc, the swiss army knife of Markdown and similar formats, and every programmer uses Markdown in some capacity. Then you chose to fixate on the phrase “mass market” software, as if that was relevant to your original claim: a program that a programmer would use.

Which demonstrates my point. Someone with this attitude has already dug their heels in and made up their mind.

Post reply on HN