Communication between a program written in ocaml and one written in dlang or crystal

What would be the most simple solution.
Use foreign function interface ?
Use named pipes ?
Use sockets ?
Something else ?

Two programs running concurrently? Unix sockets sound like the way to go.

If one is controlling the other, you can go a long way with just e.g. JSON over stdin/out.