Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Nim on npm #147

Closed
bluenote10 opened this issue May 5, 2019 · 4 comments
Closed

Package Nim on npm #147

bluenote10 opened this issue May 5, 2019 · 4 comments

Comments

@bluenote10
Copy link

bluenote10 commented May 5, 2019

Distributing Nim and Nimble via npm would significantly lower the entry barrier for Javascript developers. A dependency outside the standard ecosystem is often a showstopper for adaption, especially in a workplace environment where ad-hoc installation of a native dependency is not an option. With nim and nimble published as binaries on npm, it would be possible to build an entire Nim-based front-end with a standard npm install/npm run build. This is also a typical requirement for inclusion in JS benchmarks like this.

I have no experience with npm packaging at all, but I'll try to collect a few resources to show how other packages on npm have solved the problem. Maybe we can find someone with more experience to chime in.

Examples of binary packages:

  • The Elm compiler is build in Haskell, and thus required binary distribution. Apparently it uses an npm packages called binwarp
  • node-sass relies on libsass, a C library. It's not fully clear to me how the installation of the binaries is handled, but it looks like it is fetching the pre-packaged binaries for GitHub releases.

Other resources:

@dom96 Do you think we can leverage choosenim by pointing this binwrap package to the choosenim releases?

@dom96
Copy link
Contributor

dom96 commented May 6, 2019

@dom96 Do you think we can leverage choosenim by pointing this binwrap package to the choosenim releases?

Please don't do that. Choosenim is designed to be a standalone tool. If you want to package Nim/Nimble in npm then do so using a tarball containing Nim/nimble binaries.

To be honest I think it's fair if you want to package it, but I don't think supporting it officially is worthwhile. There is already hundreds of ways to install Nim and every additional way makes it more likely that the user will get a broken installation.

@bluenote10
Copy link
Author

bluenote10 commented May 6, 2019

There is already hundreds of ways to install Nim

What I have observed now several times: As far as I know Nim isn't available on any standard web developer package manager, which makes it quite hard to use Nim in a restrictive work environment. If you want to introduce Nim gently for a tiny task like a small JS frontend, you cannot ask a large team of developers to handle that non-trivial dependency manually. It is much more feasible, if the dependency can be handled as part of the standard tooling of the team. Also let's not forget that the dependency of a native C compiler may look completely natural for Nim users targeting C, but for web developers targeting JS it can be a showstopper.

Even for personal use don't underestimate the power of a low entry barrier. For instance I only got into Elm development because I could clone a "starter" repo, type npm install, and I was coding within seconds because distribution followed a standardized procedure.

In my opinion an official npm package is a low hanging fruit to help Nim adaption.

@krux02
Copy link
Contributor

krux02 commented May 8, 2019

If there are problems to package nim+nimble via npm, I will accept them as valid issues on nim (I have no say in nimble). I think nim should be as easy to package as possible. But speaking for myself, I cannot maintain npm packages, but I think it should be as easy as possible for the community to maintain such a package (and other packages for more obscure package managers).

@krux02 krux02 changed the title Distribute Nim+Nimble on npm Package Nim on npm May 21, 2019
@Araq
Copy link
Member

Araq commented Oct 28, 2020

Package it or not for NPM, but we don't.

@Araq Araq closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants