The first Reason Conf US just ended. Many talks mentioned native compilation. Sharing code between BuckleScript and native artifacts is a use case which is more and more common. This blog post is an introduction on how to set up a library available for both worlds, sharing as much code as possible.
What we try to produce is a library with an identical interface for BuckleScript and native. But without duplicating code. …
atdgen is a project to create types and data structures that can be serialized to JSON. It is very convenient when communicating between multiple processes, creating a REST API or consuming JSON objects from other tools. It can be compared to JSON schema or Protocol Buffers, but with richer types and more features.
The idea is to write a list of types in a specification file, an .atd file. Then running atdgen, it is possible to generate OCaml or Java code to serialize/deserialize values of those types to/from corresponding json.
At Ahrefs, we are doing a lot of OCaml. But sometimes, OCaml doesn’t have a specific library or is not well supported. And we have to back off to another language.
An example of such a platform without a good OCaml supports and a lack of OCaml libraries is AWS Lambda. Until now, I would probably use Typescript to write lambdas, as nodejs is well supported by AWS Lambda, a lot of libraries are available (like the