849 karma · joined September 2, 2015
Prepare for the ReasonML hype train though - which I am also on! :P
I started with Heroku, and immediately ran into annoyances - mainly that they treat git as the source of truth, and require anything else to be injected as environment variables (which I find annoying).
AWS was tempting, since we use it at work, but the complexity of configuring what I needed was more than I wanted to deal with.
So I went back to DO (who I already run a couple VPS' with) and cleared off a droplet that I wasn't using, setup a docker droplet and went on my merry way.
However, I will say that once you "pick your poison" and get used to a specific workflow, it becomes vastly easier. The same set of tools work for pretty much any kind of project.
Stuart Halloway gives a great talk[0] where he drunkenly expounds on the importance of REPL driven development and explains his workflow. Honestly, this changed the way I work day-to-day for the better and helped me realize the power that tools like Emacs and Cursive give you; specifically, in-editor evaluation of forms.
For me, I use leiningen for building/dependencies and Emacs/CIDER for my editor. Another good choice is Cursive. Then split it up by what runtime I'm targetting:
Clojure/JVM: - mount for state - ring for HTTP services - clj-http for HTTP requests
ClojureScript/JS: - shadow-cljs for building (with lein integration) - mount for state - macchiato for HTTP services - cljs-http for HTTP requests - reagent for UI
These tools & libraries cover about 80-90% of what I need in a new project, and everything after that is specific to the use case.
Wading through one or two self-contained projects goes a long way into helping you figure out your workflow, and afterwards it's just applying it.
My hope is that in the near future, a lot of the initial friction will be wicked away from the tooling and people will be able to get spun up much faster. Advanced Clojure workflow is a very different way of developing software than most people are used to, though.
I believe he's thought a lot about this problem.
Error handling is annoying, and this is (eventually going to be) fixed in Node.js. In the browser, you can add some listeners: http://2ality.com/2016/04/unhandled-rejections.html
My team recently weighed Clojure(Script) & ReasonML and chose Clojure, because we need to ship and it's not going anywhere.
Elixir and Erlang are basically a DSL for building distributed systems. It doesn't remove all of the complications of that task, but gives you excellent, battle tested, and non-proprietary tools to solve them.
His comment may sound like a bit of an non-sequitur, but really the confusion comes from: it's not a delineation between OCaml and Reason, but native packages vs. packages that are designed with JS interop in mind.
Some native packages can be compiled to JS (e.g. if they don't rely on C FFI), but many interesting ones cannot. js_of_ocaml's version of this story is much better than bucklescript's, but honestly I haven't explored it that much in either one.
So what you're saying - write pure OCaml/Reason code, with some JS interop, without relying on native OCaml/Reason packages - is certainly possible! And is probably the most common way of writing apps using the ReasonML syntax today.
I believe you can get close in ReasonML by making a clear distinction between client (JS) and server (native), and then maintaining a common module of business logic and utilities that you would want to share between the two. This works well up to the point where you want to server-render some HTML, at which point you become sad because you'd love to use the nice ReasonReact component abstraction, but it is not at all portable to native.
Jared Forsythe has been doing a lot of work on making portable applications and libraries in ReasonML, and I do believe that the native compilation story will receive enough love that more people start taking it more seriously - right now the majority of time + energy of the ReasonML team seems to be focusing on honing JS application development, so most of the community is orbiting that use case.
Part of the problem with adopting an ML is that it feels like a huge departure from mainstream software development. From the syntax, to the build tools, to the concepts one uses on a day-to-day basis, it can be hard to slog through to get to the point of feeling productive.
ReasonML is focusing on four things to help alleviate this friction from adoption:
1. Providing a more familiar syntax
2. Providing simple, high quality tooling built on top of a familiar ecosystem
3. Providing high quality documentation that focuses on onboarding developers who are coming from these other ecosystems
4. Providing a "killer-app" that can show the power of the language and draw peoples interest - in this case, Reason's integration with React through it's ReasonReact library and support for JSX.
I think that these 4 things really make a difference when getting "people onboard with an ML," which is why the ReasonML community is something that I'm betting on for the mid- to long-term future.
I've also been slowly working on a small CLI app using ReasonML, ReasonReact and react-blessed.
There definitely is a dearth of ReasonML server-side examples, libraries and frameworks, though - especially compared to all the front-end chatter. bs-express[1] is actually quite nice, but hasn't seen much attention from the larger community. I would highly recommend it if it's something you're interested in pursuing.
The ReasonML team seem to be taking a conservative approach towards what they officially release. They want to make sure that they have a really good plan on how and where to move forward with each of these stories - async, native compilation, cross-platform project, optimizations, etc. Right now they seem to be focusing on creating a really high quality platform for building front-end web applications, but all of these things are on their mind.
I'm actually reminded of the fact that Jordan Walke (initial creator of React) is currently working on a native OCaml/Reason package manager called esy[2], which in my mind is kind of the starting point of the native compilation story: unifying the package and build system of the two ecosystems.
[0]: https://github.com/bsansouci/bsb-native
I definitely agree that Promises - and the whole async story in ReasonML - is pretty poor atm and ripe for improvement in the near future. I'm not sure what you mean by, "remember to resolve them," though?
I've helped Wojtek Czekalski out a bit with a small library called vow[1] that provides a more type-safe way of using Promises in BuckleScript/ReasonML - it needs a bit clean up (update to new syntax, publish to npm) that I might do in the coming weeks. Nick Cuthbert has a PR for making it completely sound[2] that might land soon as well, which might change the API but provide even more safety.
BuckleScript itself doesn't actually do any sort of bundling or minification of the code - in fact, it prides itself in generating "human readable" code that, worst comes to worst, one could modify by hand and not be too hung out to dry.
So in that case, you are at the mercy of the general JS ecosystem when it comes to module bundling, minification, code splitting, etc.
The Google Closure compiler does a lot of the magic behind ClojureScript's advanced optimizations, so theoretically one could leverage those same optimizations with an app compiled by BuckleScript. Unfortunately, I don't have any real-world experiences with this.
However, I do have experience using ClojureScript + Google Closure compiler and can give you a heads up that you might (...probably will) run into issues using Closure compiler with NPM libraries, which the BuckleScript ecosystem relies on.
As someone who recently started working daily with ClojureScript, I'm really crossing my fingers for some of rough edges around Node.js/ES module support in the Closure compiler to be smoothed out soon!
NINJA edit: I have heard good things about rollup with regards to dead-code elimination and other optimizations, but the JS module bundling story is moving at break-neck speed these days and I'm not really keeping up with it - Parcel's a new thing? Jaredly's writing a bundler in ReasonML?? X_X
As a developer, and as a team, it sucks to be told "you must use Java and JavaScript for time immemorial." An easy compromise is that any package/library/service/etc. must target the JVM or JavaScript VM and provide interop with existing code.
Before releasing Go support, it felt like they're simply creating arbitrary friction to keep people on their platform. By expecting your code to export a handler, rather than listen on a port, that has a specific signature, you end up coupling yourself more to the AWS platform. But it also causes a ton of friction for adoption, since testing is more difficult than it should be.
Now with the release of Go, it feels even more that they're putting up these arbitrary gates without a rhyme or reason. How come Go can listen on a port, but other runtimes need to export a handler function? Why did they choose to rely on a Go-specific protocol instead of a common one?
It's frustrating, because I really want to use it (from an ops perspective), but I think my team is going to ditch the proof of concepts we've done because of the friction we've experienced. I'm sure there are valid engineering reasons for these choices, I just don't see them.
That being said, I have a bunch of old projects written in Reason 2 (which still work; the tooling has preserved perfect backwards compatibility[0]), and recently started a new project using the new Reason 3 syntax. It was easy enough to pick up the new syntax in about a day. I haven't done it yet, but my understanding is that it's completely automated[1].
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.
He does a really good job of balancing being funny and interesting (as a person), and giving really good insights into his thought process in playing Hearthstone, building decks, and competing.
Privilege isn't a bad thing. Acknowledging it shouldn't take away from the fact that you had to work really hard, maybe harder than many others, to get to where you are.
Doing this in the general case, I assume, is probably not practical.
chenglou is doing a bit of massaging of the numbers; the claim that there's "only been 10 bugs" isn't quite true. Their code base is 50% ReasonML and 50% JS, and in the ReasonML portion, they've only had 10 bugs - a signification reduction! But they haven't commented on how many bugs are reported in the JS side; we can probably infer that there is many more (since the implication is that there were many more bugs in the old JS code they replaced).
You seem to be frustrated that the messenger.com experience is not up to par and have latched on to the idea that, since the team says they're seeing improvements since introducing ReasonML, that they think they're perfect now. I guarantee you that's not the case.
It sounds like you have some very valid complaints, though, and as a daily user I bet they'd love to hear your feedback. So maybe fill out a bug report with what you just wrote? :)
UI/Front end dev, IMO, can gain quite a bit from static typing. I'm a huge fan of clojurescript, it's what I reach for whenever I want to work on something, but I'm super excited about ReasonML for the future of my team; we struggle with our JavaScript code base right now due to the lack of imposed structure and feedback for our weaker developers.
I love Clojure and I think it makes sense in a lot of domains; most of my back end development is "take this data, transform it according to some nebulous business rules, and poop it out to some other place," which Clojure is amazing for. It's great for applications that don't require a lot of "wiring", and require a lot of "flow". UI programming is, for the most part, wiring things up. It's not that Clojure/Script is not up to the task (I think e.g. re-frame, and the stuff being done with Fulcro, is amazing) but I definitely see the benefits of static typing more in that domain.
And like Rich said, if you're doing UI it will usually completely dominate the problem space you're working in. So pick the right tool for the job. I'm not convinced TypeScript is the way exactly, but like I said, ReasonML and Elm are super promising.