-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new memory behaviour #2189
new memory behaviour #2189
Conversation
@volodya-lombrozo @yegor256 Please have a look at new strictly typed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Graur Overall, I appreciate the idea, but I'm unclear about the rationale behind these restrictions. Would it be possible for you to provide some links or further explanation to help me understand the reasons better? Thank you.
[e] | ||
e > @ | ||
nop | ||
$.equal-to "Memory type missmatch: expected <int>, got <float>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Graur Let's imagine, that int
and float
have the same size - 4 bytes (like in Java). Should we check their types? Or we might compare just size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@volodya-lombrozo Yes, you are right. Thanks!
Moreover there is no chance to compare types if I try to implement it in EO. So we decided to avoid this change
[e] | ||
e > @ | ||
nop | ||
$.equal-to "Not enough memory to write: expected <2^63 - 1>, got <2^63>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Graur Should we throw an exception in that case? Maybe it's better just to write -9,223,372,036,854,775,808
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@volodya-lombrozo I like it, thanks!
@volodya-lombrozo The main reason is to make |
@yegor256 Please have a look |
@rultor merge |
Closes: #761
PR-Codex overview
This PR focuses on ensuring that the memory can only accept one type of data primitives. It also implements error handling for overflow and strict typing for different data types.
Detailed summary