|
|
Subscribe / Log in / New account

Lua and Python

Lua and Python

Posted Feb 12, 2020 14:22 UTC (Wed) by tau (subscriber, #79651)
Parent article: Lua and Python

Sounds like they need a package manager like pip, npm, gem, maven, cargo etc.

Each of these projects have rediscovered and converged upon broadly the same design, so we have a good understanding of how to build such a tool at this point.


to post comments

Lua and Python

Posted Feb 12, 2020 16:35 UTC (Wed) by koh (subscriber, #101482) [Link] (15 responses)

Why is there a need to reinvent package management for every language? The basic task is the same as the distribution's PM. What is so language-specific? My guess is that it is just easier to aggregate all packages using one specific (or one could say "made up") set of packaging rules than to follow a style that makes it easier for distributions to package the software themselves. Of course, granularity is another friction point.

My understanding is that a way forward for the Lua people would be to a) come up with a kind of guide what makes a good "standard library candidate" package. Then, based on that, b) create a comprehensive list of examples that would form said standard library and finally c) try to get these developments packaged/packageable. Instead of writing another package manager. The benefit would be that a) and b) are reusable and referenceable, with a) potentially even containing language-agnostic goals which would make it useful for a broader set of users.

Lua and Python

Posted Feb 12, 2020 17:04 UTC (Wed) by excors (subscriber, #95769) [Link] (10 responses)

There is no distro package manager on Windows or OS X or Android etc, so you need to write your own for your new cross-platform programming language. (You can't copy another language's package manager, because they probably didn't design it to be generic enough, and because they probably wrote it in their own language which you don't understand or like (which is why you made your own language), and because you don't want your language to be weighed down by a dependency on someone else's language.)

And there are too many distro package managers on Linux, so it's a pain to learn the subtleties of all of them and it takes a lot of effort to write your own packages for every one, or else it's a lot of effort to understand and coordinate with the packaging communities of each distro to get them to maintain packages for you. And then distros all have different update schedules and some will be years behind others, so a lot of users will complain they can't use the new language features or libraries that you've written, and will want a way to install updates independently of their distro package manager.

Since you've already had to develop a custom solution for Windows and OS X, it's much easier to use that on Linux too and ignore the distros completely.

Lua and Python

Posted Feb 12, 2020 18:24 UTC (Wed) by NYKevin (subscriber, #129325) [Link] (3 responses)

> There is no distro package manager on Windows or OS X or Android etc, [...]

That's fair.

> And there are too many distro package managers on Linux, [...]

That's a stretch. There are two that you should (maybe) care about: RPM and APT. Everyone else can just fend for themselves as far as I'm concerned. Provide a tarball and let the smaller distros work it out on their own.

> [...] so a lot of users will complain they can't use the new language features or libraries that you've written, and will want a way to install updates independently of their distro package manager.

That applies to all software that anyone has written for any purpose, ever. And I'm only slightly exaggerating.

IMHO the real audience of language-specific package managers is developers. End users are usually going to want a distro-level package (or self-extracting installer, on platforms which lack packages) which may or may not pull in other deps, but should ultimately "just work" without a significant amount of fiddling. They don't necessarily care about getting the latest and greatest, because "just works" is often a much more important property (see for example Debian stable).

Lua and Python

Posted Feb 12, 2020 19:31 UTC (Wed) by tau (subscriber, #79651) [Link] (1 responses)

Language-specific package managers greatly reduce the friction caused by importing third-party libraries. People like to make fun of JavaScript for using libraries containing a few dozen lines of code (that have comprehensive unit tests, non-obvious patches contributed for surprising edge cases, and lots of real-world testing) but this would be utterly impossible in a world where you had to wait for your library to get packaged by Red Hat and Debian, then wait again for Ubuntu to pick it up, and then wait a few years for that package to become available in the stable releases of all three distributions. Low-friction third party library ecosystems are a huge boost for developer productivity.

Also bad third party libraries can fall out of use, bad standard libraries are forever. Standard library code is also subject to the release cycles of its language runtime.

Lua and Python

Posted Feb 13, 2020 8:09 UTC (Thu) by NYKevin (subscriber, #129325) [Link]

I think we agree: Language-specific package managers are essential for local development, and should not go away.

What I'm saying is that, assuming you eventually want your software installed on an end user's computer (i.e. your end users are not a subset of your developers), then you have to play the usual packaging game, or provide tarballs and make it the distro's problem. Telling end users to run pip install foo is not a great idea. Pip is a developer tool. It has a number of sharp edges; for the longest time, received wisdom was (and might still be?) "never run sudo pip, it will break your system."

Lua and Python

Posted Feb 13, 2020 9:38 UTC (Thu) by farnz (subscriber, #17727) [Link]

I think you're underestimating the complexity hidden within DEB and RPM ecosystems; DEB is marginally less forked, because most of the DEB based distros are Debian derivatives, but in both cases, you still need to handle the differences between different distros packaging policy. In other words, the ecosystem is not "RPM and APT"; it's RHEL and Fedora and OpenSUSE and SLES and Mandrake and Mandriva and Debian and Ubuntu and Mint and then some people with NixOS or Arch or Gentoo or Manjaro or other outliers.

Given that you need to do something for macOS and Windows anyway, why not invent a new standard that's uniform for your language users? After all, there are at least 4 major RPM distros to choose from (treating CentOS as RHEL), at least 3 major DEB distros, and a long tail of oddballs, and having one standard option for $language (and letting Linux distros handle the conversion from $language to $distro packaging in any way they see fit) is less work than trying to care about just the major Linux packaging ecosystems, ignoring macOS/Windows/Android/iOS/WASM etc.

Lua and Python

Posted Feb 12, 2020 19:27 UTC (Wed) by koh (subscriber, #101482) [Link] (5 responses)

I've gone through the trouble of checking every language-specific PM in the thread starter's list. None have been created by whoever conceived the respective language. It's therefore not been a case of
> [..] they probably wrote it in their own language which you don't understand or like (which is why you made your own language) [..]

That reason I can somewhat relate to:
> [..] and because you don't want your language to be weighed down by a dependency on someone else's language [..]
However, if that reason sticks it is just another instance of the not-invented-here syndrome which forcing upon users and developers alike is not productive.

Instead, that is exactly my point:
> [..] they probably didn't design it to be generic enough [..]
By definition, distributions' PMs are generic enough for a distribution. How much more generality than the amount of different (in)compatibilities these deal with is required by any language-specific PM? Is any answer to this question really related to a specific programming language - and, if not,- doesn't that mean there is a PM "waiting to get out" which scratches every such generic itch, distros' and language-propagators', alike?

> [..] it's a pain to learn the subtleties of all of them [..]
This is somewhat self-referential, no? There are too many PMs, so let's invent another one - just for us! xkcd comes to mind... The point being, there is an established process for software to get packaged by the major distributions and it is not by creating an own PM.

> [..] a lot of users will complain they can't use the new language features or libraries that you've written, and will want a way to install updates independently of their distro package manager.
Don't these users just want to switch to a rolling-release distribution?

Regarding the non-distribution-like OS(-fragments), there is the question how many of the target audience ("developers"?) actually use just that fragment without anything resembling a PM on that OS, e.g. homebrew, cygwin or the distribution-encompassing Windows Subsystem for Linux.

Lua and Python

Posted Feb 13, 2020 9:34 UTC (Thu) by dvdeug (guest, #10998) [Link]

I think you're missing some of the issues. Let's say that Lua decides to use pip. Does the Python developers want to deal with all the minor issues that Lua is going to need? If no, then you're forking pip anyway, which cuts down on the value of using pip. Either way, now you're using pip; but at the head of this argument is someone not interested in bothering to compile stuff on Windows. I don't want to mess with loading an interpreter on Windows and hoping everything automagically works. They're not using the Linux Subsystem for Windows. Even on Linux, there's always cases with version incompatibility between programs. If you write a program for Lua in Lua, you can usually assume that developers using version X of Lua are happy with the version of the package manager that goes along with version X of Lua. In a world with just Linux, I think things would look a lot of different. But Windows just doesn't have a usable package system for stuff like this, and yet is likely to be the operating system of a fair number of developers.

So, yes, it seems inevitable that a package manager for Lua on Linux, Mac and Windows is going to be written in Lua.

Lua and Python

Posted Feb 13, 2020 13:03 UTC (Thu) by excors (subscriber, #95769) [Link] (2 responses)

> None have been created by whoever conceived the respective language.

I meant they're developed by people within the community around that language, not necessarily the specific people who designed the language itself. pip is written in Python, npm is written in JS, gem in Ruby, Maven in Java, Cargo in Rust.

If you're part of the Lua community and are willing to put in the effort to solve package management, it's probably because you love Lua more than any other language. You wouldn't want to extend e.g. pip to support Lua packages, because then you'd be spending the next several years writing code in Python and you'd much rather be writing Lua.

>> [..] and because you don't want your language to be weighed down by a dependency on someone else's language [..]
> However, if that reason sticks it is just another instance of the not-invented-here syndrome which forcing upon users and developers alike is not productive.

I don't think that's NIH: there are real practical costs to having dependencies. I can go to https://www.python.org/downloads/ and download an installer for Windows that includes a fully-functional pip. But if pip was written in e.g. Perl, either the Python installer would have to tell me to go and download a Perl installer first, or else the Python installer would have to include a bundled copy of Perl (which would make the download much larger, and would likely introduce many bugs since Python people aren't experts in how to install Perl). It's much more convenient to minimise dependencies and keep everything in the same language.

(That's partly a consequence of Windows not having a distro package manager that could trivially download Perl as a dependency of Python. But Python can't solve that problem, they have to just work around it.)

> This is somewhat self-referential, no? There are too many PMs, so let's invent another one - just for us!

Yes, I think it's a kind of tragedy of the commons. Each language develops a package manager to serve its own interests, while the proliferation of language-specific package managers harms the wider community. That is unfortunate but it also seems inevitable, especially in volunteer-driven communities where self-interest is the primary motivation for most work.

As a member of the wider community, it's more effective to just nudge them towards a slightly better direction, than to insist they do something completely different which (based on experience of every other language that was once in the same situation) has no chance of happening.

> Regarding the non-distribution-like OS(-fragments), there is the question how many of the target audience ("developers"?) actually use just that fragment without anything resembling a PM on that OS, e.g. homebrew, cygwin or the distribution-encompassing Windows Subsystem for Linux.

pypistats suggests Windows accounts for 10% of some packages (e.g. opencv-python) and 4% of other packages (e.g. scipy), while Darwin is around 2%-4%. (WSL is presumably counted as Linux, and I hope nobody is still using Cygwin nowadays.)

That's somewhat less than I expected, but still seems large enough that a language shouldn't disregard those developers entirely.

WSL is great but has some limitations, e.g. you can't use matplotlib.pyplot.show() to get a nice interactive view of your graph except by faffing around with X forwarding over SSH (which isn't an optimal experience). I don't know if you could develop a game using OpenGL in WSL (apparently X forwarding supports that but I'm not sure about performance or features), but I'm pretty sure you couldn't develop a game with Vulkan. Sometimes developers do need native platform support, so a language shouldn't rely entirely on WSL.

Lua and Python

Posted Feb 23, 2020 11:48 UTC (Sun) by Wol (subscriber, #4433) [Link]

> Yes, I think it's a kind of tragedy of the commons. Each language develops a package manager to serve its own interests, while the proliferation of language-specific package managers harms the wider community. That is unfortunate but it also seems inevitable, especially in volunteer-driven communities where self-interest is the primary motivation for most work.

That's NOT the tragedy of the commons ... it may be a tragedy, but not that one ...

The real tragedy is

Outsiders: "You should use pip as your language manager"
Insiders: "But what we have works!"
Outsiders: "We've fixed pip so it works for you - you have to use it"
Insiders: "But but but ..."
...
...
...
Outsiders: "What the hell went wrong?"
Insiders: <crickets>

The original tragedy of the commons (like so many since) was driven by OUTSIDE forces disrupting a working eco-system. Often but not always driven by a desire of said outsiders to benefit from the perceived productivity of said eco-system.

Cheers,
Wol

Lua and Python

Posted Feb 26, 2020 19:02 UTC (Wed) by Per_Bothner (subscriber, #7375) [Link]

WSL is great but has some limitations, e.g. you can't use matplotlib.pyplot.show() to get a nice interactive view of your graph except by faffing around with X forwarding over SSH

Or you can use DomTerm. Screenshot here (scroll down to "Python language").

Lua and Python

Posted Feb 13, 2020 13:39 UTC (Thu) by NAR (subscriber, #1313) [Link]

The thing is, the language-specific package manager might have more functionality than simply downloading dependencies. For example rebar3 for Erlang and mix for Elixir can generate project templates, build the project, run tests, create releases, publish to package repository, etc. Both are also extensible - and as they cater for Erlang and Elixir developers, the extensions can be written in Erlang and Elixir. Adding this kind of functionality to e.g. pip would be huge and complicated work, not to mention the dependency on Python for Erlang or Elixir development. So I don't really see the market for a language-agnostic package manager, because it would have less features than the already existing package managers. For projects written in a mixture of languages, there's always make to add the necessary glue.

Lua and Python

Posted Feb 13, 2020 7:48 UTC (Thu) by samlh (subscriber, #56788) [Link]

System package managers are for users.
Language package managers are for developers.

Despite wearing both hats, I want very different things when I'm working on a project, and when I just want to run a thing.

The best language package managers are tightly integrated with the compilation system, so that everything you need to resolve and download dependencies, configure, build, test, and document your code is one simple command away.

This level of tight integration is not something that can be easily abstracted to work for multiple langauges.

See this article for a nice overview of the considerations you need to keep in mind when designing a language package manager:
https://medium.com/@sdboyer/so-you-want-to-write-a-packag...

Lua and Python

Posted Feb 13, 2020 19:30 UTC (Thu) by jschrod (subscriber, #1646) [Link]

> Why is there a need to reinvent package management for every language?
> The basic task is the same as the distribution's PM.

No. Language package managers integrate with development environments, distribution PMs don't do that. E.g., they are often used to provide templates for new projects in a way that is "best practice" for the given language or project. Maven integrates with Eclipse or other Java IDEs, RPM or DEB doesn't. Besides, I don't want to install every development library system-wide just because I need it for some experimentation. I want to try it out in my development environment without impacting my system setup.

Incidentially, usage of distribution PMs for development lead to preferred usage of stuff like Docker, which IMHO is a problem in itself. (Especially, when the developer's version is thrown over to ops and put into production; something that seems to happen 99.99% of the time. Horrible, to deploy such setups without a proper devops setup that cares for dependency and security management.) But, I digress. Coming back to your next question:

> What is so language-specific?

Please note, that this is a different question. A development PM is different from a distribution PM because it is used in development, not because it is specific for a language.

On the question why different language development communities chose to implement their own PMs, others have already given adequate answers: It's not a technical issue, but usually an organizational, deployment, and portability issue.

Lua and Python

Posted Feb 19, 2020 22:32 UTC (Wed) by jo42 (subscriber, #59640) [Link] (1 responses)

Today I found Conda: »Package, dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN, and more.

Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language.«

Lua and Python

Posted Feb 20, 2020 14:37 UTC (Thu) by mathstuf (subscriber, #69389) [Link]

My issues with Conda are similar to those many have with distro systems: either you're all the way in or you're a leaf. There are some systems where you get libraries from the vendor (higher than libc) that "have" to be used on that platform. There's work on getting Conda to accept those, but it's like trying to get RPM to accept your custom installed X11 (that isn't controlled by RPM itself).

It's a nice idea, but I see it mainly as a(nother) distribution mechanism rather than a development base or any kind of omni-solution.

Lua and Python

Posted Feb 12, 2020 18:11 UTC (Wed) by tzafrir (subscriber, #11501) [Link]

The article did mention LuaRocks.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds