Live data from Hacker News

Haskell is our first choice for building production software systems

foxhound.systems

261–270 of 297 posts

Re: Haskell is our first choice for building production software systems

#261

Earlier quoted context omitted.

Working with Haskell professionally sounds like a very interesting career path. Could you point to some resources to get better at the production Haskell skills that these companies are looking for? Perhaps gaining experience with projects which use Haskell in a similar way to the companies you mention could help with finding that first Haskell job.

Sure thing. I'm not sure what your current level is, but I can give some general advice for people that happen upon this: --- Haskellers are generally expected to understand most of the typeclassopedia ( https://wiki.haskell.org/Typeclassopedia ), don't worry about learning it all in one go. I had to read this page many times before I grokked most of it. --- Avoid tutorials that overuse analogies. A Monad only adds o…

That's very insightful, thank you!

Re: Haskell is our first choice for building production software systems

#262

Earlier quoted context omitted.

You seem to be lumping all side-effects together as equally bad? I don't think you can expect to push everything out to the edges, for example partiality. I take your point that a lot of imperative programming is done in Haskell (e.g. State monads). However, I think what most Haskellers mean when they talk about pushing effects to the edge, is pushing IO and other less benign effects.

>You seem to be lumping all side-effects together as equally bad? Never implied anything was bad or good. Just saying that Haskell style programming does not push side effects to the edge. >I don't think you can expect to push everything out to the edges, for example partiality. Of course you can't push everything to the edge, but haskell style programming doesn't attempt to do this. It embraces the side effects and…

> But my argument is this is not often done. I've seen tons of giant IO functions wrapped in do notation. Generally, no big attempt is made to segregate IO or side effects away from pure logic. Everyone just writes a monad and starts using do notation.

Yeah, "functional core/imperative shell" or "pushing IO to the edges" is a weird myth. Really the strength of Haskell is "functional core/IO code carefully threaded through functional core".

What's a good descriptive slogan for that? "Functional pipework/imperative reactants", invoking chemical engineering?

To cycle back to your point, I don't think the failure of this slogan actually points to any weakness in Haskell.

Re: Haskell is our first choice for building production software systems

#263
post #179

Earlier quoted context omitted.

You're asking for the impossible. What you want is precisely what templates are, but you also want them to not be "templates" for... some bizarre reason. > I can have an array of T, but I can't specify that T is Numeric? Sure you can. If you have C++20 concepts: template concept Numeric = std::integral || std::floating_point ; template T twice(T x) { return x + x; } Or if you're on a C++11 compiler: template typename…

Bah. Leave it to the latest versions of C++ to show me up.

It's not just the latest version though? C++11 could already do what you wanted.

Re: Haskell is our first choice for building production software systems

#264

Okay, so this is admittedly snarky but we've seen this sort of blog post so much that it has practically become an Onion article: Why Haskell Is Our Secret Weapon, by Startup You've Never Heard Of. And then when someone points out that nobody knows who they are or what they've built, we get commenters talking about how company X, Y, and Z are also using Haskell. And those claims also come up short...most of them can'…

> Okay, so this is admittedly snarky but we've seen this sort of blog post so much that it has practically become an Onion article: Why Haskell Is Our Secret Weapon, by Startup You've Never Heard Of.

But occasionally it pays off in a really big way.

Like WhatsApp cashing out for $19 billion, on a product they never could have scaled with so few engineers without Erlang.

Like Viaweb and Common Lisp, where Paul Graham says the language allowed them to move much faster than their competitors. One anecdote was about talking on the phone to a customer reporting a bug, and actually fixing it on the live system and asking the customer to try again, and the customer was shocked to find it now worked.

Like ITA, who created the best in class flight search system in Lisp and then sold to Google.

Every once in a while, an unpopular but powerful technology really is the secret sauce for a winning product.

Re: Haskell is our first choice for building production software systems

#265
post #262

Earlier quoted context omitted.

>You seem to be lumping all side-effects together as equally bad? Never implied anything was bad or good. Just saying that Haskell style programming does not push side effects to the edge. >I don't think you can expect to push everything out to the edges, for example partiality. Of course you can't push everything to the edge, but haskell style programming doesn't attempt to do this. It embraces the side effects and…

> But my argument is this is not often done. I've seen tons of giant IO functions wrapped in do notation. Generally, no big attempt is made to segregate IO or side effects away from pure logic. Everyone just writes a monad and starts using do notation. Yeah, "functional core/imperative shell" or "pushing IO to the edges" is a weird myth. Really the strength of Haskell is "functional core/IO code carefully threaded th…

>To cycle back to your point, I don't think the failure of this slogan actually points to any weakness in Haskell.

Yeah agreed, it's just a style of programming within the functional paradigm. Not necessarily bad or good.

Re: Haskell is our first choice for building production software systems

#266

Earlier quoted context omitted.

I've joined several companies, and getting into a Python code base was the most difficult one, because of the lack of typed method parameters. It was easier with Java and better still with Scala - same for Typescript vs. Javascript. I would be interested, is your Python experience green field or joining a large project? (just wanting to know, not implying anything on your part).

I bounced off of Python a few times before finally taking to it (at a time when I had no choice). I honestly believe that this situation has improved since Python 3.5 or so, purely on the basis of improved standards of documentation, including many more libraries adding type hints to their public interfaces. I've recently been back to Clojure, and it's the same old aggravation again. It seems that, oftentimes, the on…

I don't want to come across as being too down on dynamic typing - I'm currently in the process of trying to get my company over to Python by any means necessary.

Curious, from what and why? ML?

Re: Haskell is our first choice for building production software systems

#267

> Many programmers encounter statically typed languages like Java or C++ and find that the compiler feels like an annoyance. By contrast, Haskell’s static type system, in conjunction with compile-type time checking, acts as an invaluable pair-programming buddy that gives instantaneous feedback during development. the reason they "find that the compiler feels like an annoyance" is because their first exposure to Java…

Strong point! As a non-CS engineering student learning C++ for the first time, the compiler all but turned me off from wanting to be a programmer. No one explained why the compiler was even there, it just seemed like an annoying hindrance stopping me from getting good grades on the homework.

Fast forward a decade and I'm evangelizing statically typed FP at conferences. The value of the compiler is redeemed after self-teaching and learning the "Whys".

Re: Haskell is our first choice for building production software systems

#268
post #104

Earlier quoted context omitted.

Not only do modern compilers give better error messages (with room for improvement still), it is possible to make use of enable_if and if constexpr/static_assert to give proper error messages for templates, and when C++20 gets widespread enough, concepts.

I personally call it "old school" vs "new school". "Old school" is asically the programming languages that originated in the 70s-80-90s. An incorrect but an illustrative way to describe error messages for them is "The programmer needs to suffer". They are any combination of cryptic, terse, complex, exposing internal machinery of the compilers and linkers etc. There are many reasons for this: computers were not powerf…

Some of it caused by too much reliance on tools like yacc.

Category grammars were much better but more resource demanding, just like proper ASTs instead compiling as one goes.

Ironically there were already some attempts to Smalltalk like tooling for C++ back then, but again as you mention too much resource constraints.

Re: Haskell is our first choice for building production software systems

#269
post #260
post #82

Earlier quoted context omitted.

if it has side-effects, it has to be something like Int -> Int -> IO Bool otherwise the type checker won't let you perform any side-effecting operations (btw Haskell's `IO Bool` would be spelled `IO ` in C++/Java syntax)

But is _just reading_ from a database a "side-effect"? It is non-deterministic, but it has no side-effects. So IO jumbles together the two notions.

pedantically, talking to the database will involve sending a request or some kind of IPC, all of which are usually considered side effects.

[handwavy analogy alert]

people often call it "side-effects" as a shorthand. in reality an expression being of type `IO Foo` mostly just tells the compiler that order of execution matters (which isn't the case with pure functions):

  do print "a"
     print "b"
 
  -- obviously not the same as
  
  do print "b"
     print "a"
and also that it can't eliminate common expressions:

  do a 
it's a way of enforcing ordering in a lazy language where evaluation order isn't really defined.

Re: Haskell is our first choice for building production software systems

#270

Earlier quoted context omitted.

You're asking for the impossible. What you want is precisely what templates are, but you also want them to not be "templates" for... some bizarre reason. > I can have an array of T, but I can't specify that T is Numeric? Sure you can. If you have C++20 concepts: template concept Numeric = std::integral || std::floating_point ; template T twice(T x) { return x + x; } Or if you're on a C++11 compiler: template typename…

the C++ 20 version can be simplified a bit to: Numeric auto twice(Numeric auto x) { return x + x; }

Probably not a good idea since the caller won't know what the return type is at that point, and the return type would become dependent on the implementation, which breaks function abstraction.

And imagine what would happen when you get a few more 'auto' variables in the return expression. Suddenly your return type will depend on the implementation of your callees. And the code can then quickly become impossible to understand.

auto is overused.

Post reply on HN