3 ms·
Most likely not. You could get away writing a lot of utility type functions between the two, but the libraries, async scene, module system, object system, etc.
by nv-vn 8y ago
Most likely not. You could get away writing a lot of utility type functions between the two, but the libraries, async scene, module system, object system, etc. vary enough that it would be practically impossible to share any non-trivial piece of code. Which isn't to say that porting anything would be hard, most of the core code would stay there and you'd only really adjust the edges of your code so to speak--if you separate out access to libraries or try to port the APIs from one language to another (which would be easy in OCaml with it's module system) it would certainly be possible to share 90% or more of your core code.
But for example, you'd have to avoid using async/await in F# and instead opt for some library that has surface-level compatibility with OCaml's Async or LWT and working with .NET libs would require you writing wrappers for the OCaml standard library.
- delhanty 8y agoThank you. >it would certainly be possible to share 90% or more of your core code. It sounds like maintaining parallel code bases in Ocaml and F# with the same basic design and file layout might work quite well for the core.