Closed tom-sherman closed 4 weeks ago
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.
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.
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.
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.run
bun run rescript