If you think signal handling in C sucks, try Lua