5 ms·
Wait, I assumed this will be a js-app, but it actually is a executable binary? Is that the courtesy of https://github.com/jordwalke/pesy https://github.com/jor
by a-saleh 8y ago
Wait, I assumed this will be a js-app, but it actually is a executable binary?
Is that the courtesy of https://github.com/jordwalke/pesy https://github.com/jordwalke/pesy ?
For some time I wanted to try ReasonML for server-side development, but for some reason I assumed, that most of the ecosystem would be node.js based.
- cies 8y agoReason is merely a new syntax on OCaml. You can use BuckleScript (BS) to compile to JS, or not use BS to compile to native. There exists a fast http server in native OCaml: https://github.com/inhabitedtype/httpaf https://github.com/inhabitedtype/httpaf
- thangngoc89 8y agohttpaf is quite low level. We need more abstractions on top of that for daily server development
- jordwalke 8y agoOne recent project which builds a usable layer on top: https://github.com/ostera/httpkit https://github.com/ostera/httpkit
- jordwalke 8y agoLet's be a little more specific. "Reason Syntax" is merely a new syntax on OCaml, but ReasonML in general has a much larger scope - which includes every part of the toolchain/workflow up to and including package management, IDE integration, source formatting etc and more.
- deleted 8y ago[deleted]
- rkangel 8y agoSo Reason is to OCaml a little like Elixir is to Erlang - newer syntax, better tooling, same great foundation.
- thangngoc89 8y agoThe ReasonML ecosystem is quite confusing for newcomers. ReasonML could be compiled to a binary out of the box thanks to the OCaml toolchain. Pesy is a tool for making native development easier. Regardings Javascript compilation backend, you only hear about that because it's what the ReasonML team selling.
- a-saleh 8y agoAnd I get that, I think I heard somebody from Reason community to say on some podcast once "We want to get the frontend stuff right first", or something along those lines :-)
- devmunchies 8y agoThat makes more sense to me now why doing server side reason compiles to a node.js app and not a more performant OCaml app. Server is not a priority yet.
- anuragsoni 8y agoServer side reason can already compile to native binaries (thanks to the OCaml compiler). While maybe smaller than the npm ecosystem there are a lot of high quality packages available on the OCaml ecosystem [1] that allow for a very pleasant server side development experience. For example https://github.com/rgrinberg/opium https://github.com/rgrinberg/opium is a really nice high level toolkit. There are database bindings to Postgres, Mysql and the like, and high level interfaces to them like https://github.com/paurkedal/ocaml-caqti https://github.com/paurkedal/ocaml-caqti [1] http://opam.ocaml.org/packages/ http://opam.ocaml.org/packages/
- jordwalke 8y agoHi I'm Jordan and I work on Reason. pesy is just a utility I made to help people create new native Reason projects (like fnm) quickly and easily. It's fun. fnm is a native Reason app. We haven't advertised much of Reason's (OCaml's) native capabilities because we wanted to make sure we've built out a lot of the tooling that makes native development easy - for example https://esy.sh https://esy.sh. Now that a lot of this native tooling is becoming polished, I hope you'll probably start seeing more projects like fnm.
- a-saleh 8y agoAwesome! I looked at Reason several months ago and my impression was, that if you want to do frontend stuff with bucklescript, you are one git-pull and npm install from a working scaffold, but if you want Reason with ocaml for native stuff, you would mostly be scaffolding yourself. I am really glad I was mistaken :)
- jordwalke 8y agoSeveral months ago that was probably correct. Recently, we've released new tools like esy that make it... easy, especially if you come from a JS background or are familiar with JS tooling. There's still a lot to solve, and native is just inherently harder than targeting JS, but a lot of progress has been made recently, and there's more to come.
- schniz 8y agoI feel you - it seems that most ReasonML blogposts are around JavaScript usage, but this is completely native and therefore faster (no VM necessary)