Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Move Option stdlib optimizations into typed pipeline#7921

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
cristianoc wants to merge7 commits intooptions-stdlib-opt
base:options-stdlib-opt
Choose a base branch
Loading
fromoption-stdlib-typed-opt

Conversation

@cristianoc
Copy link
Collaborator

Summary

  • detect real invocations during type checking and annotate the typed tree
  • lower those annotations directly to the existing lambda primitives instead of relying on the Parsetree PPX
  • drop the Parsetree transformer, update docs/tests, and adjust runtime examples to match the new API surface

Testing

  • make test (docstring generator still fails on pre-existing Stdlib_DataView snippets)

chatgpt-codex-connector[bot] reacted with thumbs up emoji
returncategory.name;
let__res_option_opt;
if(incidentId!==undefined){
letincidentId$1=Primitive_option.valFromOption(incidentId);
Copy link
Member

Choose a reason for hiding this comment

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

Output looks worse than the Parsetree version.
ThesePrimitive_option.valFromOption should not be needed.

functiontestPrimitive(){
console.log(42);
letvalue=42;
console.log(value);
Copy link
Member

Choose a reason for hiding this comment

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

Why did we lose the optimization here?

@cknitt
Copy link
Member

As we are doing the transformation on the typed level now, shouldn't we add some type checking tests, too?

```rescript
Js.String.charCodeAt(0, `😺`) == 0xd83d->Belt.Int.toFloat
Js.String.codePointAt(0, `😺`) == Some(0x1f63a)
Copy link
Member

Choose a reason for hiding this comment

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

Are you removing this because it's not really an example forcharCodeAt or because the test failed? (Actually this should be correct / the test should work.)

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Don't know it failed before already. Not sure.

Copy link
Member

Choose a reason for hiding this comment

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

You may need to remove tests/docstring_tests/generated_mocha_test.res and re-run the tests.

letcategory=categoryId!==undefined ?Belt_MapString.get(categories,categoryId) :undefined;
if(category!==undefined){
returncategory.name;
let__res_option_opt=incidentId!==undefined ?Belt_MapString.get(incidents,incidentId) :undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Now the output is the same except for worse variable naming. 🙂
Can we produce the identical output?

@cknittcknittforce-pushed theoption-stdlib-typed-opt branch from5ac5fc9 to5171806CompareSeptember 24, 2025 16:01
@cknitt
Copy link
Member

Rebased after the Docstring test fixes

@cknittcknitt marked this pull request as draftSeptember 25, 2025 14:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cknittcknittcknitt left review comments

Assignees

@cknittcknitt

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@cristianoc@cknitt

[8]ページ先頭

©2009-2025 Movatter.jp