ReScript M1 native binares call for testing

We used to support it via Rosetta, this release will enable native support for Apple Sillicon which means better performance.

Note you can install it via npm i rescript@10.0.0-dev.1 on your M1 machines.

  • Printf/Format was removed.
    See here and here for why it is removed

  • The reason syntax has a very complicated dependency that M1 support is not planned.

Testing are appreciated – Hongbo


It works great here, thanks for all the awesome releases!

On first install it took a very long time, ~3 mins, to do yarn add -D rescript@m1 and when it eventually completed rescript didn’t work. I had to install one more time, which wasn’t slower than usual, and after that it worked.

I tried on this m1 with the command yarn add rescript@10.0.0-m1 which I got from the list of version available after trying yarn add rescript@m1. npm i rescript@m1 takes forever and fails.

ProductName:	macOS
ProductVersion:	11.4
BuildVersion:	20F71

Installing takes a long time and then after it does install, you get these errors when you try running rescript or rescript build.

Hope this helps. Let me know if you require any follow up on my part.


Similar story here. ~4 minute install and similar error messages. Unable to build the project.

ln -s ../byterun/afl.c afl.c                                                       
ln -s ../byterun/bigarray.c bigarray.c                                                        
make[3]: *** No rule to make target `none.o', needed by `libasmrun.a'.  Stop.                 
make[3]: *** Waiting for unfinished jobs....                                                  
make[2]: *** [makeruntimeopt] Error 2                                                         
make[1]: *** [opt.opt] Error 2                                                                
make: *** [world.opt] Error 2                                                                 
    throw err;                                                                                
Error: Command failed: make -j9 world.opt && make install                                     
    at checkExecSyncError (node:child_process:690:11)                                         
    at Object.execSync (node:child_process:727:15)                                            
    at (/Users/Jaap/Documents/development/family-five/app/node_modules/rescript/s
    at provideCompiler (/Users/Jaap/Documents/development/family-five/app/node_modules/rescrip
    at Object.<anonymous> (/Users/Jaap/Documents/development/family-five/app/node_modules/resc
    at Module._compile (node:internal/modules/cjs/loader:1092:14)

It failed for me at install time

Then I tried the newer 10.0.0-dev.1 which seemed to include a binary. That one worked pretty well. It compiled 50% faster. I would expect more of a performance boost, given comparable executable speedups between rosetta <> arm. However 50% is a great speedup.

Would it be possible for refmt to use the intel binary instead of failing if you have any Reason file in the project. Easily resolved in own projects, but some dependencies might still have Reason files. And even if you don’t use the reason files (not included in bs-dependencies) it does still try to compile them and fails unless you delete the Reason files from node_modules. This might be a bug?

Thanks for the update.
Is your benchmark ppx free?
It is likely your ppx may dominate the build time.

I only use graphql-ppx, but I use an m1 version of that ppx. I know from testing that only a small fraction of time is spend in the ppx compared to the ReScript compiler. Regardless it’s pretty good 10s for a full compile of a 40kloc codebase.

A ppx free benchmark would be helpful, otherwise, it is hard to draw a conclusion about the build performance since ppx can do pretty much anything.