Skip to content

Consider renaming str, int, etc. to Str, Int, Etc. #7275

@bstrie

Description

@bstrie
< bstrie> I'm starting to think that maybe it *would* be better if str
          and int etc. were Str and Int for the sake of consistency...
          was there a good reason that's not the case, other than legacy
          reasons?
< bstrie> because I'm reading tjc's slides and it does stick out that
          those types are lowercase unlike all other types
<@brson> bstrie: it stuck out to me too. that was one of the noob q's i
         asked him during his rehearsal
< aatch> I'd prefer keeping all the primitive types as lower-case though
<@brson> Java and C# are precedents
< aatch> I'm not too bothered about str though
< strcat> what makes them a primitive type though?
< dbaupp> strcat: hard-coded into the compiler & corresponding to machine
          operations?
< aatch> Does the CPU itself have some notion of it? For most types, no,
         but it does understand about integers and floats.
< Eridius> bstrie: I haven't read any backscroll, but I rather like the
           idea that intrinsic types are lowercased
< Eridius> (not traits though)
< strcat> aatch: LLVM represents signed/unsigned integers as the same type
<@brson> we could turn str and vec into lang items
< steven_is_false> Java has the boxing reason for why int, and such are
                   lower case. There is no such reason for Rust.
< strcat> aatch: uint vs int is a distinction made by rust
<@brson> if str and vec were lang items they wouldn't have to have so
         many awkward traits to hold their impls
<@brson> since they would be user-defined types
< strcat> brson: why not make everything a lang item then? ;p
< aatch> strcat, so? LLVM does make a distinction between signed and
         unsigned versions of operations.
< strcat> aatch: not the integer ops
< dbaupp> brson: that would presumably require DST? (it sounds nice
          though! move more things to libraries.)

Let's try not to get too bikesheddy here.

Arguments in favor of changing to uppercase:

  • Every other type in the language is uppercased, so we get consistency.
  • Will head off questions from new users.
  • We really have no coherent concept of "primitive types", so a distinction doesn't make sense.

Arguments in favor of leaving them lowercase:

  • Slightly easier to type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions