News for hackers. Stuff that matters.
Re:Three Months of Go, from a Haskeller’s perspective (2016) by amelius on Sunday March 19, 2017 @09:27AM (#13906901)
> GHC’s garbage collector is designed for throughput, not latency. It is a generational copying collector, which means that pause times are proportional to the amount of live data in the heap. To make matters worse, it’s also stop-the-world.

This is pretty much unacceptable in today's world of low-latency (web) apps.

How active is GHC's development?

Would it be possible to efficiently run Haskell using Go's runtime environment, i.e. by changing the compiler backend?

Re:Three Months of Go, from a Haskeller’s perspective (2016) by thesz on Sunday March 19, 2017 @09:40AM (#13906989)
If you have not too much data in the heap, you are safe. Even if you have a lot of data there, you most probably fine too.

As an example, see here: https://bazqux.com/ and the discussion is here: https://news.ycombinator.com/item?id=5961570

He was able to survive unexpected slashdot effect from being on the front page of Hacker news without even noticing it. He told me he went up one evening and found that there were tens of thousands of new users actively trying his site. So he added a couple of servers and went to sleep.

GHC development is very active.

And the answer to your last question is No.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by amelius on Sunday March 19, 2017 @09:48AM (#13907038)
Okay, but surviving a Slashdot effect is different from having a low-latency server of course :)
Re:Three Months of Go, from a Haskeller’s perspective (2016) by thesz on Wednesday March 22, 2017 @09:02AM (#13930531)
He didn't tell me that anyone complained about delays, etc.

I think delays weren't that noticeable then.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by willsewell on Sunday March 19, 2017 @06:26PM (#13910053)
> How active is GHC's development?

There are two active areas of development which could solve this problem (long pause times with a large working set):

* Compact regions -- which will provide off-heap storage that can be manually memory managed. These are shipping with GHC 8.2. See the paper here if you're interested: http://ezyang.com/compact.html

* Linear types -- A type system extension which allows the programmer to specify values which can only be used a single time. This allows a king of type-safe manual memory management where the compiler statically check that values are freed. This work is further off, but there is currently a prototype being developed in GHC. Check out this blog post for more information: http://blog.tweag.io/posts/2017-03-13-linear-types.html

> Would it be possible to efficiently run Haskell using Go's runtime environment, i.e. by changing the compiler backend?

It's an interesting thought, although I suspect this would be very challenging in practice. Haskell's lazy evaluation, with thunks instead of concrete values, probably wouldn't play nicely with Go's heap layout. I would also suspect Go's runtime has been quite special-cased to Go the language. It would nice if the Go runtime system was opened up in the same way the JVM is.

At this point it might be simpler to translate Haskell source syntax into Go.

My overall feeling is that putting more work into the standard GHC runtime system would be a more efficient use of time.

Re:Three Months of Go, from a Haskeller’s perspective (2016) by ruslan_talpa on Sunday March 19, 2017 @02:23PM (#13908760)
I think you are under the wrong impression about the performance/speed of the Haskell with it's GC when used in the web context. http://www.aosabook.org/en/posa/warp.html