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

[PoC] support inline/nested records inside of externals#7791

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
zth wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
frominline-records-in-externals

Conversation

@zth
Copy link
Member

@zthzth commentedAug 22, 2025

Closes#7386

Mostly a PoC for now, to see if it was possible to just extend the current mechanisms to this. Feedback appreciated. There are still issues to solve, but this serves as a base for discussion/experimentation.

Support inline record definitions in externals:

@module("node:fs")externalreadFileSync: (string,  ~options: {encoding?: [#utf8 |#ascii |#base64],flag?:string,misc?: {mode?:int,    },  },)=>option<{filename:string,size:string}>="fs.readFileSync"

nojaf reacted with heart emoji
@zth
Copy link
MemberAuthor

zth commentedAug 22, 2025

cc@nojaf

@pkg-pr-new
Copy link

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7791

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7791

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7791

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7791

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7791

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7791

commit:9eaa9be

@tsnobip
Copy link
Member

This would make writing bindings so much easier!!

zth reacted with thumbs up emoji

@@ -0,0 +1,9 @@
@module("node:fs")
external readFileSync: (string, ~options: {
encoding?: [#utf8 | #ascii | #base64],
Copy link
Member

Choose a reason for hiding this comment

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

Would regular variants also work here?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Not inline, no. But you could reference a defined one.

@nojaf
Copy link
Member

Beautiful! Ship it!

zth and tsnobip reacted with hooray emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nojafnojafnojaf left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v12.1

Development

Successfully merging this pull request may close these issues.

Consider allowing inline records inexternal definitions

4 participants

@zth@tsnobip@nojaf

[8]ページ先頭

©2009-2025 Movatter.jp