News for hackers. Stuff that matters.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by a-saleh on Thursday January 24, 2019 @05:50AM (#18987557)
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 ?

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.

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by jordwalke on Thursday January 24, 2019 @06:45AM (#18987842)
Hi 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. Now that a lot of this native tooling is becoming polished, I hope you'll probably start seeing more projects like fnm.

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by a-saleh on Thursday January 24, 2019 @07:05AM (#18987943)
Awesome!

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 :)

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by jordwalke on Thursday January 24, 2019 @07:15AM (#18987983)
Several 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.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by cies on Thursday January 24, 2019 @06:21AM (#18987718)
Reason 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

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by jordwalke on Thursday January 24, 2019 @06:34AM (#18987791)
Let'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.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by rkangel on Friday January 25, 2019 @05:31AM (#18996934)
So Reason is to OCaml a little like Elixir is to Erlang - newer syntax, better tooling, same great foundation.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by thangngoc89 on Thursday January 24, 2019 @06:27AM (#18987752)
httpaf is quite low level. We need more abstractions on top of that for daily server development
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by jordwalke on Thursday January 24, 2019 @06:35AM (#18987800)
One recent project which builds a usable layer on top: https://github.com/ostera/httpkit
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by thangngoc89 on Thursday January 24, 2019 @06:22AM (#18987727)
The 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.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by a-saleh on Thursday January 24, 2019 @07:07AM (#18987948)
And 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 :-)
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by devmunchies on Thursday January 24, 2019 @10:07AM (#18989264)
That 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.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by anuragsoni on Thursday January 24, 2019 @11:10AM (#18989896)
Server 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 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

[1] http://opam.ocaml.org/packages/

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by schniz on Thursday January 24, 2019 @07:05AM (#18987946)
I feel you - it seems that most ReasonML blogposts are around JavaScript usage, but this is completely native and therefore faster (no VM necessary)