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

Remove Function$ entirely. #7200

Merged
merged 17 commits into from
Dec 18, 2024
Merged

Remove Function$ entirely. #7200

merged 17 commits into from
Dec 18, 2024

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Dec 12, 2024

Change the AST and compiler back-end so that Function$ is not used anymore to encode function definitions.

@cristianoc cristianoc changed the title Remove function$ wip remove Function$ Dec 12, 2024
@cristianoc cristianoc force-pushed the remove_Function$ branch 4 times, most recently from fca8ee2 to 01e5837 Compare December 12, 2024 16:54
@@ -2,11 +2,11 @@

module V4C = {
@res.jsxComponentProps
type props = {}
type props<'a, 'b> = {a: 'a, b: 'b}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mununki are these changes good or bad?

Copy link
Collaborator Author

@cristianoc cristianoc Dec 16, 2024

Choose a reason for hiding this comment

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

Add test to analysis (so it's compiled and uses rescript-react as a dependency) that these compile.
Tested that the same example did not compile on master, so this is the intended transformation that was somehow lost along the way sometime.

de23262

@cristianoc cristianoc changed the title wip remove Function$ Remove Function$ entirely. Dec 13, 2024
@cristianoc cristianoc requested review from zth and cknitt December 13, 2024 13:40
@cristianoc
Copy link
Collaborator Author

@cknitt we can move to testing phase with this.
Eg fix the issue you found.
Once fixed, I have some implementation cleanup left, but would like to add any missing tests first.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 7d4af4a Previous: e1b7fb7 Ratio
Parse RedBlackTree.res - time/run 1.3137930666666666 ms 1.2123143266666667 ms 1.08
Parse Napkinscript.res - time/run 43.116282813333335 ms 39.28006235333333 ms 1.10
Parse HeroGraphic.res - time/run 6.496717546666666 ms 5.13472718 ms 1.27

This comment was automatically generated by workflow using github-action-benchmark.

@cristianoc
Copy link
Collaborator Author

@cknitt all the issues are resolved now, did you test this entirely on one project already?
That's the kind of confirmation needed before moving on with this.

@cknitt
Copy link
Member

cknitt commented Dec 16, 2024

@cknitt all the issues are resolved now, did you test this entirely on one project already?

Yes, did that before, and now just retested with the last commit. Everything builds fine.

However, I found that the editor tooling crashes:

Error: Command failed: /Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.58.0/server/analysis_binaries/darwinarm64/rescript-editor-analysis.exe hover /Users/christoph/projects/cca/inform4/app-common/src/config/ConfigLoader.res 6 16 /var/folders/l3/d1wj17dj2z321tjq9s9fnlsh0000gn/T/rescript_format_file_8986_12 true
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:925:11)
    at Object.execFileSync (node:child_process:961:15)
    at Object.func (node:electron/js2c/node_init:2:2559)
    at Lt (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.58.0/server/out/cli.js:36:5456)
    at Ct (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.58.0/server/out/cli.js:36:5658)
    at aw (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.58.0/server/out/cli.js:42:5630)
    at process.Ph (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.58.0/server/out/cli.js:42:15244)
    at process.emit (node:events:518:28) {
  status: null,
  signal: 'SIGSEGV',
  output: [ null, <Buffer >, <Buffer > ],
  pid: 9733,
  stdout: <Buffer >,
  stderr: <Buffer >

@cknitt
Copy link
Member

cknitt commented Dec 16, 2024

Ok, that seems to be using the analysis exe that comes with the VS Code plugin for some reason.

@cristianoc
Copy link
Collaborator Author

Ok, that seems to be using the analysis exe that comes with the VS Code plugin for some reason.

Great, this PR is ready to go then.
Picking up the right binary is for the TypeScript part for the editor plugin: @zth

@cknitt
Copy link
Member

cknitt commented Dec 16, 2024

Picking up the right binary is for the TypeScript part for the editor plugin: @zth

This is already (mostly) done, but not merged yet: rescript-lang/rescript-vscode#1055

@cristianoc
Copy link
Collaborator Author

This could be squash merged, but it would mess up rebasing #7195
That's a complex PR: won't take risks of introducing issues while merging. I'll rebase merge this.

@cristianoc cristianoc merged commit 4f961ab into master Dec 18, 2024
20 checks passed
@cristianoc cristianoc deleted the remove_Function$ branch December 18, 2024 11:14
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