Skip to content

Luau Implementation #12

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Luau Implementation #12

wants to merge 25 commits into from

Conversation

dibrinsofor
Copy link
Member

@dibrinsofor dibrinsofor commented Feb 4, 2025

Luau implementation of the ifT benchmark with datasheet.

@dibrinsofor dibrinsofor requested a review from hanwenguo February 4, 2025 04:41
@bennn bennn mentioned this pull request Feb 4, 2025
dibrinsofor and others added 11 commits February 11, 2025 09:00
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
@dibrinsofor dibrinsofor changed the title (WIP) Luau Luau Implementation Feb 13, 2025
Copy link
Member Author

@dibrinsofor dibrinsofor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready for another review.

Copy link
Contributor

@hanwenguo hanwenguo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly some format issues, and I feel like this could be merged after solving these. What do you think @bennn?

Thanks to Eric Traut for pointing out [an issue concerning narrowing and subclass of primitive types in Python](https://github.com/microsoft/pyright/issues/9395).
Thanks to Eric Traut for pointing out [an issue concerning narrowing and subclass of primitive types in Python](https://github.com/microsoft/pyright/issues/9395).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why there is a diff; the two lines seem identical

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, tried copying and pasting from master but I could not get rid of it.

Comment on lines -66 to +68
When parameter `<type-checker>` is not provided, the benchmark will run all type checkers. Otherwise, it will run only the specified type checker.
When parameter `<type-checker>` is not provided, the benchmark will run all type checkers. Otherwise, it will run only the specified type checker.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why there is a diff; the two lines seem identical

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Signed-off-by: Dibri Nsofor <[email protected]>
Luau/README.md Outdated
- Language resources:
- <https://www.luau.org/>
- <https://github.com/luau-lang/luau/>
- <https://github.com/luau-lang/luau/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate link, delete or replace with documentation link or something

Luau/README.md Outdated
There are two main options: `typeof()` and `type()`. `typeof()`, comes shipped
with the typechecker and works on both Roblox data types and vanilla data types.

Example: `typeof(x) == "number"` or `type(x) == "number"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace everything in this section with:

Example: `typeof(x) == "number"`

The current description raises more questions than it answers. How are type() and typeof() different? What's the point of type() since the implementation doesn't use it? What are Roblox data types and vanilla data types, and why are they important to the benchmark?

error("not representable in Luau (v0.657)")
end

-- Example predicate_1way
-- success
function _predicate_1way_success_f(x: string | number): never
-- not representable in Luau (v0.657)
-- is "implies" a stronger property than bare is?
-- not representable in Luau (v0.657)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand how different these two bits are: implies x is Number and x is Number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implies is weaker:

  • implies x is Number means "return true ==> x : Number"
  • x is Number means "return true ==> x : Number AND return false ==> NOT(x : Number)"

Try experimenting with the Flow implementation, see what typechecks and doesn't. link to predicate_1way_success playground

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

Successfully merging this pull request may close these issues.

3 participants