ahrefs / atd

Static types for JSON APIs
Other
308 stars 53 forks source link

Add a ReScript output option #410

Open TheSpyder opened 1 month ago

TheSpyder commented 1 month ago

Continuing the discussion I started in https://github.com/ahrefs/atd/pull/375#issuecomment-2058453755

ReScript 11 introduces a new "uncurried" mode, enabled by default. This mode is fundamentally incompatible with the -bs (soon to be -mel) generated output. I have forked the runtime and would like to support both curried and uncurried mode as not everyone can migrate quickly. Converting the runtime wasn't too hard, but I had to abandon the effort when I realised the atdgen output makes use of curried functions (which is totally normal in OCaml code).

Fixing this requires adding a new generated code path for ReScript. If developed hand-in-hand with a new runtime architecture it might be a good opportunity to make use of ReScript-specific features.

Related: #324

TheSpyder commented 4 weeks ago

If this doesn't happen my fork is dead. ReScript 12 will make "uncurried" the only option, and that means it can no longer compile OCaml syntax. https://forum.rescript-lang.org/t/ann-rescript-retreat-roadmap-summary-2024/5275

I'm not saying it must happen, only that I can't do it by myself.