Live data from Hacker News

Reason: A new interface to OCaml

facebook.github.io

151–160 of 294 posts

Re: Reason: A new interface to OCaml

#151
post #146

I hope this doesn't sound like trolling, but JavaScript's syntax is now a selling point? I kinda-sorta get the reason why people want an actual JavaScript stack on the backend, but I never heard that syntax/semantics brought people from e.g. Rails to Node. Sure, OCaml isn't even the nicest syntax in the ML family, but I'm not sure whether that's worth it, especially considering that almost any "X-like" language often…

Jordan here (I work on Reason)

I've mentioned elsewhere that the primary goal for now was to get the tooling automated as much as possible, so that when we receive common feedback, we can adapt to that feedback and trivially migrate people's code forward.

I don't think JavaScript's syntax is a selling point and I am someone with a lot of JavaScript experience. I also don't think that OCaml's syntax today is a selling point, and I have a bit of OCaml experience. Both of these syntaxes have evolved over time, working within that limited precious syntactic real estate, trying so very hard to maintain compatibility with decisions made decades ago. Reason's approach is totally different in that it knows we won't get it right on the first shot so it puts into place the tooling for upgrading and beautifying as we learn lessons and take feedback from the community. It places the syntax closer to the user, even if only conceptually.

That being said, the current syntax is not intended to be a JavaScript clone by any means. It actually started in the opposite manner - by taking the top 15 complaints about OCaml's syntax, by experienced OCaml programmers (not JS programmers) and fixing them. There were a couple of things that didn't really matter (such as how you express comments) that were just changed to be more familiar because, well.. simply they don't matter, and even experienced OCaml developers want the largest possible set of people to be able to read their code as long as that comes with little other tradeoffs.

Re: Reason: A new interface to OCaml

#152
post #143

It seems to me that Rust would be pretty much strictly better than this. In particular Rust has similar syntax, seems to have all Reason's features plus the linear types and regions/borrowing that allow memory and concurrency safety while still being able to mutate memory and not being forced to use GC. They are aware of Rust since they cite it in their page, so I wonder why they decided to create this instead of usi…

Rust lacks a REPL right? REPL is quite nice for programmer productivity.

There is rusti, but it is limited.

Re: Reason: A new interface to OCaml

#153
post #24
post #19

Earlier quoted context omitted.

Thought it was mostly summed up in the first paragraph... "Reason is a new approachable interface to the OCaml language, with the long-term goal of improving the developer experience by providing a functional syntax and toolchain for writing, building and sharing code quickly and easily."

I think the question was, what's the relationship between Reason and JavaScript?

The same as the relationship between OCaml and JavaScript, plus some braces.

Re: Reason: A new interface to OCaml

#154
post #78

The slowness in Firefox appears to be solely due to this: @media (min-width: 1180px) { body:not(.no-literate) .content-root { background-color: #fdfcfc; -webkit-box-shadow: inset 780px 0 #fff, inset 781px 0 #e7e7e7, inset 790px 0 3px -10px rgba(0,0,0,0.05); box-shadow: inset 780px 0 #fff, inset 781px 0 #e7e7e7, inset 790px 0 3px -10px rgba(0,0,0,0.05); } } Removing it in the Firefox style editor restores normal perfo…

I've been dealing with this lag in firefox for the past 6 or 7 years. It's hilarious to me that they still haven't fixed it. Just one of the reasons I've been extremely negative on firefox.

This is the first time I've seen something like this. I use Firefox full time for development and personal use and do a lot of front-end work. ¯\_(ツ)_/¯

Re: Reason: A new interface to OCaml

#155

Do it provide a usable standard lib? If so, I may try to use it in side project.

There is the small standard library that ships with the compiler. And then there are more extensive ones such as Batteries and Core. It is easy to generate docs in Reason syntax from OCaml projects using `redoc` tool. Here is Reason docs for:

- OCaml compiler's stdlib: http://kcsrk.info/reason_stdlib_docs/index.html

- Batteries: http://kcsrk.info/reason_batteries_docs/index.html

Re: Reason: A new interface to OCaml

#156

I for one welcome the syntax. I run the OCaml meetup in Silicon Valley and syntax is definitely an issue for newcomers. This makes it easier for other programmers to instantly just jump into OCaml/ML rather than ask about what is `in` or what is `let foo = function`, etc etc. EDIT: Hosting a Meetup this friday at 6pm in San Francisco about Reason and how to instantly start using it, http://www.meetup.com/sv-ocaml/eve…

I presume your phrasing is referencing http://knowyourmeme.com/memes/i-for-one-welcome-our-new-inse... except that you actually do welcome the syntax, right?

Re: Reason: A new interface to OCaml

#157

Earlier quoted context omitted.

The Atom Reason plugin uses Nuclide's system for error rendering (in the diagnostics bar), and type hints. But the actual logic for integrating with Merlin has been completely rewritten in Reason itself, and compiled from Reason into JS to run as an Atom plugin. So there are still merlin features missing because the Atom plugin is relatively young, but if you want to help us implement the missing features, it can be…

I love the fact that ocaml compiling to js allows us to configure tools like Atom. I will have a look at the plugin. Thanks for the informations :)

Yeah, if you peak inside the source code, you'll see we've implemented a `Reason` binding to the `Atom` JS plugin API.

Re: Reason: A new interface to OCaml

#158
post #143

It seems to me that Rust would be pretty much strictly better than this. In particular Rust has similar syntax, seems to have all Reason's features plus the linear types and regions/borrowing that allow memory and concurrency safety while still being able to mutate memory and not being forced to use GC. They are aware of Rust since they cite it in their page, so I wonder why they decided to create this instead of usi…

They describe using OCaml significantly, and wanting a migration path to a language with nicer syntax but same power/features.

Re: Reason: A new interface to OCaml

#159
post #7

Earlier quoted context omitted.

Incredible, but you are correct. Pegs 1 CPU in FF and while it loads, it barely scrolls.

Pretty sure it was the gif. I've disabled it. Could you try again?

Thanks for the (many) reports! It's been fixed for a while. No excuse for poor performance!

Re: Reason: A new interface to OCaml

#160
post #55

Earlier quoted context omitted.

Sounds like FF can't handle gifs, but Chrome/Safari do a good job. I've disabled the gif on the main page just to be friendly to FF while I figure out a better approach. Thanks for the report.

I can run the Unreal engine, use google maps but not view your website. I'm not convinced Firefox is at fault here. Is there any interactive functionality that your website offers that would justify extraordinary demands or does it simply display some text and images?

It turns out it was the drop shadows, and only were an issue in Firefox. I don't know what to make of the fact that we can run Unreal but we can't render drop shadows performantly. Maybe we should build web pages using WebGL.
Post reply on HN