How can a Windows service application be written in Haskell?

I admit, this problem has been vexing me for some days now. From walking the return values and the contents of GetLastError, I’ve determined that this code should be working correctly according to the system. Because it clearly isn’t (it seems to enter an undefined state that inhibits the service handler from running successfully), I’ve … Read more

Calling Haskell from C#

As far as both languages are concerned, you can basically pretend you’re trying to interface with C code. This is a complex topic, so rather than try to explain all of it, I will focus on making a simple example that you can build on using the resources linked below. First, you need to write … Read more

Calling Haskell from C++ code

To anyone interested, this is the test case that I’ve finally got working: M.hs module Foo where foreign export ccall foo :: Int -> Int foo :: Int -> Int foo = floor . sqrt . fromIntegral test.cpp #include <iostream> #include “M_stub.h” int main(int argc, char *argv[]) { std::cout << “hello\n”; hs_init(&argc, &argv); std::cout << … Read more

Python: SWIG vs ctypes

I have a rich experience of using swig. SWIG claims that it is a rapid solution for wrapping things. But in real life… Cons: SWIG is developed to be general, for everyone and for 20+ languages. Generally, it leads to drawbacks: – needs configuration (SWIG .i templates), sometimes it is tricky, – lack of treatment … Read more