News for hackers. Stuff that matters.
Re:BuckleScript: write JavaScript faster, safer and smaller by e12e on Saturday January 21, 2017 @09:27AM (#13450136)
Why would one prefer reason to ocaml? (Honest question)
Re:BuckleScript: write JavaScript faster, safer and smaller by tomku on Saturday January 21, 2017 @10:53AM (#13450557)
You might find this page from the Reason website useful: https://facebook.github.io/reason/mlCompared.html

It replaces a lot of the idiosyncratic bits of OCaml's syntax with things that feel more appropriate if you're comfortable with other modern languages.

A quick example is tuple types. OCaml declares tuple types as int * int, which makes total sense if you know that tuples are a product type. However, you actually create tuples using commas. Reason throws away the connection to theory and uses the same syntax for types (int, int) and creating values of that type (3, 7).

Re:BuckleScript: write JavaScript faster, safer and smaller by purity_resigns on Saturday January 21, 2017 @09:51AM (#13450232)
Reason's syntax is a little cleaner and it's easier to get up and running with.
Re:BuckleScript: write JavaScript faster, safer and smaller by phpnode on Saturday January 21, 2017 @09:51AM (#13450234)
It is much more like JavaScript than ocaml and so you get a familiar language but one which benefits from all the cool things that ocaml can do.
Re:BuckleScript: write JavaScript faster, safer and smaller by k__ on Saturday January 21, 2017 @11:15AM (#13450671)
Another n00b question: What are "all the cool things that ocaml can do"?

I only saw rather simple typing examples, which didn't seem much different from what TypeScript can do.

On the other hand I read often that ocaml doesn't have runtime errors, which I certainly get with TypeScript.

Re:BuckleScript: write JavaScript faster, safer and smaller by yawaramin on Saturday January 21, 2017 @12:57PM (#13451187)
This is a good overview I think, although it doesn't get into specifics: https://realworldocaml.org/v1/en/html/prologue.html#why-ocam...

Of course the rest of the book is a great read too if you're so inclined.

Re:BuckleScript: write JavaScript faster, safer and smaller by eru on Monday January 23, 2017 @12:10PM (#13463681)
OCaml does have exceptions at runtime (eg if you try to take the maximum of an empty list), but generally your programmes won't have type errors at runtime.