3 ms·
C is one of my favorite languages but you know what be almost perfect for the author’s needs? OCaml! Almost as fast as C, no mandatory OOP, great performance, C
by mruts 7y ago
C is one of my favorite languages but you know what be almost perfect for the author’s needs? OCaml! Almost as fast as C, no mandatory OOP, great performance, C FFI, nice FP, totally portable and native executables.
Unfortunately OCaml is single-threaded, has a stop the world GC (though if it’s good enough for Jane Street it’s probably good enough for you), and sometimes has unfortunate syntax (though ReasonML fixes a lot of this). Also OCaml doesn’t have the greatest type system in the world. No higher kinder types and instead we get the parameterized “functor” module system. Which honestly, kind of sucks. A lot of OCaml is an artifact from the past, if it could be remade today it would really be something great. Even so, OCaml is a great language and doesn’t suffer from a lot of the dogma that Haskell succumbs to.
I’ve always thought of and used OCaml as the functional programming equivalent of C. No unnecessary bullshit, just straight coding.
- TurboHaskal 7y agoWhile OCaml boasts very low GC latency, I believe F# would be a better choice for writing games. It is an even more straight to the point OCaml; a Windows first class citizen; has a concurrent GC and I've heard C# is pretty popular for writing games due to Unity, so one might be able to leverage that (I don't know). A non CLOS heavy SBCL codebase would also be excellent.