I think it depends on the problem space. One of the hard things about functional programming languages is that most of them are garbage collected, which is a gigantic limitation on performance for some use cases. If you are really trying to optimize and push the limits of the graphics, you really need to avoid garbage collection and heap allocations in general, at least in that part of the code.
While you could easily use OCaml to create a game, I would worry that it’s reliance on a garbage collector (and its current limitations around multi-core execution) might make it a dealbreaker. So I would want to write the performance-sensitive code first and test it before fully committing to using OCaml.
View all comments
Show parent comment
2
u/ScientificBeastMode Sep 26 '23
I think it depends on the problem space. One of the hard things about functional programming languages is that most of them are garbage collected, which is a gigantic limitation on performance for some use cases. If you are really trying to optimize and push the limits of the graphics, you really need to avoid garbage collection and heap allocations in general, at least in that part of the code.
While you could easily use OCaml to create a game, I would worry that it’s reliance on a garbage collector (and its current limitations around multi-core execution) might make it a dealbreaker. So I would want to write the performance-sensitive code first and test it before fully committing to using OCaml.