Psellos
Contemporary Development With Functional Programming

BuckleScript Good and Bad News

August 26, 2020

Since last year I’ve been using BuckleScript to build web apps in OCaml and have been enjoying it very much. However, when I went to the project’s home page recently I found that BuckleScript has been renamed to ReScript and that all reference to OCaml has been removed from the project (as far as I can tell).

In particular, there’s no documentation that describes how to use the standard OCaml syntax with the BuckleScript compiler. Previously there were parallel documents for a new JavaScript-like syntax (based on Reason) and for the standard OCaml syntax. But now there is just a JavaScript-like syntax (different from but similar to Reason).


Although the project blog says they will continue to support the OCaml syntax for a long time, in practice it will be impossible to use OCaml syntax with BuckleScript unless there is documentation. There’s no way to determine the methods used for interoperation with the browser environment. Guessing and on-line chat are not workable replacements.

Unless documentation appears pretty soon, I can’t really recommend using BuckleScript if you want to build web apps using OCaml syntax. Since I’d like my work to be at least a little bit useful to others, I’ll most likely be switching to Js_of_OCaml for future work.

The good news (such as it is) is that OCaml syntax still does work with the BuckleScript compiler. I rewrote the Slide24 example to work with the latest BuckleScript release I could find (version 8.2.0), and it works as well as ever. But it was a bittersweet, nostalgic experience. (Unless, as I say, the BuckleScript team is willing to document the OCaml syntax interoperation interfaces.)

While I was at it, I spent a few days reading up on heuristic search methods (on Wikipedia). I was able to improve the solutions produced by the Solve button significantly using ideas from the fringe search page. These newest solutions are getting a little closer to the inhumanly awesome solutions I have been hoping to see.

You can try out the puzzle and get the sources at the Slide24 page.

Posted by: Jeffrey

Comments

blog comments powered by Disqus