Previous week Up Next week

Hello

Here is the latest OCaml Weekly News, for the week of November 28 to December 05, 2017.

  1. Reason on OCaml 4.06
  2. OCaml 2017 videos?
  3. OCaml-MariaDB 0.10.0
  4. Farfadet 0.2
  5. new release of minicli (2.0.0)
  6. opam 2.0.0 beta5
  7. sslconf 0.8.3 (new)
  8. ppxfind: use legacy ppx rewriters with jbuilder
  9. Ocaml Github Pull Requests
  10. Other OCaml News

Reason on OCaml 4.06

Archive: https://discuss.ocaml.org/t/reason-on-ocaml-4-06/1205/1

Jordan W. announced:
The [Reason](https://reasonml.github.io/) syntax is now available on OCaml 4.06!

Thanks to github users @hcarty , @rgrinberg @ncihnegn, @hhugo, @avsm for some
input/feedback and/or helping to [merge into
opam-repository](https://github.com/ocaml/opam-repository/pull/10869#issuecomment-347429216).


Thanks to @let-def for nearly single-handedly implementing the latest iteration
of Reason syntax changes which were intentionally designed to be more familiar
to the largest developer audience (with ES6 style lambdas `arguments =>
returnValue`). Whether or not we all *personally like* the syntax changes, it's
undeniable that the feedback we've received has been **overwhelmingly**
positive. I hope this ends up being good for the growth of the OCaml ecosystem
in the long term. Several people have approached me asking how they can "use
Reason to build their app" now that the "syntax is improved". The power that
syntax has over perception of a language continues to be eye opening. Even as a
fan of the ML style of syntax, I must say it feels great to have a larger number
of people immediately recognize your code as familiar and embrace it.

It should be fairly straightforward to integrate the Reason syntax/printer into
your application, and Reason shouldn't prohibit you from accessing all of
OCaml's features (anything less is currently considered a bug - for which pull
requests (or Issues) are graciously welcome). If you use `jbuilder`, then your
build system already supports Reason (thanks to @diml and @rgrinberg). Merlin
already has built-in first-class support for using Reason or standard OCaml
syntax. (It's pretty cool how Merlin + Reason demonstrates that you can build
IDE infrastructure for which concrete syntax is fully abstracted away without
giving up recovered parsing and recovered type checking). For those curious,
Reason uses `ocaml-migrate-parsetree` in order to sustain support for all modern
OCaml versions. (Reason was one of the first test cases for
`ocaml-migrate-parsetree`).

There's still some room for improvements with the workflow/packaging and your
contributions to help improve it are always welcomed. For example, `rtop` (the
`utop` top level for Reason) should be factored out into its own opam package
(this is tough to orchestrate with `opam-publish`). This will help reduce
package manager conflicts.

Most of our work in the last six months has been focused around building and
shipping [Reason React](https://reasonml.github.io/reason-react/) which uses
Reason, BuckleScript, and ReactJS to create a very nice UI development
experience (okay, to say I'm biased would be putting it lightly). (Questions
about Reason React or BuckleScript would be best asked in their own threads,
thanks!)

Stay tuned for more syntax improvements/features. Again, your contributions are
welcomed and appreciated.
      

OCaml 2017 videos?

Archive: https://discuss.ocaml.org/t/ocaml-2017-videos/842/9

gasche announced:
Videos for the main ICFP 2017 conference just started flowing in [on
Youtube](https://www.youtube.com/channel/UCwRL68qZFfub1Ep1EScfmBw/videos). I
have no insider information, but I hope that video recording of the workshop
talks will soon follow.
      

OCaml-MariaDB 0.10.0

Archive: https://discuss.ocaml.org/t/ann-ocaml-mariadb-0-10-0/1209/1

Andre Nathan announced:
Yet another OCaml-MariaDB release... Petter Urkedal noticed a design flaw where
after executing a statement that doesn't return rows (i.e. SELECT, INSERT,
UPDATE), it was impossible to access the execution result, so there was no way
to call functions like `affected_rows`.

This release fixes that by changing `Stmt.execute` to always return a `Res.t`.
      

Farfadet 0.2

Archive: https://discuss.ocaml.org/t/ann-farfadet-0-2/1211/1

Calascibetta Romain announced:
I'm happy to announce a new release of
[farfadet.0.2](https://github.com/oklm-wsh/Farfadet), available for installation
via OPAM.

Farfadet is a little library on top of
[faraday](https://github.com/inhabitedtype/faraday) to provide a better API to
describe how to serialize an OCaml value with the faradet back-end (used for
example in [httpaf](https://github.com/inhabitedtype/httpaf)). This release does
not have a big change, it's just a compatibility change from the last version of
[faraday.0.5.0](https://github.com/inhabitedtype/faraday/releases/tag/0.5.0).

However, like [furl](https://github.com/Drup/furl) or `printf`, this library
could be a good introduction and real use case of GADT. Indeed, this library use
GADT to construct what `eval` expects as arguments. Thus, this library provide a
type-safe way to encode an OCaml value.

A good start to understand how to construct a GADT in this use-case, I can
advise to read [this good article](https://drup.github.io/2016/08/02/difflists/)
from @Drup.
      

new release of minicli (2.0.0)

Archive: https://discuss.ocaml.org/t/ann-new-release-of-minicli-2-0-0/1218/1

UnixJunkie announced:
minicli is a minimalist OCaml library for command line parsing.

To get it:
opam update && opam install minicli

The code:
https://github.com/UnixJunkie/minicli

A usage example:
https://github.com/UnixJunkie/minicli/blob/master/test.ml

Competing libraries are the Arg module from the stdlib (but client programs are
a little painful to maintain) or Daniel Bunzli's cmdliner library (which is
overkill for many applications).

If you use the Arg module, I suggest you give a try at minicli.
      

opam 2.0.0 beta5

Archive: https://sympa.inria.fr/sympa/arc/caml-list/2017-12/msg00000.html

Louis Gesbert announced:
After a few more months brewing, we are pleased to announce a new beta release
of opam. With this new milestone, opam is reaching feature-freeze, with an
expected 2.0.0 by the beginning of next year.

See all details at http://opam.ocaml.org/blog/opam-2-0-beta5/

Thanks for testing!
      

sslconf 0.8.3 (new)

Archive: https://discuss.ocaml.org/t/ann-sslconf-0-8-3-new/1228/1

Tony Wuersch announced:
Hi. sslconf, 0.8.3, is an OCaml rewrite of the NCONF library in Openssl,
available for installation via OPAM. As a pure OCaml rewrite, sslconf is
unikernel-ready.

sslconf parses and exposes Openssl config files as OCaml hash tables.

Currently, the OPAM async_ssl library (built on Ctypes) accepts Openssl config
files only from /etc/ssl/openssl.conf, and its API calls draw on data from these
config files.

An important use of config files is to hide passwords and secret data from the
surfaces of command lines and environment variables. Command lines and
environment variables may be read in real time by process status commands. They
can also be copied to logs by auditing tools. Config files prevent these leaks.

Openssl config files are given as examples in many support posts and books, such
as for X509 extensions, certificate authority specification, and Kerberos PKINIT
certificates.

This rewrite should be able to read all Openssl config files, including features
of the Openssl parser which are peculiar. The main peculiar feature is the
possibility of line continuation characters at 512-byte offsets of very long
lines, due to the parser reading lines in up to 512 byte chunks.

A feature not present in Openssl NCONF is s-expression serialization and
de-serialization of result hash tables. Another is a test suite with 100%
coverage, i.e., every line of the implementation, thanks to bisect_ppx
reporting.

Ideally, sslconf should be used in sync with other OPAM packages, such as
ocaml-certifiy for certificate creation and async_ssl for discovery of ASN.1
OIDs for names in config files.

A github is at
[https://github.com/awuersch/sslconf](https://github.com/awuersch/sslconf) .
Please submit issues and pull requests to the github location.
      

ppxfind: use legacy ppx rewriters with jbuilder

Archive: https://discuss.ocaml.org/t/ann-ppxfind-use-legacy-ppx-rewriters-with-jbuilder/1240/1

Jérémie Dimino announced:
I've just released a new [ppxfind](https://github.com/diml/ppxfind) tool in
opam. This tool allows to use non-driverised ppx rewriters with jbuilder. It is
it not the recommended way to use ppx rewriters with jbuilder, in particular
you'll still have to specify runtime dependencies manually and preprocessing
will be slower, however if you don't have a choice this tool can help.

To use legacy ppx rewriters with jbuilder, simply write this in your jbuild file:

```scheme
  (preprocess (action (run ppxfind -legacy ppx1,ppx2,... --as-pp ${<})))
```
      

Ocaml Github Pull Requests

Gabriel Scherer and the editor compiled this list:
Here is a sneak peek at some potential future features of the Ocaml
compiler, discussed by their implementers in these Github Pull Requests.

- Add specific explanation for unification errors involving functions of type unit -> _
  https://github.com/ocaml/ocaml/pull/1505
- Extending `open` to accept arbitrary module expression
  https://github.com/ocaml/ocaml/pull/1506
- Add explanation for errors caused by a type constraint propagated from a keyword
  https://github.com/ocaml/ocaml/pull/1510
- Allow the user to shadow sub-modules of Pervasives
  https://github.com/ocaml/ocaml/pull/1513
      

Other OCaml News

From the ocamlcore planet blog:
Here are links from many OCaml blogs aggregated at OCaml Planet,
http://ocaml.org/community/planet/.

Frama-C 16 - Sulfur is out. Download ithere.
 http://frama-c.com/index.html
      

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.


Alan Schmitt