Skip to content

Extract runtime functionality into separate Runtime_* modules (part 1) #6841

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

Merged
merged 6 commits into from
Jul 7, 2024

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Jun 29, 2024

Currently, the compiler relies on the presence of the Js and Belt modules for some runtime functionality. However, we are moving to Core as our new standard library and should therefore not rely on Js or Belt being present (these will likely become optional packages at some point). See also #6836.

Therefore, any runtime functionality the compiler relies on should be extracted into separate modules for this purpose. I have used the naming convention runtime_*.res for these modules. They currently remain in the others directory because for the source files in the existing runtime directory (caml_*.res), the corresponding .cm* files are not part of the npm package.

This PR is a first part of the required work.

@cknitt cknitt force-pushed the runtime-cleanup branch 5 times, most recently from bf96018 to 20d2fd6 Compare June 30, 2024 19:37
@cknitt cknitt force-pushed the runtime-cleanup branch from 20d2fd6 to 2f2230a Compare July 6, 2024 15:34
@cknitt cknitt changed the title WIP: Runtime cleanup Runtime cleanup part 1 Jul 6, 2024
@cknitt cknitt changed the title Runtime cleanup part 1 Extract runtime functionality into separate Runtime_* modules Jul 6, 2024
@cknitt cknitt changed the title Extract runtime functionality into separate Runtime_* modules Extract runtime functionality into separate Runtime_* modules (part 1) Jul 6, 2024
@cknitt cknitt marked this pull request as ready for review July 6, 2024 18:26
@cknitt cknitt requested a review from cristianoc July 6, 2024 18:26
Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

Looks great.
Something to keep in mind is some of these paths are used in the vscode extension.
See e.g. Packages.ml:

                      promiseModulePath = ["Js"; "Promise"];

So I'd say do a quick grep in that repo, and mark all the relevant paths that have changes in an issue on the rescript-vscode repo so they can be adapted at some point.

CC @zth

@cristianoc
Copy link
Collaborator

Btw, in this case Promise.import seems something where no action is required on the extension side, just it won't appear in autocompletion anymore, which is a good thing. But, it's good to create an issue so it can be checked properly.

@cknitt
Copy link
Member Author

cknitt commented Jul 7, 2024

So I'd say do a quick grep in that repo, and mark all the relevant paths that have changes in an issue on the rescript-vscode repo so they can be adapted at some point.

The Js modules are not going away yet though. So I think for now nothing should break in rescript-vscode?
I think it will be enough to review rescript-vscode at the point when the Js and Belt modules become optional?

@cknitt cknitt merged commit eacc273 into rescript-lang:master Jul 7, 2024
19 checks passed
@cknitt cknitt deleted the runtime-cleanup branch July 7, 2024 16:37
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.

2 participants