logoalt Hacker News

Borrow-checking without type-checking

59 pointsby jamiitoday at 2:55 AM15 commentsview on HN

Comments

Panzerschrektoday at 5:21 AM

In my programming language I have some sort of "borrowing" too (although it's named differently). But my language has no dynamic typing, only static typing is used and thus all checks are compile-time and have no runtime cost. Why bothering with dynamic typing and paying runtime costs for it?

show 2 replies
drabbiticustoday at 8:45 AM

Can someone help confirm whether I understand correctly the semantics difference between the final-line eval of

    x^
vs.

    x*
?

It seems like either one evaluates the contents of the `box`, and would only make a difference if you tried to use `x` afterwards? Essentially if you final-line eval `x^` and then decide you want to continue that snippet, you can't use `x` anymore because it's been moved. Awkwardly, it also hasn't been assigned so I'm not sure the box is accessible anymore?

Serhii-Settoday at 7:30 AM

[dead]