New Issue: Should we unify C type naming convention? How?

18012, "bradcray", "Should we unify C type naming convention? How?", "2021-07-01T01:02:47Z"

Currently most C types that our modules define for the purposes of interoperability use type names like c_int, c_float, etc. However ssize_t and size_t are outliers. In discussions, we have generally shown interest in unifying these to a single scheme, where the two main proposed courses of action are:

  • unify on the c_ prefix and change ssize_t and size_t to c_ssize_t and c_size_t for consistency (please vote this option with :+1:)
  • drop the c_ prefix and put these symbols into a module named C such that one would type things like C.int and C.size_t rather than c_int and c_size_t (please vote this option with :heart:)
  • something else?

Arguments in favor of :+1:

  • though c_ is not particularly Chapeltastic, these identifiers are C identifiers, and c_ is a reasonable naming scheme for C identifiers
  • the use of the somewhat ugly / clunky c_ prefix serves as a disincentive for using these broadly in Chapel code, where the preferred approach would be to keep them constrained to C interop situations, at which point they should be translated to/from Chapel types
  • it clearly marks them for what they are with no way around it

Arguments in favor of :heart:

  • it is more Chapeltastic in terms of naming by avoiding underscores (apart from ssize_t and size_t, I suppose)
  • it leverages Chapel's modules' namespaces rather than naming conventions to distinguish these symbols