News for hackers. Stuff that matters.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by btown on Wednesday July 27, 2016 @12:39AM (#12170558)
For those interested in this, https://github.com/bloomberg/bucklescript is an alternate (albeit new) OCaml to JS compiler. There's already talk about supporting JSX syntax: https://github.com/bloomberg/bucklescript/issues/162
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by Scarbutt on Wednesday July 27, 2016 @01:05AM (#12170632)
Differences from js_of_ocaml (not an easy find)

Js_of_ocaml takes lowlevel bytecode from OCaml compiler, BuckleScript takes the highlevel rawlambda representation from OCaml compiler

Js_of_ocaml focuses more on existing OCaml eco-system(opam) while BuckleScript's major goal is to target npm

Js_of_ocaml and BuckleScript have slightly different runtime encoding in several places, for example, BuckleScript encodes OCaml Array as JS Array while js_of_ocaml requires its index 0 to be of value 0.

Both projects are improving quickly, so this can change in the future!

Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by rajington on Wednesday July 27, 2016 @01:08AM (#12170640)
I haven't really gotten into much ML yet, and I'm curious to hear what people knowledgeable with OCaml think about http://facebook.github.io/reason/

The name makes it impossible to research to find any blog posts or anything, but the familiar syntax alone might make it at least a first step for me.

Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by LeonidasXIV on Wednesday July 27, 2016 @03:53AM (#12171213)
I don't claim to be knowledgeable with OCaml, but I use it on and off since a couple of years and wrote about my thoughts when it was first released[0]. tl;dr: don't like the syntax, for the most part it's worse than OCaml itself. The rest is alright and helps the OCaml ecosystem as well, the focus on better tooling is good.

[0]: https://xivilization.net/~marek/blog/2016/05/19/reason-lets-...

Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by e_d_g_a_r on Wednesday July 27, 2016 @01:10AM (#12170644)
Speaking for myself, I think Reason is a very good thing and rewriting this in Reason or adding a Reason layer is a goal/TODO.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by rajington on Wednesday July 27, 2016 @01:31AM (#12170709)
That's awesome and great work.

I know it's dumb that the thing holding me back from OCaml is the syntax, but after giving up on an Om project I've come to accept js will always be the greatest common denominator.

Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by lmm on Wednesday July 27, 2016 @05:13AM (#12171448)
Maybe consider Scala? It's an ML family language with more familiar syntax, and also has a Javascript backend.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by e_d_g_a_r on Wednesday July 27, 2016 @02:16AM (#12170874)
I don't blame you, ES6 can be stupid concise and enjoyable. I practice most of my algorithms prep coding in it.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by bsimpson on Wednesday July 27, 2016 @01:48AM (#12170769)
As I recall, Reason is the current project of React originator Jordan Walke and React contributor Cheng Lou. I wouldn't be at all surprised to see a Facebook project emerge that allows you to author React apps in Reason with Bucklescript.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by scriptdevil on Wednesday July 27, 2016 @07:44AM (#12171994)
The search term is reasonml.
Re:Compile OCaml to JavaScript, use ReactJS, bindings to Rea... by jordwalke on Wednesday July 27, 2016 @04:35AM (#12171318)
Sander sent a [Pull Request](https://github.com/facebook/reason/pull/647) to [Reason](http://facebook.github.io/reason/) which adds JSX syntax (which many React developers have found helpful)

Reason doesn't yet work with Edgar(OP)'s React bindings yet, but it could easily (and therefore JSX would work as well).