3 ms·
> is there a set of syntax/language/compilers that will allow me to have one codebase, one syntax, and run the server as native code (possibly with nodejs as an
by nathcd 5y ago
> is there a set of syntax/language/compilers that will allow me to have one codebase, one syntax, and run the server as native code (possibly with nodejs as an option) - and use same language for the front-end?
You can use the normal OCaml syntax with the main OCaml compiler and the js_of_ocaml compiler. If you just want something in the ecosystem that's boring and reliable these are almost certainly the way to go.
- antron-prime 5y agoAgreed on Js_of_ocaml as a stable choice. However, even Js_of_ocaml is suffering a slight complication :P There is the recent release of Brr https://erratique.ch/software/brr/doc/ https://erratique.ch/software/brr/doc/, a Js_of_ocaml library replacement (i.e. you keep the compiler but use this instead of the library that comes with Js_of_ocaml). I heard good reviews of Brr, but haven't tried it myself yet. We will probably have a Brr full-stack example in Dream, eventually. Personally, I currently use - Dream on the server (an ancient version, didn't have time to keep up with Dream development in my own app!). - Just plain JS and the JS ecosystem on the client. - ReScript/Melange for compiling a couple files to JS from OCaml so that they can trivially interop with my mostly-JS client.