Skip to content

Support running rescript in non-node environments #5530

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

Closed
tom-sherman opened this issue Jul 9, 2022 · 3 comments
Closed

Support running rescript in non-node environments #5530

tom-sherman opened this issue Jul 9, 2022 · 3 comments
Labels
stale Old issues that went stale

Comments

@tom-sherman
Copy link

This is a similar feature request to #4965 but more general.

ReScript isn't a node-only language and so I shouldn't be required to install node just to build my ReScript projects.

Removing the dependency on node would unlock:

  • Deno support via Deno.run
  • Bun support via bun run rescript
@tom-sherman
Copy link
Author

tom-sherman commented Jul 9, 2022

I think moving the compiler frontend (the /rescript script) into a native binary is the way. Combine this with tiny scripts for node, bun, and deno to perform platform switching. So you end up with something like the following structure:

├── linux
│   └── rescript.exe
├── macos
│   └── rescript.exe
├── win32
│   └── rescript.exe
├── rescript
├── rescript.bun.js
├── rescript.deno.js
└── rescript.node.js

rescript.exe now contains all code to run the compiler, websockets and all.

The original rescript script can be the one that npm references, it can look at process.argv to check if we're running with npm/bun and choose the appropriate file.

This solution seems relatively scalable to new JS runtimes coming along, and gives you a full standalone binary to build ReScript projects on systems that don't have any JS runtime.

@footearth
Copy link

I consider the same.
The main rescript project can only provides binary releases of bsb bsc and bsfmt to package releases. The community provides command line release script or binary of node deno and bun more rust and more for their respective environments.

Copy link

github-actions bot commented Oct 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Old issues that went stale label Oct 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Old issues that went stale
Projects
None yet
Development

No branches or pull requests

2 participants