Hey @mudrz, familiarity with Node was the reason we went with Reason on Node as well. The plan was to get started quickly and migrate to OCaml native later on.
Not yet, but thanks for the idea! Thinking about the answers I found that there is quite some stuff to cover.
We haven’t measured performance yet, neither of Sihl nor of the project using Sihl.
A small anecdote:
One of the main reasons for the switch to native was the quality of packages. We used one of the big database driver implementations of MariaDB on NPM. After switching to the wonderful caqti library, we discovered a bug in our code which lead us to rethink one part of our architecture that gave us a big speed up in database reads. Turns out that database package on NPM behaved weirdly while caqti just told us that the usage is wrong.
If you consider the time to reload the JS files with something like nodemon after compilation, the feedback loop with native is slightly shorter. We didn’t measure, but BuckleScript and the compiler of OCaml 4.08.1 felt about the same.
Yes, the we struggled with some things but mainly due to the fact that we extracted the infrastructure code that became Sihl and did the migration from Reason on Node to OCaml at the same time.
We had to implement our own SMTP over Lwt library for instance and are facing similar issues with multipart file uploads at the moment.
If you are familiar with Node and functional programming and you have to deliver quickly, I would probably recommend to start with OCaml/Reason on Node using BuckleScript, because the output JS is human readable and you know exactly what is running on Node.
But if you have a couple of innovation points extra to spend and want to be super early adopter, I would go with OCaml directly. The ecosystem with regards to web development is getting better every day.
We are working on a Sihl starter project that can be cloned and that showcases a complete Sihl app in OCaml. This will probably cover standard stuff like DB (transactions, pooling), user management, emailing, HTTP routes, server side templates and maybe a simple SPA and some JSON routes using js_of_ocaml.