What does HackerNews think of fnm?

🚀 Fast and simple Node.js version manager, built in Rust

Language: Rust

#70 in Hacktoberfest
#50 in JavaScript
#23 in Node.js
tangent: fnm https://github.com/Schniz/fnm is faster than nvm and much cleaner in its shell integration.
This looks really promising. I love seeing these tools written in languages other than the thing they're targeting.

As an example I use fnm (https://github.com/Schniz/fnm) for managing JavaScript versions. It runs so fast (compared to nvm) I'm inclined to think something went wrong and it silently failed, but it never does!

I asked #node.js on libera, and they put me `fnm` [1], after being finally being fed up with how slow `nvm` was--haven't noticed any differences other than now things have been really fast.

[1] https://github.com/Schniz/fnm

Author here. A few other Rust projects to note that I didn't mention in the original post I've since found:

- Boa (JS engine in Rust) – https://github.com/boa-dev/boa

- RSLint (JS/TS linter in Rust) – https://github.com/rslint/rslint

- Node version manager in Rust – https://github.com/Schniz/fnm

If you know of any other popular ones, let me know. I'm keeping a list :)

I've been writing a lot for Reason and OCaml last few years, but the majority of it target BuckleScript and React. My front-end bias alone means it's a better stack than any other alternatives mentioned in this thread (and I even find it more productive than TypeScript), so take it with a grain of salt.

I do use ocaml-graphql-server and such a lot to write small services, but I often don't interact with databases or build complex backends that would require a bigger back-end webdev ecosystem. Most of my native development happens far from the cloud, and mostly around CLI and GUI tools for which I adore OCaml and recently Reason (https://github.com/revery-ui/revery).

> cumbersome types, typeclasses, lack of type annotations sometimes hurts

I've grown to really like the explicitness of OCaml actually. Nothing implicit or circular, and I can just read a module from top to bottom. The lack of type annotations don't bother me as much with tools such as Merlin, and I find that the amazing type inference lets me prototype code as fast as dynamic languages.

> - what are the current reasonable options for a StdLib? Last I checked, the default lib was still very poor, while JaneStreet's I found barely documented.

I use Containers (https://github.com/c-cube/ocaml-containers/), Lwt, and a few other small libraries like Rresult and Bos pretty heavily. For a big application with many contributors I'd still suggest giving Core another try as it's very well thought out and extensive (compared to npm-style dozens of dependencies you need to introduce with different API designs). I must say that even though I'm pretty used to reading type signatures and jumping to interface files for documentation (and even prefer it to tutorial style docs in markdown), and wouldn't say Core's documentation is _poor_, I agree with you at some level. Because of how it's built and split up across different packages and modules, it gets pretty tiring having to power through many levels of indirection every time you want to look something up.

> - Multicore I guess I can forgive, it's not like there are any other modern GC languages that make multi-threading particularly easy (with the possible exception of Java).

I find that, compared to some other languages I've used, my naive and readable implementation in OCaml last much longer before I need to optimize it. I do use Lwt_preemptive threads that call C code and subprocesses often, but usually because of the nature of the problem I'm solving and not as a parallelization technique.

> - What's an example of a recent codebase written in "modern" OCaml / Reason?

Most open source projects I can think of are libraries and tools such as compilers, but here are some real-world applications off the top of my head:

- https://github.com/onivim/oni2 (native, desktop)

- https://github.com/SVdotCO/pupilfirst (bucklescript, react)

- https://github.com/Schniz/fnm (native, CLI)

Some of the cool stuff I saw in the wild:

https://github.com/osener?language=reason&tab=stars

https://github.com/osener?language=ocaml&tab=stars

Hope this helps! I think with the recent convergence around tools such as dune, opam, esy, it is a great time to start writing OCaml again.

There are some really cool projects popping up with ReasonML - here are a few:

- A package manager like NPM, but for native code: https://github.com/esy/esy

- A fast Node version manager: https://github.com/Schniz/fnm

- A fast replacement for dotenv-cli: https://github.com/ulrikstrid/reenv

- A fast JS bundler: https://github.com/fastpack/fastpack

- A native language server: https://github.com/jaredly/reason-language-server

The OCaml language and toolchain is very powerful... and I do believe ReasonML makes it more approachable, at least for a wider audience of developers comfortable with JavaScript-style syntax.

I think because of community interest and the need for a good general-purpose, efficient language. Here are some interesting community-developed projects:

- A cross-platform native-compiling GUI library with a React-influenced design: https://github.com/revery-ui/revery

- A lightning-fast Node version manager: https://github.com/Schniz/fnm

- Erlang-like multicore actors: https://github.com/ostera/reactor

That said, it's early days and the ecosystem has to (and will) mature a lot.