joeyh

joeyh at

Well, there is no way I am compiling jQuery and all its dependencies in this state any time soon. -- http://dustycloud.org/blog/javascript-packaging-dystopia/

I think there's an important assumption here: You're compiling. Not the computer.

Historically, distributions have been very heavy on developer labor to get dependency trees packaged up, one piece at a time. This makes hundreds of dependencies a real grind. Also makes it really hard to deal with packaging new versions fast enough.

What automation there is, tends to be tools of the "give me a tarball and I'll give you a skeleton source package that will work with maybe some tweaks, and you can take it from there".

One of the reasons Nix and Guix are interesting to me is that they lift package building from declarative source packages to programs. This could allow writing the "jquery package" program once, and then parameterize it, and apply it to the whole universe of jquery packages.

I think Nix has gone some of this way with haskell packages; at least they seem to be able to add new ones and update existing with very little busy-work. Probably not all the way though.

There are some challenges. Such a program needs to have as an input the current dependency tree of jquery packages. Copyrights still need to be manually reviewed (ugh).

Also, the right versions of things need to be picked when selecting what to package for upgrades.. Or do they? If versioned dependency information is available, the packaging program could lift it into the package manager's dependency system, and simply package all versions of everything, and let the package manager pick appropriate versions. Nix and Guix seem to be making the right choices to allow this kind of universe of versions of software to be used.

This is, perversely, one reason I've been reluctant to dive into either Nix or Guix. Using their languages this way means you're doing Real Programming when you package stuff. I am doubtful about using the Nix language for large-scale programming; it's a weird DSL. And Guix's Scheme is great, but I'm not a schemer. If I were writing a jquery package conversion program, I'd want probably something like Aeson for automatic import of json into strongly typed data, etc. I'd want to be able to compile my system and know if it broke. I'd want to use advanced type system features to prevent foot-shooting by users.

(BTW, I've been kicking around the idea of a haskell to nix EDSL. Apparently there is already a javascript to nix DSL.)

Olivier Mehani, Mike Linksvayer, Stephen Michael Kellat, Christopher Allan Webber and 1 others likes this.