Haskell IDE The Memory Hog Engine

Momentarily, the Haskell IDE Engine (HIE) is in a bad shape. In its version 0.2.2, it eats a huge amount of memory, much more than my machine can provide (I have 8 GB in total). Users have already reported this, and even though there is a memory leak in GHC, Haskell IDE Engine developers haven’t started tackling this problem yet. What you can do in the meantime is to provide runtime system (RTS) options to an engine executable to limit its heap and stack memory sizes. For example, you can write a wrapper script around the hie executable that would run it with the following RTS options:

hie +RTS -c -M1500M -K1G -A16M -RTS --lsp $@

This limits the heap size to 1500 MB and the stack size to 1 GB. The executable will crash once it surpasses these limits, but your editor (e.g., Atom) should restart it. In other words, HIE will keep on crashing and restarting in a loop, which is ugly, but that’s what we have now.

Haskell Library Demonstrating Dependent Types in eDSL

Haskell Servant’s logo

In Haskell, servant is a library for declaring web APIs. What is interesting about the library is that it utilises the power of Haskell’s type system, in particular the power of dependent types in computing a return type of a function.

Continue reading

Gave a Talk on Types in Programming

Courtesy of Ivica Dimjašević

As announced, I gave a talk last Tuesday at Mama, Zagreb on the role of types in programming as part of the Lamda Zagreb Meetup group. I enjoyed giving the talk and discussing types and programming in general after the talk over a beer. Later on we had a follow-up discussion in the comments section on the event page, which made me happy to see what can be done in Haskell.

Continue reading