ocaml-ctypes icon indicating copy to clipboard operation
ocaml-ctypes copied to clipboard

Use OCaml 4.03-specific features

Open yallop opened this issue 4 years ago • 1 comments

Now that we've dropped support for OCaml 4.02.3 (#673), we can make use of some of the new features in OCaml 4.03. The following seem like reasonable candidates:

  • [ ] ocaml/ocaml#5528: inline records for constructor arguments

  • [ ] ocaml/ocaml#6374: allow _ t as a short-hand for (_, _, ..) t for n-ary type constructors

  • [ ] ocaml/ocaml#6806: Allow type annotations before the -> in fun <args> -> <expr>: fun x y : (int * int) -> (x, y)

  • [ ] ocaml/ocaml#26: support for (type a b) as syntactic sugar for (type a) (type b)

  • [ ] ocaml/ocaml#42: short functor type syntax: S -> T for functor (_ : S) -> T

  • [ ] ocaml/ocaml#167: allow to annotate externals' arguments and result types so they can be unboxed or untagged: [@unboxed], [@untagged]. Supports untagging int and unboxing int32, int64, nativeint and float.

  • [ ] ocaml/ocaml#240: replace special annotations on externals by attributes:

    • float is generalized to [@@unboxed]
    • noalloc becomes [@@noalloc]

    Deprecate float and noalloc.

  • [ ] ocaml/ocaml#596: make string/bytes distinguishable in the underlying compiler implementation; caml_fill_string and caml_create_string are deprecated and will be removed in the future, please use caml_fill_bytes and caml_create_bytes for migration

  • [ ] ocaml/ocaml#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown types {,u}int{32,64}. C stubs may have to be updated as {,u}int{32,64}_t are not defined anymore.

  • [ ] ocaml/ocaml#7848, ocaml/ocaml#230: Array.map2, Array.iter2

  • [ ] ocaml/ocaml#6494: Add equal functions in modules Bytes, Char, Digest, Int32, Int64, Nativeint, and String. Users defining their own modules with signature module type of Int32 have to extend their implementation.

  • [ ] ocaml/ocaml#329: Add exists, for_all, mem and memq functions in Array

  • [ ] ocaml/ocaml#356: Add Format.kasprintf

yallop avatar Jun 14 '21 15:06 yallop

The floodgates are opened! 4.03 sure was an eventful release :-)

avsm avatar Jun 14 '21 16:06 avsm