Code Monkey home page Code Monkey logo

Comments (1)

toastal avatar toastal commented on September 27, 2024 1

Agreed*. In the past, we had to really jump through some hoops to get this binary into our environment--like Heroku. I had to build an asdf script to help get the binary locally to non-Nix users as well.

*Disagreements: while this does help some setups and team, in the larger scope, delivering binaries via NPM is kind of anti-pattern--and NPM not having checksums means it's not a reliable tool when you could snipe an email and publish malicious code; in newer contracts/teams, we've avoided NPM as much as possible. Really our setups should be robust enough that adding another binary isn't seen as an issue to overcome. PureScript is PureScript, a tool separate and not inside of the Node ecosystem (though in practice has a lot of overlap).

There's also a lot of caveats to consider::

  • what architecture is the user running
  • does that system have glibc or not (I put note in the README about this, failing once to get it in a Alpine Docker container and then later failing to just pull the binary into Nix/NixOS)

These are real problems that would need to be solved. One could go the route of compiling a staticly-linked binary with llvm + musl to get more portability on Linux, but macOS can't handle static binaries so what do you do? We see a loud bunch of ARM-based macOS users now demanding support while the ARM support on Linux and Windows exists but no one bothered to care. There's the BSDs... the list goes on. Making assumptions like isDarwin or isLinux is obviously myopic and NPM is not build to distribute binaries in a meaningful way like this so there's a lot of wheels to reinvent and hope to get right.


If it were me and I had infinite knowledge and time (lol), providing a flake.nix with nixpkgs.pkgsMusl and the like could go a long way--skipping NPM support altogether. Users of Nix could tap into this project with ease as an input and the CI could build/cross-compile a large swath of binaries for various architectures for delivering to everyone else and even containers could be built and the sorry folks using *-compose architectures as well. Everything here though applies to the state that Spago and even the PureScript compiler are in as well--which is the whole reason easy-purescript-nix has to exist, patchelfing the binaries and dynamically linking to where Nix keeps its libs. That's not to say parts of the idea couldn't be used piecemeal like #65.

Between Nix, static bins, and containers, a lot more of the deployment space would be covered than bothering with NPM.

from zephyr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.