Skip to content
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

All intrinsic integer types #50

Open
HuseyinSimsek7904 opened this issue Mar 13, 2024 · 4 comments
Open

All intrinsic integer types #50

HuseyinSimsek7904 opened this issue Mar 13, 2024 · 4 comments
Assignees
Labels
compiler Anything about the compiler enhancement New feature or request high-priority

Comments

@HuseyinSimsek7904
Copy link
Member

HuseyinSimsek7904 commented Mar 13, 2024

Currently, the compiler only recognizes int intrinsic type. These should also be implemented:

int8    // 1 byte signed integer
uint8   // 1 byte unsigned integer
int16   // 2 byte signed integer
uint16  // 2 byte unsigned integer
int32   // 4 byte signed integer
uint32  // 4 byte unsigned integer
int64   // 8 byte signed integer
uint64  // 8 byte unsigned integer

We should also update the load intrinsics so that they push the correct size of integer after reading. Same applies to the store intrinsics as well.

@HuseyinSimsek7904 HuseyinSimsek7904 added enhancement New feature or request high-priority compiler Anything about the compiler labels Mar 13, 2024
@HuseyinSimsek7904 HuseyinSimsek7904 self-assigned this Mar 13, 2024
@Utkub24
Copy link
Collaborator

Utkub24 commented Mar 18, 2024

Agreed, sized types are cool! But how about

i8    // 1 byte signed integer
u8   // 1 byte unsigned integer
i16   // 2 byte signed integer
u16  // 2 byte unsigned integer
i32   // 4 byte signed integer
u32  // 4 byte unsigned integer
i64   // 8 byte signed integer
u64  // 8 byte unsigned integer

@HuseyinSimsek7904
Copy link
Member Author

HuseyinSimsek7904 commented Mar 18, 2024

I like these kinds of type notations which Rust also uses. But I also want to add some aliases for the i8, u8, i64 and u64 types; char, byte, int, uint.

Is this convention understandable @Utkub24, what do you think?

@HuseyinSimsek7904
Copy link
Member Author

HuseyinSimsek7904 commented Mar 18, 2024

These types will also require a new integer parsing system that allows postfixes to the integers like u, u16, i32, etc... For example 34u16 will push a 16-bit unsigned integer that has the value 34.

I am not very sure about the syntax tho.

@Utkub24
Copy link
Collaborator

Utkub24 commented May 17, 2024

I like these kinds of type notations which Rust also uses. But I also want to add some aliases for the i8, u8, i64 and u64 types; char, byte, int, uint.

Is this convention understandable @Utkub24, what do you think?

Just pick one and be consistent imo, the user can define aliases for them if they so desire.

(use i16 notation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Anything about the compiler enhancement New feature or request high-priority
Projects
None yet
Development

No branches or pull requests

2 participants