Hacker News new | ask | show | jobs
by needlesslygrim 502 days ago
I think this criticism is silly. Here's what your first example would look like in a language with keywords (where reasonable, perhaps like C#) instead:

  pub fn play<lifetime p>(in out self, player: mut ref AnimationPlayer lifetime p, new_animation: AnimationNodeIndex, transition_duration: Duration) -> mut ref AnimationPlayer lifetime p
But, this is still confusing! Let's remove even more symbols, and make the syntax more obvious by removing abbreviations:

  PUBLIC FUNCTION Play
  LIFETIMES
    P
  PARAMETERS
    IN OUT Self
  Player AS MUTABLE REFERENCE TO AnimationPlayer WITH LIFETIME P
  NewAnimation AS AnimationNodeIndex
  TransititionDuration AS Duration
  RETURNS MUTABLE REFERENCE TO ActiveAnimation
  BEGIN
  ...
  END
IMO, using keywords instead of symbols for references, lifetimes, etc, would just make Rust overly verbose, and there's a reason BCPL used braces instead of BEGIN/END :^)