[cwn] Attn: Development Editor, Latest OCaml Weekly News
Alan Schmitt
alan.schmitt at polytechnique.org
Tue Aug 21 01:13:11 PDT 2018
Hello
Here is the latest OCaml Weekly News, for the week of August 14 to 21,
2018.
Table of Contents
─────────────────
Color: library to work with css color formats
Derive-ocaml: a rust crate to help with ocaml FFI
random forests in OCaml via bindings to the R randomForest package
OCaml Documentation Open Thread
Article: "Systems Languages: An Experience Report"
Opam 2.0.0 RC4-final is out!
Updated dune starter kit
Quantitative developer position at LexiFi, Paris
Dune 1.1.0
Work-in-progress Sentry SDK
A good summary of the "multicore OCaml memory model" article
Balancer 1.0
Interesting OCaml Articles
Opam 2.0 experimental PPAs
aws-s3 4.0.1
Ocaml Github Pull Requests
Other OCaml News
Old CWN
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Color: library to work with css color formats
═════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/color-library-to-work-with-css-color-formats/2328/2]
Continuing this thread, gasche said
───────────────────────────────────
Would there be a chance to connect with the work on specifying colors
and color profiles in @dbuenzli's basic graphics [Gg] library (see
[Gg.Color documentation])? From the interface that you provide, it is
not completely clear to me how flexible color computations can be –
you provide an HSLA color space, but a linearized sRGB space would be
also convenient for example, and Gg provides one.
[Gg] http://erratique.ch/software/gg
[Gg.Color documentation]
http://erratique.ch/software/gg/doc/Gg.Color.html
Christophe added
────────────────
To work with colors, note there is also [Color brewery] (not yet in
opam) which is compatible with `Gg.color'. I concur with @gasche, it
is good if all these libraries can work together.
[Color brewery] https://github.com/Chris00/color_brewery
Anurag Soni then announced
──────────────────────────
[https://github.com/anuragsoni/color/tree/0.2.0]
I have updated the library with more utilities to work with
colors. Some other changes since last time is the use of `Gg.Color.t'
as the color type. So one can use other methods from the wonderful
`gg' library to tweak/modify their colors, or use color palettes like
the ones from `color-brewry'
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Derive-ocaml: a rust crate to help with ocaml FFI
═════════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/derive-ocaml-a-rust-crate-to-help-with-ocaml-ffi/2331/1]
Joris Giovannangeli announced
─────────────────────────────
i'm pleased to announce the first release of [derive-ocaml] a set of
rust macros 1.1/2.0 (similar to ppx) to generate boilerplate of
writing rust stubs for ocaml external calls.
The crate has no runtime and relies on the [ocaml] for all the ocaml
runtime bindings.
The macros are still a bit experimental but should make ocaml/rust ffi
much easier to crawl. Also while here i'd like to thank @zshipko for
maintaining and improve the ocaml crate !!
[derive-ocaml] https://crates.io/crates/derive-ocaml
[ocaml] https://crates.io/crates/ocaml
Perry E. Metzger asked and Joris Giovannangeli replied
──────────────────────────────────────────────────────
> So this is to allow calling Rust from OCaml?
yes,but mostly it's helper to derive conversion from and to ocaml
types to rust structures/enums. This is the main feature, it generates
boilerplate code to call store_field()/field 'macros' like in C. On
top of that it has some glue to make rust functions "nice" looking by
hiding CAMLparams and co macros.
You can see a very basic example here:
• [ocaml side]
• [rust side]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[ocaml side]
https://github.com/ahrefs/rust-ocaml-derive/blob/master/example/src/stubs.ml
[rust side]
https://github.com/ahrefs/rust-ocaml-derive/blob/master/example/src/lib.rs
random forests in OCaml via bindings to the R randomForest package
══════════════════════════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/ann-random-forests-in-ocaml-via-bindings-to-the-r-randomforest-package/2335/1]
UnixJunkie announced
────────────────────
[https://github.com/UnixJunkie/orrandomForest]
Quite hackish but working. The interface is similar to my other
"R-wrapping packages". Data are exchanged via text files.
Should land soon in opam.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
OCaml Documentation Open Thread
═══════════════════════════════
Archive:
[https://discuss.ocaml.org/t/ocaml-documentation-open-thread/1841/138]
Deep in this thread, Daniel Bünzli said
───────────────────────────────────────
> but even plain text files of good documentation
We even have better than that.
We have the [`ocamldoc' language]. It allows to have your
documentation exactly where it is needed, in `mli' files, and will
carry itself if you move your sources around.
The ocamldoc language is a fully featured document markup language
with sectioning and /checked/ cross references to sections and API
entry points.
Doing manuals and tutorial inside `.mli' always felt a bit cumbersome
but is entirely doable as can be witnessed in many of my packages (see
[this one] for example). The good news is that nowadays we will
gradually be able to write those larger pieces in seperate `.mld'
files. Code sample extraction is not there yet but I hope we can have
a [simple design] implemented soon rather than having these
discussions.
The other good news is that as a programmer, the effort you need to
provide in order to make the documentation you write in this language
available to end-users is this: *approaching zero*:
• If you are using `topkg' or `dune-release' (assuming they didn't
kill that workflow), publishing your docs online on github is a
`topkg distrib && topkg publish doc' away.
• Distributing this documentation with your package releases is also
/automatically/ done if you use `topkg+ocamlbuild' or `dune': these
systems compile and install the right files which `odig' can then
pickup in order to generate cross-referenced documentation for all
the packages that are installed in your `opam' switch and allows you
to peacefully read all this wondefully produced documentation
offline with the stylesheet that suits you.
One might complain that the ocamldoc language syntax is none of these
alternative document markup languages whose popularity came after
`ocamldoc''s initial existence but if you ever tried to write a
polymorphic variant in a markdown code span you will be glad that
ocamldoc's language isn't that one.
I understand the `ocamldoc' language is one more thing to learn as a
newcomer but it's not hugely complex, it's there, it works with the
advantages highlighted above and an aspiring OCaml working programmer
shall meet it quite soon anyways since there are thousands of lines of
documentation in hundreds of projects that are using it.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[`ocamldoc' language]
https://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html#sec351
[this one] http://erratique.ch/software/vg/doc/Vg.html
[simple design] https://github.com/ocaml/odoc/issues/130
Article: "Systems Languages: An Experience Report"
══════════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/article-systems-languages-an-experience-report/2339/12]
Deep in this thread, Yotam Barnoy announced
───────────────────────────────────────────
Just wanted to plug [OCamlverse]. Not only can anyone contribute via
PR, anyone can have commit rights as well.
We already have a [quickstart] page for setting up Dune and such. I'd
love to have more content there for getting OCaml concepts like
concurrent programming up and running quickly.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[OCamlverse] https://ocamlverse.github.io/
[quickstart] https://ocamlverse.github.io/content/quickstart.html
Opam 2.0.0 RC4-final is out!
════════════════════════════
Archive:
[https://discuss.ocaml.org/t/opam-2-0-0-rc4-final-is-out/2341/1]
R. Boujbel announced
────────────────────
We are happy to announce the opam 2.0.0 final release
candidate. Hooray! :tada: It will be promoted to 2.0.0 proper within a
few weeks, when the official repository format switches from 1.2.0 to
2.0.0. You'll find all information about opam update & repository
upgrade in this [blog post].
Big thanks to all who helped test and polish the release!
[blog post]
http://www.ocamlpro.com/2018/07/26/opam-2-0-0-rc4-final-is-out/
R. Boujbel later said
─────────────────────
The roadmap is detailed in this [blog post].
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[blog post] https://opam.ocaml.org/blog/opam-2-0-0-repo-upgrade-roadmap
Updated dune starter kit
════════════════════════
Archive: [https://discuss.ocaml.org/t/updated-dune-starter-kit/2342/1]
Martin Jambon announced
───────────────────────
The goal of this 3rd-party repository is to provide a minimal and
idiomatic [template for setting up an OCaml project]. It was just
updated to use `dune' instead of `jbuilder'.
For those migrating, the [changes are minimal] and detailed migration
help is given by the [official docs].
[template for setting up an OCaml project]
https://github.com/mjambon/dune-starter
[changes are minimal]
https://github.com/mjambon/dune-starter/commit/900625d875013d65ee2b3bb09ee6ae42d9e95284
[official docs] http://dune.readthedocs.io/en/latest/migration.html
Shon then said
──────────────
I have a dead simple, feature poor tool in this direction which I've
used for my own toy purposes: [https://github.com/shonfeder/nomad]
Its in't updated to use the `dune' rebranding or to be compliant with
the new release.
I'm glad to hear that the views about integrating this functionality
directly into dune have changed! I'd be happy to help with that
effort.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Quantitative developer position at LexiFi, Paris
════════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/quantitative-developer-position-at-lexifi-paris/2380/1]
Alain Frisch announced
──────────────────────
LexiFi has an open position for a junior quantitative developer. The
position could be a good fit for an OCaml developer with some interest
in (learning about) numerical methods and/or financial stuff, even
without a formal background in those topics.
More information:
[https://www.lexifi.com/careers/quantitative-developer/]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Dune 1.1.0
══════════
Archive: [https://discuss.ocaml.org/t/ann-dune-1-1-0/2402/1]
Rudi Grinberg announced
───────────────────────
On behalf of the dune team, I'm proud to announce the 1.1.0 release of
dune. This release contains a few interesting features that I won't
describe in this post, because I've already written a dedicated blog
post about this release:
[http://rgrinberg.com/posts/dune-upcoming-1-1/]
The change log is replicated here for your convenience:
1.1.0 (06/08/2018)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
• Fix lookup of command line specified files when `--root' is
given. Previously, passing in `--root' in conjunction with
`--workspace' or `--config' would not work correctly (#997,
@rgrinberg)
• Add support for customizing env nodes in workspace files. The `env'
stanza is now allowed in toplevel position in the workspace file, or
for individual contexts. This feature requires `(dune lang 1.1)'
(#1038, @rgrinberg)
• Add `enabled_if' field for aliases and tests. This field controls
whether the test will be ran using a boolean expression
language. (#819, @rgrinberg)
• Make `name', `names' fields optional when a `public_name',
`public_names' field is provided. (#1041, fix #1000, @rgrinberg)
• Interpret `X' in `--libdir X' as relative to `PREFIX' when `X' is
relative (#1072, fix #1070, @diml)
• Add support for multi directory libraries by writing
`(include_subdirs unqualified)' (#1034, @diml)
• Add `(staged_pps ...)' to support staged ppx rewriters such as ones
using the OCaml typer like `ppx_import' (#1080, fix #193, @diml)
• Use `-opaque' in the `dev' profile. This option trades off binary
quality for compilation speed when compiling .cmx files. (#1079, fix
#1058, @rgrinberg)
• Fix placeholders in `dune subst' documentation (#1090, @emillon,
thanks @trefis for the bug report)
• Add locations to errors when a missing binary in PATH comes from a
dune file (#1096, fixes #1095, @rgrinberg)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Work-in-progress Sentry SDK
═══════════════════════════
Archive:
[https://discuss.ocaml.org/t/work-in-progress-sentry-sdk/2403/1]
Brendan Long announced
──────────────────────
Cross-posted-ish from:
[https://forum.sentry.io/t/a-work-in-progress-ocaml-sdk/4406]
I've been wanting to use Sentry with OCaml, and ended up writing my
own library for it. I thought other people might be interested to, so:
[https://github.com/brendanlong/sentry-ocaml]
It currently only works with Async and not Lwt or synchronous/stdlib
only. If anyone else is interested, I'd definitely like to support
those. And feedback would definitely be nice.
You basically just do this at the start of your program and it will
load `SENTRY_DSN' (and some other things) from your environment and
upload any errors in the background:
┌────
│ Sentry.with_context @@ fun () ->
└────
You can also set custom tags and upload exceptions or messages
manually:
┌────
│ Sentry.with_environment "staging" @@ fun () ->
│ Sentry.with_tags [ "method", "POST" ; "path", "/example" ] @@ fun () ->
│ Sentry.capture_message "this will have the environment and tags above merged with the defaults"
└────
Results look like:
[https://discourse-cdn-sjc2.com/standard11/uploads/ocaml/original/2X/4/40293449c4e632c7e7e6d4f55e7ced6bd8702976.png]
Note that it works a lot better if you use exceptions and not
`Or_error.t', although if someone wants to improve the `Or_error.t'
parsing, pull requests would be welcome for that too.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
A good summary of the "multicore OCaml memory model" article
════════════════════════════════════════════════════════════
Archive:
[https://discuss.ocaml.org/t/a-good-summary-of-the-multicore-ocaml-memory-model-article/2422/1]
gasche announced
────────────────
[The morning paper] is an amazing blog where the author posts
summaries of research papers. Today's edition covers the recent (PLDI
2018) article ([PDF]) on the memory model proposed for the Multicore
OCaml implementation:
[Bounding data races in space and time – part I]
[The morning paper] https://blog.acolyer.org/
[PDF] http://kcsrk.info/papers/pldi18-memory.pdf
[Bounding data races in space and time – part I]
https://blog.acolyer.org/2018/08/09/bounding-data-races-in-space-and-time-part-i/
gasche later added
──────────────────
[Part II] is now available.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[Part II]
https://blog.acolyer.org/2018/08/10/bounding-data-races-in-space-and-time-part-ii/
Balancer 1.0
════════════
Archive: [https://discuss.ocaml.org/t/ann-balancer-1-0/2424/1]
Nobody Gone announced
─────────────────────
I'm pleased to announce that Balancer 1.0 is now available on opam,
it's a collection of load balancing algorithms, such as p2c,
consistent hashing + least loaded, p2c with partial key grouping,
round robin, etc.
All of the balancers are written with service discovery in mind, so
you can plugin a react signal and use a watch with zookeeper or
whatever.
It also comes with some useful synchronization utils for shared
mutable state.
I think it's a useful addition to the ecosystem, just because people
scale ocaml by spawning a lot of processes and talking via tcp, domain
sockets, files, etc, and I'm actually surprised there wasn't a library
for it beforehand.
[https://github.com/xnukernpoll/ocaml-balancers]
[https://opam.ocaml.org/packages/balancer/]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Interesting OCaml Articles
══════════════════════════
Archive:
[https://discuss.ocaml.org/t/interesting-ocaml-articles/1867/24]
Continuing this thread, Yotam Barnoy announced
──────────────────────────────────────────────
A pair of great posts discussing @stedolan's now-famous PLDI paper!
:tada:
[https://blog.acolyer.org/2018/08/09/bounding-data-races-in-space-and-time-part-i/]
[https://blog.acolyer.org/2018/08/10/bounding-data-races-in-space-and-time-part-ii/]
Yotam Barnoy then added
───────────────────────
[https://blog.janestreet.com/what-the-interns-have-wrought-2018/]
Yotam Barnoy also added
───────────────────────
[http://www.dra27.uk/blog/platform/2018/08/15/dune-vendoring.html]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Opam 2.0 experimental PPAs
══════════════════════════
Archive:
[https://discuss.ocaml.org/t/opam-2-0-experimental-ppas/2446/1]
Anil Madhavapeddy announced
───────────────────────────
I've refreshed the opam2 PPA infrastructure to make binary packages
available for Ubuntu, ahead of the stable release of opam 2.0.0. These
can be used with (e.g.) Travis CI for non-container based builds from
an Ubuntu base, without having to wait for the upstream packages to
get the latest version of opam.
The packages currently sit in my experimental PPA tree at
[avsm/ppa-opam-experimental], so if anyone can test them and let me
know if you run into any problems, I'd appreciate it.
Sources to the scripts and more information in the README:
• [https://github.com/avsm/opam2-ppa]
If anyone would like to help with including opam 2 in more upstream
distributions as we approach release, please [refer to the
distributions wiki] and pick your favourite OS :)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[avsm/ppa-opam-experimental] https://github.com/avsm/opam2-ppa
[refer to the distributions wiki]
https://github.com/ocaml/opam/wiki/Distributions
aws-s3 4.0.1
════════════
Archive: [https://discuss.ocaml.org/t/ann-aws-s3-4-0-1/2451/1]
Anders Fugmann announced
────────────────────────
I’m happy to announce aws-s3 4.0.1
The [aws-s3] library provides access to Amazon Simple Storage Solution
(S3). Operations include: get, put, head, delete, delete_multi, ls,
multipart upload and s3 to s3 copying. The library includes functions
to get machine role and security token (credentials) through AWS
Identity and Access Management service (IAM). The library supports
both lwt and async concurrency models.
Lots of changes have been made in this release, but most noticeably is
the introduction of a streaming api, which will reduce latency and
memory footprint as objects does not need to be held in memory in full
during transfer.
The release contains some trivial breaking changes (module renaming),
and upgrading should be strait forward.
Changes since version 3.0.0:
• Support HEAD operation on objects.
• Change signature to use string for etag rather than Caml.Digest.t
• Support Digest 0.6
• Remove dependency to Core
• Rewrite authentication code
• Switch to use Ptime for time conversion routines
• Support chunked transfer (put)
• Add streaming API
• Remove dependency on Cohttp
• Switch to dune
• Support IPv6
• Add option to use expect-100.
• Add option to limit result of ls
• Extend aws-cli
• Move region related functions to own Region module
• Fix bug when parsing multi delete reply in case of error
The package is available through opam.
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[aws-s3] https://github.com/andersfugmann/aws-s3
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.
• [Format semantic tags as extensible sum types]
• [Add Set.disjoint]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[Format semantic tags as extensible sum types]
https://github.com/ocaml/ocaml/pull/1966
[Add Set.disjoint] https://github.com/ocaml/ocaml/pull/1986
Other OCaml News
════════════════
From the ocamlcore planet blog
──────────────────────────────
Here are links from many OCaml blogs aggregated at [OCaml Planet].
• [TzDrawIt, a decentralized drawing app on Tezos]
• [Full Time: Software Developer (Functional Programming) at Jane
Street in New York, NY; London, UK; Hong Kong]
• [Full Time: Compiler Engineer at Jane Street in New York & London]
• [Not-learning is a skill too]
• [opam 2.0.0 RC4-final is out!]
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[OCaml Planet] http://ocaml.org/community/planet/
[TzDrawIt, a decentralized drawing app on Tezos]
http://www.ocamlpro.com/2018/07/31/tzdrawit/
[Full Time: Software Developer (Functional Programming) at Jane Street
in New York, NY; London, UK; Hong Kong]
http://jobs.github.com/positions/0a9333c4-71da-11e0-9ac7-692793c00b45
[Full Time: Compiler Engineer at Jane Street in New York & London]
http://jobs.github.com/positions/9e8ba450-e72e-11e7-926f-6ce07b7015c8
[Not-learning is a skill too]
https://gaiustech.wordpress.com/2018/07/29/not-learning-is-a-skill-too/
[opam 2.0.0 RC4-final is out!]
http://www.ocamlpro.com/2018/07/26/opam-2-0-0-rc4-final-is-out/
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/20180821/c51d5fc3/attachment-0001.html>
-------------- next part --------------
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-07: 408.71, 2017-07: 407.07
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 528 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/caml-news-weekly/attachments/20180821/c51d5fc3/attachment-0001.pgp>
More information about the caml-news-weekly
mailing list