Hacker News new | ask | show | jobs
by cheepin 3813 days ago
> With: Everything.

This may be nitpicking but certain classes of programs cannot be realistically built with Haskell. Anytime you need to tightly control latency (soft realtime) won't really work since you have both a garbage collector and lazy evaluation. Memory constrained systems are pretty tough as well since you don't really get insight into allocation/deallocation, which also makes structuring your data into a particular memory layout tricky compared to C(++) for instance.

Not to say that Haskell isn't awesome. It should probably be used for more systems. It just can't be the "hammer" to make every problem into a nail.

2 comments

This depends on what you mean by "with". As you say, you can't sit down, bang out some ordinary Haskell code, and expect GHC to give you an executable that will do real-time as well as you can in C.

That said, it's perfectly possible to write a DSL that handles scheduling, uses GHC's type machinery to track memory use and execution time, and have GHC generate a program that will generate C code that meets hard real-time guarantees. In fact, someone wrote it, it's available on hackage (https://hackage.haskell.org/package/atom) and my understanding is that it's used in production for control software in the auto industry.

Yes, that's a good point of clarification, one that the Ivory or Atom DSL is trying to tackle though.