Dear OCaml developers,
We are pleased to announce the v0.13 release of Jane Street packages!
This release comes with 14 new packages, and a number of fixes and
enhancements. The documentation for this release is available on our
website:
https://ocaml.janestreet.com/ocaml-core/v0.13/doc/
The remainder of this mail highlights the main changes since the v0.12
release; we hope it will be useful to developers in the process of
migrating to the new version. A comprehensive changelog is available
at the end.
Notable changes
- 
Changed Base,Core_kernel, andCorefunctions to raise
 Not_found_sinstead ofNot_found.Hashtbl.find_exnand
 Map.find_exnnow include the key in their error message.
- 
Changed CoreandCore_kernelto exportintcomparison rather
 than polymorphic comparison.
- 
Removed the ārobustā float comparison operators ( >.,=., ā¦)
 from the default namespace.
- 
Replaced sexp_*types (sexp_list,sexp_option,sexp_opaque,
 ā¦) with preprocessor attributes ([@sexp.list],[@sexp.option],
 [@sexp.opaque], ā¦).
- 
Changed let%mapsyntax fromlet%map.Foo.Let_syntaxto
 let%map.Foo.
- 
Added to match%optionalsupport for specifying a path, so you can
 writematch%optional.Foo foo_optionrather thanlet open Foo.Optional_syntax in match%optional foo_option.
- 
Improved Base.Backtraceso that it enables recording of backtraces
 in more situations, specifically whenOCAMLRUNPARAMis defined but
 doesnāt mention the backtrace flag,b.
- 
Added javascript support for Zarith,Bigint,Bignum, and
 Bigdecimal.
- 
Changed Hashtbl.create's defaultsizefrom 128 to 0.
- 
Changed Core_kernel.Commandso that all commands accept double
 dash flags:--help,--version, and--build-info.
New packages
- 
async_udp (https://github.com/janestreet/async_udp): UDP support for 
 Async.
- 
async_websocket (https://github.com/janestreet/async_websocket): 
 A library that implements the websocket protocol on top of Async.
- 
bonsai (https://github.com/janestreet/bonsai): A library for building 
 dynamic webapps, using Js_of_ocaml.
- 
postgres_async (https://github.com/janestreet/postgres_async): 
 OCaml/async implementation of the postgres protocol (i.e., does not
 use C-bindings to libpq).
- 
ppx_cold (https://github.com/janestreet/ppx_cold): Expands [@cold]
 into[@inline never][@specialise never][@local never].
- 
ppx_pattern_bind (https://github.com/janestreet/ppx_pattern_bind): 
 A ppx for writing fast incremental bind nodes in a pattern match.
- 
ppx_python (https://github.com/janestreet/ppx_python): 
 [@@deriving]plugin to generate Python conversion functions.
- 
ppx_yojson_conv (https://github.com/janestreet/ppx_yojson_conv): 
 [@@deriving]plugin to generate Yojson conversion functions.
- 
ppx_yojson_conv_lib (https://github.com/janestreet/ppx_yojson_conv_lib): 
 Runtime lib forppx_yojson_conv.
- 
pythonlib (https://github.com/janestreet/pythonlib): A library to 
 help writing wrappers around OCaml code for python.
- 
sexp_select (https://github.com/janestreet/sexp_select): A library 
 to use CSS-style selectors to traverse sexp trees.
- 
timezone (https://github.com/janestreet/timezone): Time-zone handling. 
- 
toplevel_backend (https://github.com/janestreet/toplevel_backend): 
 Shared backend for setting up toplevels.
- 
zarith_stubs_js (https://github.com/janestreet/zarith_stubs_js): 
 Javascript stubs for the Zarith library.
Deprecations / Removals
Async_kernel:
- Deprecated monadic ignorefunctions in favor ofignore_m.
Base:
- 
Deleted Array.replaceandreplace_allfunctions, which have been
 deprecated since before the last public release.
- 
Deprecated Result.ok_unit; useOk ().
- 
Removed the MonadandApplicativeinterfacesāall_ignore
 function; it was previously deprecated and replaced byall_unit.
- 
Removed List.dedup, which has been deprecated since 2017-04.
- 
Removed Stringmutation functions, which have been deprecated in
 favor ofBytessince 2017-10.
- 
Deprecated Array.truncate,Obj_array.unsafe_truncate, and
 Uniform_array.unsafe_truncate.
- 
Deprecated Sys.argv, which has been superseded byget_argv,
 which is a function, reflecting the fact thatargvcan change (as
 of OCaml 4.09).
Core_kernel:
- 
Removed Core_kernel.Std, which had been deprecated for a year.
- 
Deprecated type Command.Spec.paramin favor ofCommand.Param.t.
- 
Removed Hashtblfunctions that had been deprecated for years.
- 
Removed Float.to_string_round_trippable, which has been deprecated
 in favor ofto_stringsince 2017-04.
- 
Deprecated Fqueuefunctions where one should useFdequeinstead:
 bot,bot_exn, andenqueue_top.
- 
Deleted Bus.unsubscribes, which will be obviated by a performance
 improvement toBus.unsubscribe.
Timing_wheel:
- Removed the alarm_upper_boundfunction, which has been deprecated
 for 6 months, and superseded bymax_allowed_alarm_time.
Moves
Core_kernel:
- 
Moved Bounded_int_tableto a standalone library.
- 
Moved the PoolandTuple_typemodules to a standalone library,
 Tuple_pool.
Async_unix:
- Moved Unix.Fd.replaceinto aPrivatesubmodule.
Changelog
Async:
- Added module Expect_test_config_with_unit_expect, an alternative
 toExpect_test_configin which[%expect]has typeunitrather
 thanunit Deferred.t.
Async_kernel:
- 
Exposed type Async_kernel_config.t.
- 
Added a public-facing interface to the Async_kernel_scheduler
 module, taking the subset ofAsync_unix.Schedulerthat makes sense
 inAsync_kernel.
- 
Added to Time_sourceandSynchronous_time_sourceandId
 submodule, so that you can put them in a hash table or map.
- 
Added Deferred.Or_error.tag_sfunction.
- 
Added to Require_explicit_timesourcedeprecations ofDate.Today
 andTime.now.
- 
Added Synchronous_time_source.lengthfunction.
- 
Added Synchronous_time_sourcefunctionsreschedule_atand
 reschedule_after.
- 
Optimized Bvarso that its internal identity coercions can be
 inlined.
- 
Added Time_source.advance_by_alarms_byfunction, like
 advance_by_alarmsbut takesTime_ns.Span.t.
- 
Deprecated monadic ignorefunctions in favor ofignore_m.
- 
Renamed Time_source.advancefunctions asadvance_directly.
- 
Added to Synchronous_time_sourceanadvance_directlyfunction.
- 
Added Throttle.enqueue_exclusivefunction, which enqueues a job
 that occupies all slots of the throttle.
- 
Optimized Pipe.of_listso that it creates one queue rather than
 two.
- 
Added to Pipe.ta field,info : Sexp.t, intended to make debug
 messages more useful.
- 
Added Pipe.emptyfunction, equivalent toPipe.of_list [].
Async_rpc_kernel:
- 
Improved the error message when a message cannot be sent because it 
 is too big, cutting out a lot of noise.
- 
Added an expert function that constructs an Rpc.Implementation.t
 directly given just therpc_tagandversion.
- 
Added Async_rpc_kernel_stablemodule.
- 
Added type Implementations.on_unknown_rpc.
- 
Added State_rpc.client_pushes_backfunction, like the same
 function inPipe_rpc.
Async_unix:
- 
Changed In_thread.runto not initialize the scheduler.
- 
Optimized Unix.mkdir ~p:()to useCore.Unix.mkdir_prather than
 its own loop, avoiding many calls toIn_thread.syscall_exn.
- 
Added to Log.Outputcreation functions an optional argument:
 ?perm:Unix.file_perm.
- 
Added function Shutdown.is_shutting_down : unit -> bool.
- 
Added to Process.run*functions an optional argument:?argv0 : string, likeProcess.create.
- 
Added to Unixtypessocket_domainandsocket_type:
 [@@deriving compare, hash].
- 
Changed the Async scheduler to clear its epoll setās ready file 
 descriptors after it processes them, so that the already-processed
 file descriptors do not misleadingly appear in the schedulerās sexp.
- 
Added to Require_explicit_timesourcedeprecations of
 Time.Ofday.nowandTime_ns.Ofday.now.
- 
Made In_thread.run's default?when_finishedconfigurable via a
 ref, so that an application can change the default globally.
- 
Moved Unix.Fd.replaceinto aPrivatesubmodule.
- 
Improved Socket.sexp_of_t.
- 
In Tcp's socket-creation function, removed a call to
 Unix.set_close_on_exec, which is unnecessary because
 Socket.createalready does it.
- 
Fixed a bug in Reader.transferwhere if the reader has no data to
 read and the outputPipe.Writer.tis closed, the returned deferred
 would not be determined.
- 
Added support to Writerfor using a customTime_source.tinstead
 of the wall clock.
- 
Reworked Writer's buffer-age check.
- 
Fixed a stack overflow in Writersexp conversion.
- 
Added to Process.runand related functions a?prog_search_path
 argument.
- 
Treat .mltfiles as tests, in particular so thatWriteruses
 synchronous output.
Base:
- 
Added Or_error.tag_sfunction.
- 
Updated Basefor OCaml 4.08.
- 
Changed Basefunctions to raiseNot_found_sinstead of
 Not_found.Hashtbl.find_exnandMap.find_exnnow
 include the key in their error message.
- 
Optimized Map.update.
- 
Deleted Array.replaceandreplace_allfunctions, which have been
 deprecated since before the last public release.
- 
Deprecated Result.ok_unit; useOk ().
- 
Added Map.fold_symmetric_difffunction, which is more efficient
 thansymmetric_diff, due to avoidingSequence.
- 
Removed the MonadandApplicativeinterfacesāall_ignore
 function; it was previously deprecated and replaced byall_unit.
- 
Removed List.dedup, which has been deprecated since 2017-04.
- 
Added function Map.iteri_until.
- 
Removed Stringmutation functions, which have been deprecated in
 favor ofBytessince 2017-10.
- 
Updated Int63.tto use[@@immediate64]attribute.
- 
Changed Hashtbl.create's defaultsizefrom 128 to 0.
- 
Added Listfunctionsdrop_lastanddrop_last_exn.
- 
Added Sequence.equalfunction.
- 
Made Basebuild with OCaml 4.06.
- 
Improved support for Applicative.S2, adding signatures
 (Applicative_infix2,Let_syntax2) and functors
 (Make_let_syntax2,Of_monad2).
- 
Added Hash_set.unionfunction.
- 
Added Hashtblfunctionschooseandchoose_exn, analogous to
 Setfunctions of the same name.
- 
Added Map.MandSet.Msupport for[@@deriving equal].
- 
Added functions Map.binary_searchandSet.binary_search.
- 
Deprecated Array.truncate,Obj_array.unsafe_truncate, and
 Uniform_array.unsafe_truncate.
- 
Made Field.t_with_permbe[@@unboxed].
- 
Added Sys.getenvandgetenv_exn.
- 
Added Comparable.reversefunction, which reverses the ordering of
 a comparison function.
- 
Changed Random.State.defaultto be lazily initialized,
 nondeterministically, when not in test.
- 
Deprecated Sys.argv, which has been superseded byget_argv,
 which is a function, reflecting the fact thatargvcan change (as
 of OCaml 4.09).
- 
Added Randomfunctionscharandascii.
- 
Added to Comparable.Sfunctions:equal,min,max.
- 
Added to Mapfunctions for creating maps from sequences.
- 
Fixed Float.boxso that it works with flambda.
- 
Fixed Map.t_of_sexpandHashtbl.t_of_sexpso that on failure
 they raiseOf_sexp_error, so that sexp loading functions report
 error locations.
- 
Added Applicative.S3interface.
- 
Improved Backtraceso that it enables recording of backtraces in
 more situations, specifically whenOCAMLRUNPARAMis defined but
 doesnāt mention the backtrace flag,b.
- 
In Type_equal.Id.to_sexp, eliminated an unnecessary allocation
 when it is partially applied.
- 
Added Option_arrayfunctionunsafe_get_some_assuming_some, which
 is similar tounsafe_get_some_exn, except that it is faster and
 more unsafe because it avoids testing that its argument isSome.
- 
Added to Sequencefunctions converting to and fromCaml.Seq.t.
- 
Removed from Sequencea vestigial performance hack intended to
 improve partial application.
- 
Made ListmatchInvariant.S1.
- 
Changed Hashtbl.equal's argument order to match the standard
 order, taking the data equality function first.
- 
Made many modules match Invariant.S:Bool,Char,Int, ā¦
Base_bigstring:
- 
Renamed safe, checking binary setters (e.g. set_int8), adding an
 _exnsuffix to indicate that they may raise.
- 
Fixed a bug in range-checking ~posand~len, which could
 overflow when they are large.
- 
Added Bigstring.copyfunction.
- 
Marked Bigstring.unsafe_blitas[@@noalloc].
Bignum:
- 
Made BignummatchEqual.S.
- 
Added javascript support for Zarith,Bigint,Bignum,
 Bigdecimal, andBig_dollars.
- 
Added Bigint.Stable.V2serialization format, which is always
 strictly smaller than the V1 format, and is always the same
 regardless of the architecture.
- 
Adding a new serialization format, V3, which makes native and
 javascript serialize things the same way.
Core:
- 
Added Unix.Cidr.arg_type.
- 
Changed Coreto exportintcomparison rather than polymorphic
 comparison.
- 
Optimized Unix.mkdir_pto to create the directories starting from
 the deepest one instead of from the root.
- 
Exposed type equality between Time_ns.comparatorand
 Time_ns.Stable.V1.comparator.
- 
Changed Unix.getnameinfoto raiseNot_found_s.
- 
Fixed a bug in Unix.mkdir_p, which mistakenly did not use its
 permargument on the first directory it creates.
- 
Added function Linux_ext.Epoll.Expert.clear_ready.
- 
Replaced Unix.File_descr's[@@deriving bin_io, sexp]with
 [@@deriving sexp_of]; similarly forLinux_ext.Timer_fdand
 Unix.Process_info.
- 
Changed Unix.File_descr.sexp_of_tto elide the file descriptorās
 value whenam_running_test.
- 
Added Unix.Stable.Signalsubmodule.
- 
Added Sys.override_argvfunction.
- 
In bigstring_stubs.c, switched some uses offreeto
 caml_stat_free.
- 
Added Iobuffunctionslength_loandlength_hi.
- 
Added Iobuf.memcmpfunction.
- 
Added Iobuf.blit_maximalfunction.
- 
Added to Unix.Cidra function,broadcast_address, that returns
 the subnetās broadcast address.
- 
Add Iobufexpert-only setter functions for each field:
 Expert.set_{buf,lo_min,lo,hi,lo_max}.
- 
Added TimeandTime_nsfunctions for converting to and from
 Ofday.Zoned.t.
- 
Added Iobuf.fillf_floatfunction, for formatting a float in an
 iobof as specified by a C-style printf format string.
- 
Changed the type of Thread.createso that the function to be run
 in the new thread must return unit.
- 
Added to Thread.createa required argumenton_uncaught_exn:[ `Kill_whole_process | `Print_to_stderr ].
- 
Moved Core's time-zone parsing code into its own library,
 Timezone, that depends onCore_kernel.
Core_bench:
- Made Core_benchstdless.
Core_kernel:
- 
Added Core_kernel.eprint_s, likeprint_sbut to stderr.
- 
Removed Core_kernel.Std, which had been deprecated for a year.
- 
Changed Commandso that when command-line parsing fails, it prints
 a more descriptive message explaining how to get usage information.
- 
Fixed Commandso that for invalid command lines, it prints the
 entire error message on stderr, rather than printing some of it on
 stdout.
- 
Made FilenamematchComparable.S.
- 
Deprecated type Command.Spec.paramin favor ofCommand.Param.t.
- 
Changed Core_kernelto exportintcomparison rather than
 polymorphic comparison.
- 
Removed Hashtblfunctions that had been deprecated for years.
- 
Added support for type t = Map.M(Int).t [@@deriving bin_io]and
 type t = Set.M(Int).t [@@deriving bin_io].
- 
Changed Bigbuffer.add_substituteto raiseNot_found_s.
- 
Moved Bounded_int_tableto a standalone library.
- 
Changed Command's autocompletion shell functions to disable word
 splitting using an empty string rather than a null byte, which works
 better forzsh.
- 
Exposed Date.tas[@@immediate].
- 
Added to Hash_queueaccessor functions that are polymorphic in the
 key type, making its interface more likeHashtblandMap.
- 
Switched Hash_queue's implementation from custom exceptions to
 raise_s.
- 
Added Percentrounding functions:round_significant,
 round_decimal_{mult,percentage,bp}.
- 
Added to Time{,_ns}.Ofday.Zoned.With_nonchronological_compare:
 [@@deriving equal].
- 
Added Time_nsfunctions:is_earlier,is_later.
- 
Added Bag.Sinterface.
- 
Added Doubly_linked.S]interface.
- 
Added Gc.Control.tdefinition for the new OCaml 4.08 fields.
- 
Added Quickcheckbindings toTimeandTime_ns.
- 
In bigstring_stubs.c, replaced uses ofcaml_ba_unmap_filewith
 calls to the bigstringāsfinalizefunction, in preparation for
 OCaml 4.08.
- 
Added Or_error.Expect_test_configmodule.
- 
Removed Float.to_string_round_trippable, which has been deprecated
 in favor ofto_stringsince 2017-04.
- 
Deprecated Fqueuefunctions where one should useFdequeinstead:
 bot,bot_exn, andenqueue_top.
- 
Changed the definition of Nothing.tfrom an uninhabited
 Type_equal.tto an empty variant.
- 
Moved the PoolandTuple_typemodules to a standalone library,
 Tuple_pool.
- 
Added FdequeandFqueuefunctions to convert to and from
 Sequence.
- 
Dropped Hash_set.create's unnecessary unit argument.
- 
Changed Time_nsfunctionsof_int_ns_since_epochand
 Span.of_int_nson on 32-bit platforms so that they work rather
 than always raising.
- 
Changed Command.Param.choose_one's~if_nothing_chosenargument
 from a polymorphic variant to a GADT, and added a constructor that
 makes it return an option.
- 
Added Byte_units.zero.
- 
Changed Byte_unitsto use uppercase letters for the unit suffixes.
- 
Made Day_of_weekderivequickcheck.
- 
Added Mapfunctionskey_setandof_key_set, for converting
 between aMap.tand theSet.tof its keys.
- 
Added Bus.unsubscribesfunction, for efficient batched
 unsubscription from a bus.
- 
Made PercentmatchQuickcheckable.S.
- 
Made String_id.SmatchQuickcheckable.S.
- 
Improved the Quickcheckmonad to allow nestedlet%mapsyntax.
- 
Exported the Intablemodule.
- 
Added Command.Param.and_arg_names, to extract arg names from a
 Command.Param.t.
- 
Fixed a bug in Gc.keep_alivethat caused it to sometimes not work
 with flambda.
- 
Fixed a bug in deserialization of time zones without offsets ( GMT,
 UTC).
- 
Changed Command.basicto callString.stripon its?readme
 argument.
- 
Exposed Float.Robustly_comparablesubmodule.
- 
Optimized Union_findnot allocate in operations where one already
 has a root. This also affectsBagandDoubly_linked.
- 
Removed the ārobustā float comparison operators ( >.,=., ā¦)
 from the default namespace.
- 
Improved Command's generated help to clarify thatlistedand
 one_or_moreflags can be repeated.
- 
Deleted Bus.unsubscribes, which will be obviated by a performance
 improvement toBus.unsubscribe.
- 
Added Time_ns.Ofday.Option.of_span_since_start_of_day, which will
 returnnoneon an invalid span.
- 
Added Blangsupport forQuickcheckable.S1.
- 
In Bus, optimizedsubscribe_exnandunsubscribe, changing them
 from linear time (in the number of subscribers) to amortized
 constant time.
- 
In Bus, relaxed functions that take a'callback Read_only.tto
 instead take a('callback, [> read ]) t, which lets us eliminate a
 bunch of pointless calls toBus.read_onlyin client code.
- 
Added Time_nsfunctionsadd_saturatingandsub_saturating,
 which clamp rather than overflow.
- 
Added Option.Optional_syntaxsubmodule, so that you can use
 ordinary options with immediate options inmatch%optional.
- 
Included Byte_units.Infixoperators in the mainByte_units
 module.
- 
Changed Commandso that all commands accept double dash flags:
 --help,--version, and--build-info.
- 
Added Tuple2.mapandTuple3.mapfunctions.
Delimited:
- Changed Readwith~strip:trueto useChar.is_whitespace,
 rather than strip only space characters.
Expect_test_helpers:
- 
Generalized the Expect_test_helpers.runfunctionās?print_stdout
 and?print_stderrarguments from typeboolto typePrint_rule.t = Always | If_unclean_exit | Never.
- 
Removed the require_no_allocationfunctionās?cr:CR.targument,
 which was an attractive nuisance.
Incremental:
- 
Changed Clock.advance_clockso that it calls
 Timing_wheel.fire_past_alarms, so people donāt have to reason
 about [alarm_precision] when thinking about whether alarms have
 fired.
- 
Changed Clock.advance_clockso that advancing time backwards is a
 no-op, rather than doing something wrong.
- 
Improved Observer.sexp_of_tto show just the observerās value or
 an informative message, omitting a bunch of internal state.
- 
Changed Incremental.Clock's default timing-wheel configuration so
 that it handle alarms for all times up to
 Time_ns.max_value_representable.
- 
Removed the advance_clockfunctionās~deprecated_allow_backwards
 argument.
- 
Added map11, ā¦,map15functions.
- 
Added [@@unboxed]in a couple places to improve performance.
- 
Generalized the unordered_array_foldfunctionāsf_inverse
 argument to also allow anupdatefunction, which can more
 efficiently implement the composition off_inverseandf.
- 
Generalized step_functionto allow the steps to be specified via a
 sequence and to allow the step function to be an incremental value.
- 
Made it possible to write functions that deal with incrementals 
 without committing to a particular instance of the module created by
 Incremental.Make.
- 
Added generic sexp_of_tfunctions.
- 
Added to type state_witness[@@deriving sexp_of].
- 
Exposed more equalities between types in Incrementaland
 Incremental.S.
- 
Added Incremental.stateaccessor function.
- 
Added Incremental.State.create, a generic function for creating an
 incremental state, along with itsstate_witnesstype.
Ppx_comapre:
- Fixed a bug in [@compare.ignore], which generated unannotated
 ignores that were then rejected byppx_js_style.
Sexp_pretty:
- Fixed handing of block comments (#| |#).
Stdio:
- Added Out_channel.eprint_sfunction.
Timing_wheel:
- 
Changed Config.createto trimlevel_bitsas needed according to
 alarm_precision.
- 
Fixed Config.durationsto not overflow.
- 
Added to Level_bits.create_exnan optional argument,
 ?extend_to_max_num_bits:bool, which is useful for extending a
 timing wheelās level bits so that the full range of times is
 covered.
- 
Removed the alarm_upper_boundfunction, which has been deprecated
 for 6 months, and superseded bymax_allowed_alarm_time.
- 
Changed Timing_wheel's max supported time from:
 Time_ns.max_value_for_1us_roundingto
 Time_ns.max_value_representable.
- 
Extended Timing_wheel's supported key bits from 61 to 62, so that
 it supports allTime_ns.tvalues withalarm_precision = 1ns.
- 
Made all Timing_wheeltests run on 32-bit platforms.
Uopt:
- Added support for match%optionalsyntax.

