Lua and Python
Lua and Python
Posted Feb 12, 2020 14:22 UTC (Wed) by tau (subscriber, #79651)Parent article: Lua and Python
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.
Posted Feb 12, 2020 16:35 UTC (Wed)
by koh (subscriber, #101482)
[Link] (15 responses)
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.
Posted Feb 12, 2020 17:04 UTC (Wed)
by excors (subscriber, #95769)
[Link] (10 responses)
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.
Posted Feb 12, 2020 18:24 UTC (Wed)
by NYKevin (subscriber, #129325)
[Link] (3 responses)
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).
Posted Feb 12, 2020 19:31 UTC (Wed)
by tau (subscriber, #79651)
[Link] (1 responses)
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.
Posted Feb 13, 2020 8:09 UTC (Thu)
by NYKevin (subscriber, #129325)
[Link]
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."
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.
Posted Feb 12, 2020 19:27 UTC (Wed)
by koh (subscriber, #101482)
[Link] (5 responses)
That reason I can somewhat relate to:
Instead, that is exactly my point:
> [..] it's a pain to learn the subtleties of all of them [..]
> [..] 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.
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.
Posted Feb 13, 2020 9:34 UTC (Thu)
by dvdeug (guest, #10998)
[Link]
So, yes, it seems inevitable that a package manager for Lua on Linux, Mac and Windows is going to be written in Lua.
Posted Feb 13, 2020 13:03 UTC (Thu)
by excors (subscriber, #95769)
[Link] (2 responses)
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 [..]
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.
Posted Feb 23, 2020 11:48 UTC (Sun)
by Wol (subscriber, #4433)
[Link]
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"
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,
Posted Feb 26, 2020 19:02 UTC (Wed)
by Per_Bothner (subscriber, #7375)
[Link]
Or you can use DomTerm. Screenshot here (scroll down to "Python language").
Posted Feb 13, 2020 13:39 UTC (Thu)
by NAR (subscriber, #1313)
[Link]
Posted Feb 13, 2020 7:48 UTC (Thu)
by samlh (subscriber, #56788)
[Link]
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:
Posted Feb 13, 2020 19:30 UTC (Thu)
by jschrod (subscriber, #1646)
[Link]
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.
Posted Feb 19, 2020 22:32 UTC (Wed)
by jo42 (subscriber, #59640)
[Link] (1 responses)
Posted Feb 20, 2020 14:37 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
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.
Posted Feb 12, 2020 18:11 UTC (Wed)
by tzafrir (subscriber, #11501)
[Link]
Lua and Python
Lua and Python
Lua and Python
Lua and Python
Lua and Python
Lua and Python
Lua and Python
> [..] 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 [..]
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.
> [..] 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?
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.
Don't these users just want to switch to a rolling-release distribution?
Lua and Python
Lua and Python
> 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.
Lua and Python
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>
Wol
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
Lua and Python
The thing is, the language-specific package manager might have more functionality than simply downloading dependencies. For example Lua and Python
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
Language package managers are for developers.
https://medium.com/@sdboyer/so-you-want-to-write-a-packag...
Lua and Python
> The basic task is the same as the distribution's PM.
Today I found Conda: »Package, dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN, and more.
Lua and Python
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
Lua and Python