Functional programming and fine-grain multithreading for high-performance parallel computing