Live data from Hacker News

Type-safe GraphQL with OCaml

andreas.github.io

1–10 of 102 posts

Re: Type-safe GraphQL with OCaml

#3

I wish OCaml had the libraries and community of Go or Rust, I think it'd be the most useful all-around language out there.

I'm hoping the movement around ReasonML[0] could lead to both the web community being able to reap the benefits of OCaml's fundamentals, while also giving people a point of introduction to the OCaml community through web dev.

It has been my experience that the ReasonML community is incredibly welcoming to new comers, and is moving at a break-neck pace to find the right target of being approachable for people who are familiar with JS, but also empowering users to use all of OCaml's power to create web apps that are more simple and correct than they would otherwise be.

[0]: https://reasonml.github.io/

Re: Type-safe GraphQL with OCaml

#4
If ReasonML is able to form a real community, I have high hopes for its long-term prospects. Such an enjoyable language to use! I think their general approach of bootstrapping a community by lowering impedance with the JS ecosystem is a decent one.

In case anyone on the OCaml team is reading this though, there are two language-level changes that I think could do wonders for wider adoption. The first is modular implicits: it feels so kludgy to have to type `a + b` for integers, `a +. b` for floats and `a ^ b` for string concatenation. I know it sounds like a small thing, but it makes the language feel inelegant, and aesthetics are important. The second is a good concurrency story, ideally one that is compatible with JS-style async/await keywords for easy interop.

I know those are both being worked on; I just hope they become available in time to coincide with the wave of interest in ReasonML!

Re: Type-safe GraphQL with OCaml

#5

I wish OCaml had the libraries and community of Go or Rust, I think it'd be the most useful all-around language out there.

I'm hoping the movement around ReasonML[0] could lead to both the web community being able to reap the benefits of OCaml's fundamentals, while also giving people a point of introduction to the OCaml community through web dev. It has been my experience that the ReasonML community is incredibly welcoming to new comers, and is moving at a break-neck pace to find the right target of being approachable for people who are…

I really don't understand why they had to invent a brand new syntax.

Re: Type-safe GraphQL with OCaml

#7
post #5

Earlier quoted context omitted.

I'm hoping the movement around ReasonML[0] could lead to both the web community being able to reap the benefits of OCaml's fundamentals, while also giving people a point of introduction to the OCaml community through web dev. It has been my experience that the ReasonML community is incredibly welcoming to new comers, and is moving at a break-neck pace to find the right target of being approachable for people who are…

I really don't understand why they had to invent a brand new syntax.

Probably because they were first trying to sell an ML internally and it sounded like OCaml/Bucklescript didn't catch on. I think the new syntax is the raison d'etre to some extent.

Re: Type-safe GraphQL with OCaml

#8
post #5

Earlier quoted context omitted.

I'm hoping the movement around ReasonML[0] could lead to both the web community being able to reap the benefits of OCaml's fundamentals, while also giving people a point of introduction to the OCaml community through web dev. It has been my experience that the ReasonML community is incredibly welcoming to new comers, and is moving at a break-neck pace to find the right target of being approachable for people who are…

I really don't understand why they had to invent a brand new syntax.

The short answer is that Reason's syntax is simpler and more enjoyable to use. I simultaneously learned both OCaml and ReasonML syntaxes and find Reason to be much easier to work with.

Perhaps people in Reason core will chime in with a more detailed answer. Here's some official information: https://reasonml.github.io/guide/ocaml/

Re: Type-safe GraphQL with OCaml

#9
post #4

If ReasonML is able to form a real community, I have high hopes for its long-term prospects. Such an enjoyable language to use! I think their general approach of bootstrapping a community by lowering impedance with the JS ecosystem is a decent one. In case anyone on the OCaml team is reading this though, there are two language-level changes that I think could do wonders for wider adoption. The first is modular implic…

I think the problem isn't that + +. and ^ look different, it's that they are symbols.

That's also what makes scala so unapproachable, you get stuff like ++> or =*= that doesn't make any sense.

x + y makes sense to most people

x ^ y not so much

Re: Type-safe GraphQL with OCaml

#10
post #7
post #5

Earlier quoted context omitted.

I really don't understand why they had to invent a brand new syntax.

Probably because they were first trying to sell an ML internally and it sounded like OCaml/Bucklescript didn't catch on. I think the new syntax is the raison d'etre to some extent.

Yes, many devs know stuff with C/Java/JavaScript like syntax.
Post reply on HN