OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of February 26 to March 05, 2019.

Table of Contents

LLVM tutorial with Dune (Part 2)

Adam BK announced

Hi everyone, I just made an updated version of the OCaml LLVM since the posted one is pretty out of date. Check it out here: https://github.com/adamrk/llvm-ocaml-tutorial. The main changes are:

  • switch build system to dune from ocamlbuild
  • switch lexing and parsing to use ocamllex/menhir instead of camlp4
  • update to newer LLVM API (version 6.0.0)

There are also a couple outstanding issues that I can't figure out, so if you have any ideas how to fix these it'd be really helpful:

  • Menhir is generated files which cause warnings during compilation:

    ocamlc lib/parser__mock.mli.inferred
      File "parser__mock.ml.mock", line 388, characters 9-18:
      Warning 3: deprecated: Not_found
    ocamlopt lib/.kaleidoscope_lib.objs/kaleidoscope_lib__Parser.{cmx,o}
      File "parser.ml", line 161, characters 45-612:
      Warning 9: the following labels are not bound in this record pattern: state
    

    Are there any ways to prevent Menhir from causing these warnings? I'm currently handling it by suppressing the warnings with

    (env
     (dev
      (flags (:standard -warn-error -3-9))))
    

    in the dune file. Alternatively, is there a way to suppress the warnings only for these specific files?

  • The cstubs are currently printing to stderr because when I set them to print to stdout, those calls don't occur until the program exists. Any ideas on why that happens and if there is a better fix?
  • I'm currently linking the cstubs dynamically which is annoying. Does anyone know if there's a way to statically link them in?

Marcello Seri replied

You can locally disable the warnings with [@ocaml.warning “-9”] or [@@ocaml.warning “-9”]. If you use a version of ocaml prior to 4.06, you may be better off by wrapping the module with

[@@@ocaml.warning “-9”]
...
[@@@ocaml.warning “+9”]

A parallel and shared memory library based on Hack's implementation

Rijnard Van Tonder announced

Hack_parallel is a standalone parallel and shared memory library based on the components used in FB tools Hack, Flow, and Pyre. The internals of these components are little known outside of these projects, yet stand to benefit the OCaml community more generally, both for practical use and educational purposes. So I extracted the core parts and packaged it up; more information can be found in the project README.

I put together an example project to illustrate the basic interface.

Yaron Minsky then asked

Exciting stuff!

But how seriously should I take these warnings?

https://github.com/rvantonder/hack-parallel/blob/master/src/heap/hh_shared.c

Rijnard Van Tonder replied

From some more details:

You can ignore the scary THIS CODE ONLY WORKS WITH HACK. The implementation works generally (it's used in Flow/Pyre and my own projects without problems). The warning is overcompensating so that people do not treat it like a "generic atomic hashtable for OCaml". The data structure and constraints on memory operations are explained well here. I may document the points in the video in future, but hope that helps for now.

BTG Trading is hiring OCaml devs in Puerto Rico

Owen Gunden announced

BTG Trading is a leading proprietary trading firm focused exclusively on the bitcoin-related markets. In operation since 2013, we have developed significant strategies unique to cryptocurrency. Our trading systems are highly automated and we take a systematic approach to trading.

We are seeking driven, passionate individuals who take pride in their work and are excited by cryptocurrency. At BTG we aim to be the best at what we do, and so should you.

Our team is very small and as such, the environment is very much that of a startup. You will be expected to handle a variety of types of work. We place a strong emphasis on automation.

Must be willing to relocate to San Juan, Puerto Rico for a minimum of 6 months of training. After 6 months, there may be some room for flexibility in terms of remote work, but this is not guaranteed. Puerto Rico has a lot to offer, including some of the most beautiful natural spaces and a growing cryptocurrency ecosystem.

We are currently looking for an additional OCaml developer. The ideal candidate is a hacker type; you love computers, you know how to, and enjoy, go deep in understanding to get to the heart of a problem.

You also have computer security baked into your bones. When dealing with cryptocurrency, there can be no room for error with security protocols.

Both founders of BTG are themselves developers, so you know that when you join our team, your skills will be valued highly.

Interested candidates should contact hiring@btgtrading.com.

Other OCaml News

From the ocamlcore planet blog

Old CWN

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.