logoalt Hacker News

mrkeenyesterday at 7:34 PM1 replyview on HN

Ok. More thoughts.

I was trying to see what was special about Crystal in this regard.

It seems like if you took any ML or Haskell-like, you'd have type inference.

Then you could allow shadowing (Rust-style) meaning the same symbol in the source code would be one variable now, and a different variable later.

Then your compiler would need to distinguish x into x1 and x2 so it could track them separately.

So yeah, kind of an SSA I guess!


Replies

buybackoffyesterday at 7:47 PM

Yes, a lexical scope with shadowing