Hacker News new | past | comments | ask | show | jobs | submit login

What is the probability of Ocaml/Reason becoming mainstream?

Reason calls itself Javascript 2030. That's not a completely unreasonable time line for ML languages to go from the small percentage that they have now to being in the top say 5-10 languages used.

React has made the probability much higher. Reason is kinda like JS the good parts + Immutable JS + Typescript + Redux. Plus it works well with React. If your team is using React there's a good chance you'd get a benefit from implementing Reason in a few places with little risk.

I don't see why these two are being lumped together. I see ReasonML needs OCaml, but not that OCaml needs ReasonML. OCaml I expect will become increasingly mainstream - I've started using it instead of rust on personal projects. ReasonML would increase exposure to OCaml, but OCaml in no way needs it to succeed.

ReasonML was written in SML then they switched to Ocaml because everyone at Facebook already knew it and caml4p is a thing.

Because it is "just Ocaml", all the weird parts of Ocaml bleed through the reason language design. No operator overloading, nominal record typing, 3 competing standard libraries (plus the all-too-small actual standard library). The list of oddities is rather long.

SML was and is a better choice. SML has structurally typed objects and first-class constructors. No named arguments, but structurally typed objects do a better job at this (like JS destructuring, but more efficient). Anonymous records are possible. A ref type rather than mutable record fields. Only one `let`. PolyML has shipped a multi-process implementation for years while Ocaml's is still in an unending beta. SuccessorML (SML 2.0) is adding some syntactic niceties along with things like module typeclasses (modules should prevent the typeclass hell of Haskell). Most importantly, SML is a standard with multiple implementations and isn't completely tied to the success of Jane Street.

OCaml has an big presence in European universities, specially in France thanks to INRIA.

Our university was big in Prolog (SWI) and Caml Light back in the day, and they still are, just with Caml Light having been replaced by OCaml.

The only reason I known a bit about SML is because I am a language geek, it is hardly known in this side of the pound.

OCaml's objects and modules are structurally typed.

It doesn't seem odd to me to lump them together. Reason is just an alternate syntax for Ocaml, and because of this the "Reason toolchain" is usable with Ocaml code as well, and with mixed Reason/Ocaml projects.

Interesting, I really like OCaml myself but see it mostly as a fringe language as of today. What makes you think it will become more mainstream?

I think it hits a sweet spot. Not as boring as Go, not as obstinate and distracting as Rust ("I'm sorry, Dave"), not purely functional for those who don't want to go all the way in that direction. I expect people who try those languages and decide "not quite" might try OCaml and find it more flexible and elegant. It's appearing more often in the "who's hiring" posts. There are the characteristics such as compilation speed vs others which could do with being, ahem, compiled into a post somewhere, if not already.

> not purely functional for those who don't want to go all the way in that direction

That's why I first loved it. I liked what I knew of Haskell but was skeptical of the Monadic IO system (I've since warmed to the idea). OCaml was in a perfect sweet spot in my opinion.

Also it feels a bit less abstract in some difficult to define way - I don't think Monads really clicked for me until I was using Options in OCaml.

I'll also second the opinion that as a _language_ OCaml is more ergonomic than Rust. However, I find that Rust is more _community ergonomic_ - it's easier to find libraries and contribute to them. Related to that - the build process is just spot-on. With OCaml, I found myself tripping over obscure errors in my build process about every month or so.

For me, OCaml is a bit like the one that got away.

But I'm excited about the momentum behind the Reason project!

It's mainstream in compiler writing - Hack, Haxe, WebAssembly (Interpreter and Parser), Rust before self-hosting. :-))


I say 30%!

I have no idea, Reason is pretty rad, but I have the feeling since 3.0 it lost steam. I mean they still didn't add async/await

To my knowledge, Reason is just an alternate syntax over OCaml and the two can be converted to each other. Thus, Reason should have the same semantics as OCaml. As OCaml isn’t just targeted at JavaScript, IMO adding async/await sugar for Reason wouldn’t make sense. (I assume that you mean syntax that desugars to JS promises. Correct me if I misunderstood.)

Although, it would be pretty cool if OCaml got some kind of do-notation (like Haskell), a generalization of async/await sugar for any monad structure...

I think you're looking for let syntax (https://github.com/janestreet/ppx_let). It is syntactic sugar for monads and applicatives.

It depends on very random factors and events, like with (almost) any other programming language.

How could anybody rate a probability of some experimental language from Sun research lab - the tiny, fast, garbage-collected, object-oriented language for embedded systems to become mainstream - before the language was renamed from Oak to Java?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact