What is the reason for Infer to switch from Reason to OCaml


I noticed recently that Facebook’s Infer switched back to pure OCaml from the Reason (at some point they used ReasonML). I am curious about Reasons, haha.

1 Like


Are you sure that Infer was using Reason? Looking back to the first public commit, it seems to have been using OCaml from the beginning: https://github.com/facebook/infer/commit/b8982270f2423864c236ff8dcdbeb5cd82aa6002



Yes, initially they used OCaml, then at some point migrated to Reason, then - back. At least this is how I remember it and hope it wasn’t my imagination.



I can’t find any indication of it ever using Reason, are sure about that?



Oh, seems my memory glitch, sorry for the fuss.



Infer did use Reason for some of the code between May 17, 2016 and Jul 11, 2017. Going back to OCaml was largely due to the Infer team being mostly long-time OCaml programmers who are more familiar with it than Reason, and the priorities of the Reason team at that time shifting to optimize for use cases such as messenger.com.



@XVilka your memory didn’t glitch after all! Thanks @jjb



and the priorities of the Reason team at that time shifting to optimize for use cases such as messenger.com

I’m curious, could you say a bit more about that? I don’t follow very closely the developments on the Reason side, and my impression was that, as an alternative syntax, it would be mostly agnostic to the application domain (except for the syntax familiarity factor).



JSX support maybe?



(I just changed “Facebook” into “Infer” in the topic title to make it more specific.)

1 Like


First, keep in mind that this was a long time ago in terms of Reason development, things have changed a lot in the interim.

One significant point was that this was in the time before ocaml-migrate-parsetree. So there were very strong versioning constraints, which meant that upgrading Infer and Reason and everything else that used Reason had to more or less be done atomically. That’s hard. Also, it quite reasonably took time to adapt to new compiler versions. So there was some pressure there.

But also, don’t underestimate the syntax familiarity point. Especially at that early stage, it was common for us to have to resort to writing snippets of ocaml and process with refmt in order to discover the Reason syntax for what we wanted to write. That got old fast. And the concrete syntax of Reason was changing at high speed at that point, exploring different options. That was exciting, but over time there was also an increasing desire to just get on with our actual work.



Interesting background. What is your view today about both syntaxes? What syntax would you use if there were no legacy issues?



I’ve been programming almost exclusively in (O)Caml(-light) since 1995, so don’t listen to me, try them both and see what you think. :slight_smile: