Skip to content

A "Removed Features FAQ" for historical reference #4632

@bstrie

Description

@bstrie

Inspired by a question on Reddit (http://www.reddit.com/r/rust/comments/178t57/intimidation_factor_vs_target_audience/c83br4f). Basically all it needs to contain is a list of removed features, with a reason for the removal of each. In addition to being fascinating, it would be a good resource for other would-be language designers. Here's what I came up with off the top of my head (pasted from the Reddit thread):

  • Typestate (because nobody used it)
  • Structural records (in favor of nominal records (structs), but I'm not sure of the exact reason)
  • Argument modes (frustrating to use, impossible to learn, horrifying to look at; replaced with borrowed pointers)
  • Classes (because the day after they finished implementing them they realized you could get the same effect from combining impls and structs)
  • Ternary operator (because if is already an expression)
  • Resources (in favor of drop {} blocks within struct definitions, which were then themselves removed in favor of the Drop trait)
  • Explicit move, first via the <- operator and then via the move keyword (now owned types always move unless you explicitly copy them (and even the copy keyword will soon be gone in favor of a compiler-generated .copy() method)
  • Long-style closure expressions (in favor of the shorter || {} syntax)
  • Old-style operator overloading (in favor of the overloading traits in core::ops)
  • comm-style primitives (replaced with pipe-style primitives, which are way faster, more basic, and can be used to implement comm-style if you really want it)
  • Module-wide export declarations (now you denote visibility on the item itself)
  • Mandatory integer-literal and float-literal type suffixes (they were a pain to use, and are now inferred if you leave them off)
  • do-while loops (rarely used, trivial to emulate)
  • fn foo() unsafe { (which was different from unsafe fn() foo, and can be approximated by fn foo() { unsafe {)
  • Guaranteed tail recursion via the be keyword (requires changing the calling convention, which is a performance cost that they just can't afford)
  • The bind keyword (rarely used, syntax was unintuitive, and not difficult to emulate via closures)
  • note statements (not actually sure why they were removed, I'm not sure if they were ever even implemented)
  • (WIP) The static keyword (any method definition without a self argument is static)
  • (WIP) The log, fail, and assert keywords (these can all be done as macros).
  • (WIP) The concepts of both const and pure (likely obviated by the new INHTWAMA work)
  • (Possibly) field-level mutability (in favor of object-wide "inherited" mutability)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions