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

feat(compiler)!: create sets with [] instead of {} #5729

Merged
merged 29 commits into from Feb 23, 2024
Merged

Conversation

Warkanlock
Copy link
Collaborator

@Warkanlock Warkanlock commented Feb 19, 2024

Based on #4843

Description

Implemented new syntaxis for the Set and MutSet keywords. From now on, sets will be defined using the identical syntaxes used for Arrays with the difference that there won't be any implicit definition of a set (before it was plain {})

Example

let set : Set<num> = Set<num> [1,2,3];

I limited myself to adding more tests since this was more a functionality related to all the tests we already had in place.

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

BREAKING CHANGE: Set literal syntax ({1, 2, 3}) is removed. Use [] with an explicit Set<T> instead.

@Warkanlock Warkanlock requested a review from a team as a code owner February 19, 2024 20:52
@monadabot
Copy link
Contributor

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Slack.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @skorfmann
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented Feb 19, 2024

Console preview environment is available at https://wing-console-pr-5729.fly.dev 🚀

Last Updated (UTC) 2024-02-23 15:31

@Warkanlock Warkanlock changed the title chore(wingc): initial commit to support new syntaxis for set definition feat(compiler): support new syntaxis for set definition Feb 19, 2024
@monadabot
Copy link
Contributor

monadabot commented Feb 19, 2024

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 59ms±0.51 61ms±0.63 +2ms (+2.68%)🟥
jsii_small.test.w -t sim 526ms±24.3 509ms±5.42 -17ms (-3.27%)⬜
jsii_small.test.w -t tf-aws 732ms±7.24 736ms±5.22 +5ms (+0.65%)⬜
functions_10.test.w -t sim 636ms±5.15 654ms±14.53 +18ms (+2.82%)⬜
functions_10.test.w -t tf-aws 2382ms±13.09 2372ms±17.38 -9ms (-0.39%)⬜
jsii_big.test.w -t sim 2966ms±13.32 2983ms±6.99 +17ms (+0.56%)⬜
jsii_big.test.w -t tf-aws 3180ms±12.89 3187ms±16 +7ms (+0.21%)⬜
functions_1.test.w -t sim 539ms±3.04 543ms±4.53 +4ms (+0.7%)⬜
functions_1.test.w -t tf-aws 973ms±7.79 977ms±6.19 +4ms (+0.37%)⬜
empty.test.w -t sim 501ms±4.44 507ms±5.29 +6ms (+1.1%)⬜
empty.test.w -t tf-aws 718ms±6.2 722ms±4.52 +3ms (+0.45%)⬜
hello_world.test.w -t sim 546ms±6.69 549ms±5.69 +4ms (+0.66%)⬜
hello_world.test.w -t tf-aws 1678ms±10.86 1695ms±9.95 +17ms (+1%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 61ms 59ms 62ms 1ms 1ms
jsii_small.test.w -t sim 509ms 495ms 521ms 5ms 8ms
jsii_small.test.w -t tf-aws 736ms 724ms 749ms 5ms 7ms
functions_10.test.w -t sim 654ms 637ms 699ms 15ms 20ms
functions_10.test.w -t tf-aws 2372ms 2313ms 2399ms 17ms 24ms
jsii_big.test.w -t sim 2983ms 2968ms 2998ms 7ms 10ms
jsii_big.test.w -t tf-aws 3187ms 3159ms 3222ms 16ms 22ms
functions_1.test.w -t sim 543ms 531ms 550ms 5ms 6ms
functions_1.test.w -t tf-aws 977ms 965ms 992ms 6ms 9ms
empty.test.w -t sim 507ms 492ms 520ms 5ms 7ms
empty.test.w -t tf-aws 722ms 714ms 735ms 5ms 6ms
hello_world.test.w -t sim 549ms 538ms 564ms 6ms 8ms
hello_world.test.w -t tf-aws 1695ms 1677ms 1726ms 10ms 14ms
Last Updated (UTC) 2024-02-23 15:37

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 19, 2024
@MarkMcCulloh MarkMcCulloh changed the title feat(compiler): support new syntaxis for set definition feat!(compiler): create sets with [] instead of {} Feb 19, 2024
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 19, 2024
@MarkMcCulloh MarkMcCulloh changed the title feat!(compiler): create sets with [] instead of {} feat(compiler)!: create sets with [] instead of {} Feb 20, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 20, 2024
Copy link
Contributor

@MarkMcCulloh MarkMcCulloh left a comment

Choose a reason for hiding this comment

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

Overall looks good, just a couple nits and a fix for the test

examples/tests/invalid/container_types.test.w Show resolved Hide resolved
libs/tree-sitter-wing/grammar.js Outdated Show resolved Hide resolved
libs/tree-sitter-wing/grammar.js Outdated Show resolved Hide resolved
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 22, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 22, 2024
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
Warkanlock and others added 3 commits February 23, 2024 06:23
Co-authored-by: Mark McCulloh <Mark.McCulloh@gmail.com>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
Warkanlock and others added 5 commits February 23, 2024 16:00
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Feb 23, 2024
Copy link
Contributor

mergify bot commented Feb 23, 2024

Thanks for contributing, @Warkanlock! This PR will now be added to the merge queue, or immediately merged if warkanlock-set-syntax is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit c92b9e7 into main Feb 23, 2024
14 checks passed
@mergify mergify bot deleted the warkanlock-set-syntax branch February 23, 2024 15:42
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.59.0.

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.

None yet

3 participants