Live data from Hacker News

Python Is Eating the World

zdnet.com

31–40 of 993 posts

Re: Python Is Eating the World

#31
Python's success is richly deserved. The fact that it has been a long time coming (Python is almost 30 years old!) is an indication of the amount of sheer effort involved, and should give heart for all those working on building up the next generation of languages.

Since this forum is likely to have some folks looking towards the future, I found interesting a couple of talks by Python veteran Armin Ronacher [1, 2]. Watching that presentation makes me wonder whether I should think of this in the context of "Worse is better". That said, Python's runtime introspection is such a killer feature that it's difficult to explain how empowering it feels for someone who is relatively new to programming.

[1]: How Python was Shaped by leaky Internals -- https://www.youtube.com/watch?v=qCGofLIzX6g

[2]: A Python for Future Generations -- https://www.youtube.com/watch?v=IeSu_odkI5I

Re: Python Is Eating the World

#32
post #12

Considering Python can power the largest web sites (Netflix, Instagram), I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)? Note: I am an amateur which is likely the reason for my ignorance.

A lot of stuff powered "by Python" is in practice powered by multi-language infrastructures, which can be pretty complex. For example, the Python ecosystem for data science is mostly implemented under the hood in a mix of C, C++, and Fortran, with high-level Python bindings, due to a mixture of legacy reasons and pure Python being too slow. Obviously lots of people still like the end result, but saying this kind of software is in Python is only half the story.

Re: Python Is Eating the World

#33
Python has a lot of problems that really slow down development, but they are all fixable.

The biggest issue, in my opinion, is in dependency management. Python has a horrible dependency management system, from top-to-bottom.

Why do I need to make a "virtual environment" to have separate dependencies, and then source it my shell?

Why do I need to manually add version numbers to a file?

Why isn't there any builtin way to automatically define a lock file (currently, most Python projects just don't even specify indirect dependency versions, many Python developers probably don't even realize this is an issue!!!!!)?

Why can't I parallelize dependency installation?

Why isn't there a builtin way to create a redistributable executable with all my dependencies?

Why do I need to have fresh copies of my dependencies, even if they are the same versions, in each virtual environment?

There is so much chaos, I've seen very few projects that actually have reproducible builds. Most people just cross their fingers and hope dependencies don't change, and they just "deal with" the horrible kludge that is a virtual environment.

We need official support for a modern package management system, from the Python org itself. Third party solutions don't cut it, because they just end up being incompatible with each other.

Example: if the Python interpreter knew just a little bit about dependencies, it could pull in the correct version from a global cache - no need to reinstall the same module over and over again, just use the shared copy. Imagine how many CPU cycles would be saved. No more need for special wrapper tools like "tox".

Re: Python Is Eating the World

#34
post #4

If only its package management were as easy as its syntax... I wish pip worked the same way as npm: -g flag installs it globally, otherwise it creates a local "python_modules" folder I can delete at any time. And optionally I can save the dependency versioning info to some package.json... Instead, pip is a nightmarish experience where it fails half the time and I have no idea where anything is being installed to and…

Meanwhile, all the python developers who have started doing any Js work are saying “I wish npm worked as easy as pip/virtualenv”...

It really isn’t that difficult, it’s just different. Different always seems wrong, at first.

Re: Python Is Eating the World

#35
post #23

Python and JavaScript Ease of use trumping advanced features every time

WRT to Python at least, the skill range is more impressive than the low bar. High-skill programmers can do some pretty advanced things with it, and those advanced things can still be easy to use by lower skilled programmers.

Re: Python Is Eating the World

#36
post #24
post #14

Earlier quoted context omitted.

Here's a simple but less-than-completely-documented way to keep Python package management under control: 1. Don't install anything globally. Don't pip install --user, definitely don't sudo pip install. 2. For each project you want to work on, create a venv. Yes, there are tools for this, but the base venv tool is totally fine. (venv should be included in your Python, but a few distributors like Debian put it in a sep…

Herein lies my problem. If I want to start a Node project I run `npm init` and then `npm install --save` to my heart's content. If I somehow manage to mess it up I just delete node_modules/ and install again. If I want to start a Python project I have to set up venv and remember to put relative paths in front of every command or else it'll run the system version. Sounds simple, but it's still something to always reme…

Just source the activate script and it'll prepend the correct path so that you don't need to do anything else.

Re: Python Is Eating the World

#37
post #12

Considering Python can power the largest web sites (Netflix, Instagram), I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)? Note: I am an amateur which is likely the reason for my ignorance.

> I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)?

What language is Python implemented in? Is it Python, or something else? This tells you that even the implementors of Python don't think Python is suited for everything.

Re: Python Is Eating the World

#38
post #14
post #4

If only its package management were as easy as its syntax... I wish pip worked the same way as npm: -g flag installs it globally, otherwise it creates a local "python_modules" folder I can delete at any time. And optionally I can save the dependency versioning info to some package.json... Instead, pip is a nightmarish experience where it fails half the time and I have no idea where anything is being installed to and…

Here's a simple but less-than-completely-documented way to keep Python package management under control: 1. Don't install anything globally. Don't pip install --user, definitely don't sudo pip install. 2. For each project you want to work on, create a venv. Yes, there are tools for this, but the base venv tool is totally fine. (venv should be included in your Python, but a few distributors like Debian put it in a sep…

    1. pip install --user and sudo pip install are fine actually, they will not interfere with venv, they can co-exist just fine.
    2. yes
    3. probably do "source bin/activate" first, then run 'pip install -U pip'
    4. just run pip install whatever, no need the full PATH
    5. just run python directly, no need the full PATH
    6. run 'deactivate' when you're done for now, 'source bin/activate' when you want to continue/resume sometime later
in fact I like this better than node_modules, the venv layout of bin/include/lib is more natural comparing to the odd name of "node_modules" in my opinion, and I don't need npx etc to run commands under node_modules either, all are taken care by venv with its 'activate' script

Re: Python Is Eating the World

#40
post #12

Considering Python can power the largest web sites (Netflix, Instagram), I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)? Note: I am an amateur which is likely the reason for my ignorance.

> I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)? What language is Python implemented in? Is it Python, or something else? This tells you that even the implementors of Python don't think Python is suited for everything.

PyPy is a python implementation in python (RPython to be exact)
Post reply on HN