News for hackers. Stuff that matters.
Re:Reason 3 by laylomo2 on Friday October 27, 2017 @07:44PM (#15573154)
As an OCaml developer... I'm feeling just a _little_ jealous of those Reason error messages. Beautiful!
Re:Reason 3 by chenglou on Friday October 27, 2017 @08:44PM (#15573386)
They're available to vanilla OCaml as well (given the constraints listed in the post). Add `"bsc-flags": ["-bs-super-errors"]` in your `bsconfig.json` to turn it on. If you use BuckleScript, that is.

We'll try to make it into a proper compiler plugin, but it's not trivial right now

Re:Reason 3 by mchaver on Saturday October 28, 2017 @02:19AM (#15574188)
Is JSX from ReasonReact usable directly in OCaml/BuckleScript?
Re:Reason 3 by glennsl on Sunday October 29, 2017 @12:43AM (#15577989)
Unfortunately not. It's an inseparable part of the Reason syntax. You can however use either the desugared form:

  ([@JSX] div(~foo=bar, ~children=[child1, child2], ()));
Or a preprocessor that'll give you a JSX-like syntax, but without the type checking: https://github.com/cxa/ppx_bsx
Re:Reason 3 by scottmf on Friday October 27, 2017 @07:55PM (#15573192)
I haven’t looked into it, but since Reason essentially is OCaml and you can convert between them easily, are these improvements not automatically brought to OCaml?
Re:Reason 3 by yawaramin on Friday October 27, 2017 @08:23PM (#15573318)
These 'nice errors' are available on a forked version of the OCaml compiler. The hope is to merge them back into mainline OCaml, but it will be an uphill battle, I think, to convince the OCaml maintainers to merge them, because they're very conservative about changes (which can be good) and may not appreciate the value of friendly error messages (which is not so good).
Re:Reason 3 by avsm on Friday October 27, 2017 @08:58PM (#15573431)
I can assure you that the OCaml maintainers do appreciate the value of friendly error messages, despite your drive-by comments about our ethos.

However, unfinished patches cannot be merged into our mainline tree, and this PR https://github.com/ocaml/ocaml/pull/102 needs some attention to rebase it to trunk, and also to get feedback from testers who may have tried the opam switch and have comments. (associated writeup https://arxiv.org/abs/1512.01897)

Help welcome on this particular patch, and other newer ones from Reason that can be ported over to OCaml and submitted as normal feature improvements.

Re:Reason 3 by yawaramin on Friday October 27, 2017 @09:13PM (#15573467)
Sorry avsm. I looked at the patch you linked to and indeed the OCaml developers are all quite enthusiastic about improved error messages. My mistake. The only real blocker is what we both mentioned I believe, that we all want to go slow to make sure the best possible work is merged in.

By the way, the above patch is different from the one that ReasonML uses. Realistically, the work done by the Reason team is more recent and actually shipped with the BuckleScript platform, so now the blocker is, which direction does the OCaml compiler want to go in.

Re:Reason 3 by chenglou on Friday October 27, 2017 @09:34PM (#15573520)
I was actually gonna talk to Anil, but that got delayed. Let's pick up that discussion again.