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

Compiler Milestone 2: More realistic FT subset #3742

Open
8 of 15 tasks
Tracked by #3692
SupunS opened this issue Jan 29, 2025 · 8 comments
Open
8 of 15 tasks
Tracked by #3692

Compiler Milestone 2: More realistic FT subset #3742

SupunS opened this issue Jan 29, 2025 · 8 comments
Assignees
Labels

Comments

@SupunS
Copy link
Member

SupunS commented Jan 29, 2025

The goal of this milestone is to support most of the language features needed for the FT transfer transaction and contracts.

FT (everything expect closures)

Preview Give feedback
  1. jsproz
  2. Technical Debt
    turbolent

Not needed:

  • Entitlements: purely static
  • Swap statement
  • Assignment with second value
@turbolent
Copy link
Member

@SupunS We might also want to add scoping to the list, as there are a few TODOs in the compiler for that

@turbolent
Copy link
Member

@jsproz Can you please add your name to the item(s) you're working on? That way we can avoid accidental duplicate work. Thank you!

@SupunS
Copy link
Member Author

SupunS commented Feb 5, 2025

We might also want to add scoping to the list, as there are a few TODOs in the compiler for that

I wasn't sure if we actually need any scoping at the compiler level, other than functions. Didn't run into any case where we would need such. So left those alone for now. Maybe we can create an issue, but might not actually need to do anything there, and all it need could be to clean-up the TODO s.

@bluesign
Copy link
Contributor

bluesign commented Feb 5, 2025

one item I saw (I know you didnt implement yet scoping but as a note ) function argument shadowing and interface post conditions I saw recently when playing with your PR.

@turbolent
Copy link
Member

@SupunS Not sure, but from what I can see, it looks like all comparison operators (<, ≤, etc.) are already implemented in the compiler and the VM. Was there anything left to be done there?

@SupunS
Copy link
Member Author

SupunS commented Feb 5, 2025

@turbolent I had added those operators for Int type along with the default function generation (6ac49ca), because it was needed in some of the tests.

So what's left is to support the same for other numeric types / or make the existing opcode generic. But maybe that can wait till we port the number values?

@turbolent
Copy link
Member

@SupunS Ah, I see! It looks like at the moment we only have a basic Int type, and once we have added the other numeric value types, we can generalize support for them.

To begin with, we can maybe make the int* arithmetic instructions polymorphic and have them work for all integer types (e.g. have IntAdd work for Int, UInt, Int8, etc.)?

Later we can optimize this and add dedicated sets of instructions for each type (UIntAdd, Int8Add, etc.). I feel like that's just a lot of code we need to add for little gain.

@SupunS
Copy link
Member Author

SupunS commented Feb 5, 2025

Yeah, agree! Having a dedicated instruction for each type would be an overkill. Given NumberValue interface in the interpreter already support these operations, maybe we can follow the same here, and have just one instruction for all number values (e.g: NumericAdd/NumberAdd).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants