[cwn] Attn: Development Editor, Latest OCaml Weekly News

Alan Schmitt alan.schmitt at polytechnique.org
Tue Feb 12 00:46:20 PST 2019


Hello

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

Table of Contents
─────────────────

PSA: cohttp 2.0 removes old ocamlfind subpackage aliases
Interesting OCaml Articles
Major Release of Base64 / Article
Orsetto: structured data interchange languages (preview release)
OCaml 4.08.0+beta1
OCaml meetup in SF on 2/12
Is anyone doing Design by Contract in OCaml?
Dune and Multicore
Other OCaml News
Old CWN


PSA: cohttp 2.0 removes old ocamlfind subpackage aliases
════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/psa-cohttp-2-0-removes-old-ocamlfind-subpackage-aliases/3290/1>


Anil Madhavapeddy announced
───────────────────────────

  In a similar vein to the recent [cstruct change], the HTTP client and
  server library [cohttp 2.0 has just been released] with some
  deprecation changes that you should be aware of.

  In cohttp.0.99, a number of subpackages were turned into explicit opam
  packages to simplify dependency management. To aid migration, some
  compatability shims were left in place so that the old findlib names
  would continue to work. They have now been removed as of this
  release. If you were still using them, then please rename them as
  follows in your `dune' or `_tags' files to use the name findlib names:

  • `cohttp.lwt-core' -> `cohttp-lwt'
  • `cohttp.lwt' -> `cohttp-lwt-unix'
  • `cohttp.js' -> `cohttp-lwt-jsoo'
  • `cohttp.async' -> `cohttp-async'
  • `cohttp.top' -> `cohttp-top'

  Once you have renamed it in your build system, just add the
  corresponding new package name to your `opam' dependency list as well.

  The reason for removing the compatibility shim is that the old
  ocamlfind names do not work when embedding the dune libraries in a
  [dune vendor workspace].  So I'm removing the technical debt now to
  make those so-called "duniverse" deployments significantly easier to
  manage.


[cstruct change]
<https://discuss.ocaml.org/t/psa-cstruct-3-4-0-removes-old-ocamlfind-subpackage-aliases/3275>

[cohttp 2.0 has just been released]
<https://github.com/mirage/ocaml-cohttp/blob/master/CHANGES.md>

[dune vendor workspace]
<http://www.dra27.uk/blog/platform/2018/08/15/dune-vendoring.html>


Interesting OCaml Articles
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/interesting-ocaml-articles/1867/39>


UnixJunkie announced
────────────────────

  Ok, here is my contribution to try promoting OCaml in my field:
  <https://jcheminf.biomedcentral.com/articles/10.1186/s13321-019-0332-0>


Major Release of Base64 / Article
═════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-major-release-of-base64-article/3297/1>


Calascibetta Romain wrote
─────────────────────────

  Editor note: this post is too long for this newsletter. It is
  available online at
  <https://tarides.com/blog/2019-02-08-release-of-base64.html>


James Woodyatt then said
────────────────────────

  This is an excellent article! Thanks for writing it up.

  p.s. I don't want to hijack this thread, but I'd like to mention that
  all three of the problems discussed in this article were already known
  to me when I wrote the [Base64 implementation] in my forthcoming
  [Orsetto] framework of structured data interchange languages. (Expect
  an announcement before Monday about its preview release. Also, for the
  MirageOS people: my implementations are generally not speed
  demons. I've left a lot of room for myself to make performance
  improvements in the future.)


[Base64 implementation]
<https://bitbucket.org/jhw/orsetto/src/unstable/src/cf/cf_base64.mli>

[Orsetto] <https://bitbucket.org/jhw/orsetto/>


Orsetto: structured data interchange languages (preview release)
════════════════════════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ann-orsetto-structured-data-interchange-languages-preview-release/3304/1>


James Woodyatt announced
────────────────────────

  I am pleased to announce that I've reached the *preview* milestone I
  set for my [Orsetto] project. As I wrote in the *README* file about
  it:

        Orsetto is a standalone library comprising a core toolkit…

        • Core functional data structures and processes.
        • Unicode transport, normalization, parsing and
          formatting.
        • General purpose packet format encoder-decoder processes.

        …used to implement streaming parsers and formatters for a
        useful variety of structured data interchange languages…

  In the preview release, the major featured languages are only *JSON*
  and *CBOR*, but my hope is to expand this list to include a variety of
  other useful languages. The programming interfaces are sufficiently
  different from other implementations that I feel Orsetto may be a
  welcome alternative to have available.

  Orsetto is currently available from my personal OPAM repository, which
  you can use in the conventional way:

  ┌────
  │ opam repository add jhwoodyatt git+https://bitbucket.org/jhw/opam-personal.git
  └────

  In two weeks, unless discussion here convinces me to delay or defer,
  then I will request to make Orsetto available on the public OPAM
  repository along with a commitment to make patch releases as necessary
  to correct errors.

  At this time, I'm inviting the OCaml community to give it a look, post
  comments and questions about it here, file issues on [the Issue
  tracker] if you notice anything wrong. I'm especially interested in
  knowing about name conflicts that I need to avoid. Once I push to the
  public OPAM repository, I want to be able to move quickly toward its
  first *stable* release.


[Orsetto] <https://bitbucket.org/jhw/orsetto>

[the Issue tracker] <https://bitbucket.org/jhw/orsetto/issues>


OCaml 4.08.0+beta1
══════════════════

  Archive:
  <https://sympa.inria.fr/sympa/arc/caml-list/2019-02/msg00014.html>


Damien Doligez announced
────────────────────────

  The release of OCaml 4.08.0 is approaching. We have created a beta
  version to help you adapt your software to the new features ahead of
  the release.

  The source code is available at these addresses:

  <https://github.com/ocaml/ocaml/archive/4.08.0+beta1.tar.gz>
  <https://caml.inria.fr/pub/distrib/ocaml-4.08/ocaml-4.08.0+beta1.tar.gz>

  The compiler can also be installed as an OPAM switch with one of the
  following commands.

  ┌────
  │ opam switch create ocaml-variants.4.08.0+beta1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────

  or

  ┌────
  │ opam switch create ocaml-variants.4.08.0+beta1+<VARIANT> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
  └────
  where you replace <VARIANT> with one of these:
  • afl
  • default_unsafe_string
  • flambda
  • fp
  • fp+flambda

  We want to know about all bugs. Please report them here:
    <http://caml.inria.fr/mantis/bug_report_page.php>


OCaml meetup in SF on 2/12
══════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/ocaml-meetup-in-sf-on-2-12/3324/1>


Brandon Kase announced
──────────────────────

  Hey all! We're hosting an OCaml/ReasonML meetup in SF tomorrow night
  (2/12) at 6:30PM. We'll have food, drinks, and some really interesting
  talks:

  • Shallow Dive into the Philosophy of Reprocessing by Avery Morin. How
    Reprocessing tries to stay approachable to enable anyone to do
    creative work in ReasonML.
  • A conversation about ReasonML in production (and side projects)
    between a junior and senior engineer
  Yuki Li and Sean Grove will debate the pros/cons of using ReasonML in
  large production systems, whether ReasonML has a place in side
  projects and prototypes, and how junior developers will be helped and
  hurt by the language and its ecosystem.

  We'll also have plenty of time to chat, eat, and hang out. People of
  all backgrounds / skill levels are welcome, please just RSVP below so
  we know how much food to get!

  <https://www.meetup.com/sv-ocaml/events/258482142/>


Is anyone doing Design by Contract in OCaml?
════════════════════════════════════════════

  Archive:
  <https://discuss.ocaml.org/t/is-anyone-doing-design-by-contract-in-ocaml/3301/1>


Yawar Amin asked
────────────────

  I noticed there are a couple of research projects that implement new
  language features for a contract language, but not seeing anything
  library-based for mainline OCaml. Is anyone doing it now or in did in
  the past? Wondering what people's thoughts are. Personally, today I
  feel it should be possible to do with extension points. Maybe
  something like,

  ┌────
  │ let divide x y = x / y
  │ [@@dbc.pre "y <> 0"]
  │ [@@dbc.post "result * y = x"]
  └────


Denis Ignatovich said
─────────────────────

  Check out <https://try.imandra.ai>. It has a bunch of examples in
  Jupyter notebooks. There's also the docs page
  <https://docs.imandra.ai>

  Your example above would look something like this (with integer
  arithmetic, obv):
  ┌────
  │ # let divide x y = x / y;;
  │ val divide : Z.t -> Z.t -> Z.t = <fun>
  │ # verify (fun (x, y) -> (y <> 0) ==> (((divide x y) * y) = x));;
  │ - : Z.t * Z.t -> bool = <fun>
  │ Counterexample (after 0 steps, 0.020s):
  │  let _x = (1, 2)
  │ [✗] Conjecture refuted.
  │ module CX : sig val _x : Z.t * Z.t end
  └────


Ivan Gotovchits also said
─────────────────────────

  A possible approach, on which I was experimenting some time ago, would
  be to use ephemerons to attach predicates to data, which could be
  later checked (a mere presence check) on the caller side.  Something
  like this:

  ┌────
  │ let typecheck code =
  │    ensures ["well-typed"] @@
  │    perform_typecheck code
  │ 
  │ let normalize code =
  │    requires ["well-typed"];
  │    provides ["well-typed"; "normal-form"] @@
  │    perform_normalization code
  │ 
  │ let optimize code =
  │    requires ["normal-form"; "well-typed"];
  │    provides ["normal-form"; "well-typed"; "optimized"] @@
  │    do_optimizations code
  └────
  where `requires tags obj' is a function of type `string list -> 'a ->
  unit' that takes a list of tags, denoting features, and checks that
  they are attached to the given object, and `provides tags obj' is a
  function of type `string list -> object -> object' takes a list of
  features and attaches it to the object (an alternative syntax is
  having type `object -> unit', since an ephemeron is a mutable
  hashtable).

  The implementation is using ephemerons, which are hashtables indexed
  with arbitrary boxed objects with a special treatment of liveness
  (i.e., values from those hashtables disappear when the index
  disappear, so no memory leakage should happen).

  The main benefit of this approach is its simplicity, it is vanilla
  OCaml, it is easy to implement, and easy to disable. The main drawback
  is that it works only with heap values (aka boxed values) and that it
  is not reflected in the function signature. And of course, since it is
  that simple, the contract can't actually be a formula, especially that
  references the host language.


Dune and Multicore
══════════════════

  Archive: <https://discuss.ocaml.org/t/dune-and-multicore/3315/1>


james woodyatt announced
────────────────────────

  For grins, I updated my _multicore_ OPAM switch and started looking
  into what is currently keeping my Orsetto project from compiling
  there. At the moment, the answer is that Dune doesn't compile. Which I
  suppose is not really noteworthy, because multicore is still way way
  off, but I was vastly amused by the log message that appeared on my
  console:

        I must not segfault. Uncertainty is the
        mind-killer. Exceptions are the little-death that brings
        total obliteration. I will fully express my cases.
        Execution will pass over me and through me. And when it
        has gone past, I will unwind the stack along its
        path. Where the cases are handled there will be
        nothing. Only I will remain.

  I don't know who wrote this, but it has me rolling on the floor—
  especially given the irony of this happening on a compiler that's
  trying to introduce algebraic effects. Just wanted to raise a glass
  for that here. Bravo, whoever you are. You have won the Internet
  today.


Other OCaml News
════════════════

From the ocamlcore planet blog
──────────────────────────────

  Here are links from many OCaml blogs aggregated at [OCaml Planet].

  • [What’s new for Alt-Ergo in 2018 ? Here is a recap !]
  • [Learning a New Language]
  • [Release of Base64]
  • [OCaml server-side developer at Ahrefs (Full-time)]


[OCaml Planet] <http://ocaml.org/community/planet/>

[What’s new for Alt-Ergo in 2018 ? Here is a recap !]
<http://www.ocamlpro.com/2019/02/11/whats-new-for-alt-ergo-in-2018-here-is-a-recap/>

[Learning a New Language]
<https://gaiustech.wordpress.com/2019/02/10/learning-a-new-language/>

[Release of Base64]
<https://tarides.com/blog/2019-02-08-release-of-base64.html>

[OCaml server-side developer at Ahrefs (Full-time)]
<https://functionaljobs.com/jobs/9142-ocaml-server-side-developer-at-ahrefs>


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]


[send me a message] <mailto:alan.schmitt at polytechnique.org>

[the archive] <http://alan.petitepomme.net/cwn/>

[RSS feed of the archives] <http://alan.petitepomme.net/cwn/cwn.rss>

[online] <http://lists.idyll.org/listinfo/caml-news-weekly/>

[Alan Schmitt] <http://alan.petitepomme.net/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/caml-news-weekly/attachments/20190212/a9752c42/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/caml-news-weekly/attachments/20190212/a9752c42/attachment-0001.pgp>


More information about the caml-news-weekly mailing list