News for hackers. Stuff that matters.
Re:If Haskell is so great, why hasn't it taken over the worl... by jeffdavis on Sunday May 20, 2018 @05:27PM (#17114829)
Let's say you write the best image decoder library for the next great image format, and everyone wants it on every device that is connected to the internet.

Writing it in haskell would mean that only haskell users, or people willing to link in a large runtime, could use it.

So, you write it in C or Rust, so anyone can link it in and not care what it was written in. Maybe also write a native Java version, because that can already run on billions of devices.

Re:If Haskell is so great, why hasn't it taken over the worl... by galaxyLogic on Sunday May 20, 2018 @05:32PM (#17114854)
Makes a lot of sense. Haskell comes with baggage and has an impedance-mismatch with other commonly used languages.

Similar reasons must have been to blame for the demise of Smalltalk. The best solution of its time many believe, but not easy to integrate with other languages and other ways of doing things.

Also let me add it was difficult to create small Smalltalk programs that wouldn't require most of the base-library to be tagged along. Then you couldn't import it to another environment where the base libraries were somewhat different.

Re:If Haskell is so great, why hasn't it taken over the worl... by WalterBright on Sunday May 20, 2018 @06:15PM (#17115045)
D can also link to only the C runtime library.
Re:If Haskell is so great, why hasn't it taken over the worl... by vapourismo on Sunday May 20, 2018 @05:40PM (#17114904)
GHC can produce native libraries just like C or Rust.
Re:If Haskell is so great, why hasn't it taken over the worl... by reikonomusha on Sunday May 20, 2018 @05:45PM (#17114925)
But you carry around a runtime with managed objects that can’t be freely traded across the boundary to C libraries.
Re:If Haskell is so great, why hasn't it taken over the worl... by vapourismo on Sunday May 20, 2018 @05:53PM (#17114961)
Certainly it isn't the most attractive solution - still it is possible and works well.

When it comes to moving things across FFI barrier, that is also very possible as there are all kinds of types (including stable pointers) in the Foreign.* modules that map onto C types.

Re:If Haskell is so great, why hasn't it taken over the worl... by wtetzner on Sunday May 20, 2018 @05:46PM (#17114933)
But you have to link in the runtime, including the garbage collector.
Re:If Haskell is so great, why hasn't it taken over the worl... by vapourismo on Sunday May 20, 2018 @05:54PM (#17114968)
I don't see how that is a big problem.
Re:If Haskell is so great, why hasn't it taken over the worl... by jeffdavis on Sunday May 20, 2018 @06:17PM (#17115056)
It's a larger footprint, possibly drains battery when you don't expect, may mess with signal handlers and other global state.

And it does not really scale to many libraries. What happens when eveyone thinks theor language is best and wants to link in a big runtime? You need 30 different runtimes for 30 libraries? Ouch.

And if not careful about versioning, you could end up with symbol conflicts, etc.

All these problems can be overcome, but are just not acceptable if you want to be a ubiquitous library like libjpeg. Needs to be super simple from a runtime perspective.

Re:If Haskell is so great, why hasn't it taken over the worl... by wtetzner on Monday May 21, 2018 @10:44PM (#17123394)
Not to mention trying to get different garbage collectors to play nicely together.