sunjay / brain

A high level programming language that compiles into the brainfuck esoteric programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

References, Mutable References, Moves/Copies

sunjay opened this issue · comments

Reference: &Foo
Mutable reference: &mut Foo
Move/Copy: Foo

The data should be moved if type does not implement Copy, copy otherwise.

  • Fix all variables are mutable references #67
  • Consider making variables immutable by default and add a mut keyword
    • This may not constitute a major semver change depending on the breaking impact
  • Static analysis should prevent using a value after it has been moved
    • Could start by not supporting moves if the static analysis isn't mature enough yet (this would mean non-copy types would always have to be passed by reference--not bad)
  • Automatic referencing/dereferencing