charon icon indicating copy to clipboard operation
charon copied to clipboard

Name things consistently and idiomatically

Open Nadrieril opened this issue 1 year ago • 1 comments

Naming could be improved across the project. Among other things:

  • [x] "assumed" should be renamed to "built-in";
  • [x] Id is a confusing suffix for a rust user: it normally designates integer identifiers only;
  • [x] Similarly, Raw is used in places where a rust user would naturally use a Kind suffix, e.g. TerminatorKind;
  • [ ] Traits and clauses and predicates are subtle things, I think better names would help follow what's happening.
  • [x] Names don't always match between the rust and ocaml sides. Once we're happy with the rust side we should propagate the changes.

Nadrieril avatar Jul 09 '24 08:07 Nadrieril

My current list:

  • [x] Var -> Local: https://github.com/AeneasVerif/charon/pull/645
  • [x] RawStatement -> StatementKind https://github.com/AeneasVerif/charon/pull/805
  • [x] RawTerminator -> TerminatorKind https://github.com/AeneasVerif/charon/pull/805
  • [x] RawConstantExpr -> ConstantExprKind https://github.com/AeneasVerif/charon/pull/805
  • [x] Statement.content -> Statement.kind, Terminator.content -> Terminator.kind, ConstantExpr.value -> ConstantExpr.kind
  • [x] FunIdOrTraitMethodRef -> FnPtrKind, FnPtr.func -> FnPtr.kind
  • [x] RawSpan -> SpanData, Span.span -> Span.data
  • [x] TypeVar/RegionVar/ConstGenericVar -> TypeParam/RegionParam/ConstGenericParam
  • [x] TraitClause -> TraitParam
  • [x] AnyTransId -> ItemId, AnyTransItem -> ItemRef, AnyTransItemMut -> ItemRefMut
  • [ ] DeBruijnVar -> Var? (this one is likely to cause clashes in aeneas)
  • [x] ItemKind -> ItemSource, FunDecl.kind -> FunDecl.src, GlobalDecl.kind -> GlobalDecl.src
  • [x] TraitDecl.parent_clauses -> TraitDecl.implied_clauses, TraitImpl.parent_trait_refs -> TraitImpl.implied_trait_refs
  • [ ] TraitRef -> TraitExpr?
  • [ ] FnPtr -> FnRef?

Nadrieril avatar Sep 12 '24 13:09 Nadrieril