skydeck

Already a member? Login.

Skydeck Blog

Turn OCaml signatures into RPC interfaces

At Skydeck we use ONC RPC to communicate between parts of our server infrastructure. ONC RPC is an old, simple, reliable remote procedure call protocol. It fits well with OCaml since it deals in values and functions, rather than objects and methods, and it has a good implementation in Ocamlnet. However, since all of our ONC RPC clients and servers are written in OCaml, it is a little annoying to have to write interfaces using the somewhat clumsy ONC RPC specification language. It’s nice to be able to stay in the OCaml type system from end to end.

For this reason we’ve written orpc, a tool that reads OCaml signatures and generates clients and servers for use with Ocamlnet’s ONC RPC implementation. Orpc supports most OCaml types (including polymorphic types), exceptions, and functions with labelled/optional function arguments. It can also generate tracing code (that pretty-prints function arguments and results) from a signature. Finally, it supports asynchronous operation using the Lwt threads library (in addition to the usual callbacks interface).

We are proud to release orpc as free software. This release is preliminary and without question contains bugs, but we are using it successfully for production software, and we intend to continue to improve it. You can download orpc 0.1 here, or browse the source and documentation here.

  • Irene Friedman
    I tried it, I didn't really see any advantage. I want to unsubscribe but refuse to have you verify by sending me another text message. I pay per text message; my plan is voice only. Once I've established an identity and password that should be enough to log me in. Anyhow I want OUT. And don't text me!
blog comments powered by Disqus