Previous week Up Next week

Hello

Here is the latest OCaml Weekly News, for the week of April 03 to 10, 2018.

  1. Encore - encoding/decoding and isomorphism
  2. Berlin MirageOS meetup on April 10th 2018 at 18:30
  3. how to automatically extract a subset of some ocaml code base?
  4. Behaviour driven development in OCaml
  5. Talk, March 7, Effective Programming: Adding an Effect System to OCaml
  6. Camomile 1.0.0 is released
  7. Other OCaml News

Encore - encoding/decoding and isomorphism

Archive: https://discuss.ocaml.org/t/ann-encore-encoding-decoding-and-isomorphism/1806/1

Calascibetta Romain announced:
I'm glad to announce the first release of
[encore](https://github.com/dinosaure/encore). This library is a part of
[ocaml-git](https://github.com/mirage/ocaml-git) to serialize and deserialize
Git objects.

When we develop `ocaml-git`, we need to write 2 times a description
([ABNF](https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_form)) of
these objects. One time with
[angstrom](https://github.com/inhabitedtype/angstrom) and a second time with an
internal implementation of a _memory-bounded_ encoder.

However, when we want to update this description, sometimes, we can forget to
update description with the encoder or vice-versa and put a bug - specially when
we need to produce exactly what we read. So we found a project,
[finale](https://github.com/takahisa/finale), which wants to provide a
_meta_-syntax to produce decoder and encoder both. In this way, we can ensure
isomorphism between encoder and decoder and it's exactly what we want for Git.

We took this idea and provide more strictly an angstrom decoder and an internal
encoder. Indeed, finale is focus on to pretty-print a value instead to produce
exactly a serialized representation of value equal to what we de-serialize.

You can see an example in this
[PR](https://github.com/mirage/ocaml-git/pull/287) or you can look
[tests](https://github.com/dinosaure/encore/blob/master/test/test.ml) which is
not really readable ...

This library can be used by another encoder/decoder library, however we make
this library on top of some constraints about shared behaviors of `angstrom` and
the internal encoder
[`lole`](https://github.com/dinosaure/encore/blob/master/lib/lole.mli) -
specially about alteration.

Finally, this library was produced explicitly for
[ocaml-git](https://github.com/mirage/ocaml-git), so we miss may be some
convenience functions for the client. So, feel free to improve it!
      

Berlin MirageOS meetup on April 10th 2018 at 18:30

Archive: https://discuss.ocaml.org/t/berlin-mirageos-meetup-on-april-10th-2018-at-18-30/1807/1

Hannes Mehnert announced:
I'm organising an inaugural MirageOS meeting in Berlin on Tuesday, April 10th
from 18:30 on. It is a rather informal meeting to get together and talk about
MirageOS. Starting at 19:00, we will have a round of lightning talks (10 minutes
each), scheduled on-site. I will offer two
1) MirageOS introduction
2) µDNS

If you want to present your project, please bring your presentation. Afterwards,
we hang out and discuss ideas, and/or sit at a computer and fix some bugs.

This event is open for everybody, please respect each other. Be kind and
empathetic to others; do not harrass or threaten anyone. If you make others
unsafe, you may be asked to leave.

The venue is the onionspace, a shared office, in Berlin-Wedding
(Gottschedstrasse 4, Entrance 4, 13357 Berlin (U Nauener Platz is the closest
station, but also in walking distance from U Osloer Str & U Pankstrasse, which
are often easier to reach). In case you're in trouble finding it, contact me via
email for my phone number.

Some drinks (Club Mate, ..) will likely be available on donation-basis. Bring
your own if you have specific requests.
      

how to automatically extract a subset of some ocaml code base?

Archive: https://sympa.inria.fr/sympa/arc/caml-list/2018-04/msg00009.html

Francois BERENGER asked:
I have a large research prototype code base, with many tested, compiling
but abandoned things.

I'd like to release only a small cool stuff out of it.

I have an executable with an entry point into that code base
to use the cool stuffs.

Is there a tool that would allow me to extract only the
needed source code so that I can do a minimal source-based release with
only "cool stuff" plus all its dependencies?

Previously, I would do this by hand. But, with years passing, I become
more and more lazy. :)
      
Reuben Rowe replied:
I am currently working on a refactoring tool for OCaml.

  https://gitlab.com/trustworthy-refactoring/refactorer

It contains functionality to compute the file dependency graph of a codebase, so
perhaps this would potentially work for you? If you have the dependency graph,
you can extract only the source files that the entry point (transitively)
depends on.

It is not especially user-friendly at the moment, but if you like I could work
with you on getting it to do what you want.
      

Behaviour driven development in OCaml

Archive: https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/2

Christopher Yocum announced:
I had planned to hold off an announcement until a better time when I had more
features. However, I and @Thegaram, who has been a great help, are working on
[Cucumber.ml](https://github.com/cucumber/cucumber.ml) which is progressing
towards implementing Cucumber in OCaml. I would caution that we are still in
very early stages but if you are interested in it, please head over to the
repository and have a look.

Things we can already do:

* Given, When, Then already work so there is a basic runtime.
* Before and After hooks work.
* State passing between steps by default

Things that are outstanding:

* Tags do not work at the moment (the structures are there but we need to hook them up)
* Running multiple feature files from the command line (we need to implement
command line arguments but I am bouncing back and forth on using a getopt
library or Cmdliner)
* I am sure there are things that I am missing

I will be attending CukenFest in London later in the month and I will be doing
the OSS hack day so I am hoping to get basic tags working then.
      
Volodymyr Melnyk then asked and Christopher Yocum replied:
> Thank you for your response. Cucumber is a good tool for end2end testing,
> however I'm more interested in tools like RSpec in Ruby which provides a
> BDD-tool for black box unit testing. Don't you know testing solutions similar to
> RSpec?

Having looked at RSpec very quickly, it seems similar to Jasmine. Sadly, I do
not know anything at this time in OCaml that is similar to RSpec. Although, I
imagine that you could possibly build something similar based on
[OUnit](http://ounit.forge.ocamlcore.org/).
      
Thegaram then added:
There is [ospec](https://github.com/andrenth/ospec). Unfortunately, it is not
actively developed anymore.
      

Talk, March 7, Effective Programming: Adding an Effect System to OCaml

Archive: https://discuss.ocaml.org/t/talk-march-7-effective-programming-adding-an-effect-system-to-ocaml/1626/10

Leo White announced:
Luckily the problem with the recording was fixable. So here's the video:

https://www.janestreet.com/tech-talks/effective-programming/
      

Camomile 1.0.0 is released

Archive: https://discuss.ocaml.org/t/ann-camomile-1-0-0-is-released/1825/1

Yoriyuki Yamagata announced:
I'm happy to announce the first stable version 1.0.0 of Camomile, a Unicode
library for OCaml. This is an "API stabilizing" release, before we go major
updates.

There is not much difference between the previous release 0.8.7 and 1.0.0. Only
user visible changes are that dynamic configuration using environment variables
is deprecated and all modules are wrapped under CamomileLibrary

You can get this release either from opam, or Github
https://github.com/yoriyuki/Camomile/releases/tag/rel-1.0.0

The future plan includes

 * split Camomile into several libraries, so that a user do not need to install
the entire (several megabytes) libraries
 * support latest Unicode standard
 * and others!  (I have a lot of idea but not enough time)
      
Perry E. Metzger then asked and Yoriyuki Yamagata replied:
>> ...support latest Unicode standard...

> Which version is currently supported?

3.2.  I know, it's far behind the current one (10.0.0)
      
Perry E. Metzger then said and Yoriyuki Yamagata replied:
> What work is needed to help you bring it up to 10.0.0? I do know most of the
> Unicode data is included in machine readable tables, yes?

Unicode standard changed a lot since 3.2. Unicode data format and semantics as
well as algorithms are updated. We must review the difference and update the
code.

In github repo, there is a 10.0.0 branch. In this branch a parser for UCD 10.0.0
is implemented, using Daniel Bünzli's uucd. Since Camomile and uucd use
different data structures, the parsing is currently very slow. We must do
something.

Some random TODO:

- Case mapping algorithm must be updated. Daniel already implemented this so I
will look at his work. But again Camomile has a different API and different data
structures so his works would not be directly usable.
- Canonical equivalence and normal forms. the current implementation should be
okay but I need to look at the standard. May try some improvement.
- Collation.  again I have to look at the standard.
- Others?

Also updating test suites (currently we are using an almost 20 years old
framework), packaging, performance improvement, restructuring modules etc, are
all necessary and highly appreciated.
      

Other OCaml News

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

OCaml Engineer for PL/distributed-systems cryptocurrency project at O(1) Labs (Full-time)
 https://functionaljobs.com/jobs/9079-ocaml-engineer-for-pl-distributed-systems-cryptocurrency-project-at-o1-labs

How to quantify quantifiers: an Ltac puzzle
 http://gallium.inria.fr/blog/how-to-quantify-quantifiers-an-ltac-puzzle
      

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