Live data from Hacker News

Python Is Eating the World

zdnet.com

891–900 of 993 posts

Re: Python Is Eating the World

#891
post #5

Earlier quoted context omitted.

Use Conda envs!

please no. As someone who has to look after a bunch of servers used by researchers, conda is the biggest cause of things failing for everyone. conda installs stuff all over the place and its very easy to install conflicting stuff in the same place. I just wish that either venv was automatic, or at least the second thing you learn in python.

Are you sure you're talking about Conda's virtual envs? Everything gets installed into the folder /envs/my-env-name.

Re: Python Is Eating the World

#892

Holy Crap! What a lot of irrational, hyperbolic hate for Python. I think everybody should spend their first couple of years working in Fortran IV on IBM TSO/ISPF. No dependency management because you had to write everything yourself. Or maybe [edit: early 90's] C or C++ development where dependency management meant getting packages off a Usenet archive, uudecoding and compiling them yourself after tweaking the config…

Here's some rational "hate" for Python then. I just returned to Python for the first time in a little while to collaborate on a side project and ran into a few tricky-to-debug errors that caused a fair bit of lost time. Know what the errors were? In one case, I was iterating over the contents of what was supposed to be a list, but in some rare circumstances could instead be a string. Instead of throwing a type error,…

Are you blaming Python for shitty design? It's a dynamic language. All dynamic languages have those issues.

Re: Python Is Eating the World

#893

Earlier quoted context omitted.

How stable is python to run a full trading / quantitative algorithm on? I feel there are benefits for every language. I am just curious if super stable and scalable conditions can be met on python.

What do you mean by "stable"? FORTRAN will give you super scalable conditions. I don't think you really meant that either... do you have a GPU cluster at work?

Sorry couldn’t respond due to fault segmentation.

Re: Python Is Eating the World

#894

Earlier quoted context omitted.

How stable is python to run a full trading / quantitative algorithm on? I feel there are benefits for every language. I am just curious if super stable and scalable conditions can be met on python.

>How stable is python to run a full trading / quantitative algorithm on? JP Morgan operates a ~30 million LOC Python platform for trading and analytics. (related talk: https://www.youtube.com/watch?v=ZYD9yyMh9Hk ) Yes, there are very, very large working python codebases in fields out there that demand correctness. I'm honestly getting tired of the static typing circlejerk that has entered the industry.

Btw, jpmorgan dev team is rediculous because support is so massive the only way new projects get done is by hiring massive amounts of people / consultant firms and then lay offs.

Not saying there is a problem, I’m sure some people like to have their throat taken out when the trade doesn’t execute at markdown price.

Anyways I don’t have a problem with that type of pressured enviorment. I’m moreso pointing out people’s need for comfort of solution rather then sustainability. Getting started is more difficult so many are turned away.

Also some of the computation python can do is very powerful and I would trust it if I was no risk besides myself going balls deep.

Re: Python Is Eating the World

#895

Earlier quoted context omitted.

"Inexcusable". You know this started in 1989 and its major competition was Perl and TCL, right? The same issues exist in C, C++, Java and nobody seems to be complaining about those at the same volume.

50% of C++ devs don't use a package manager and 27% rely on a system package manager [1]. You don't hear C++ devs complaining about these issues not because they're happy with the state of dependency management in C++ but because there's a very low rate of adoption for package management systems. That, and the state of dependency management in C++ was so bad for so long that it's viewed as a fact of life. 1. https://…

Also with C and C++ your dependencies compile with your code into a single binary, unless you explicitly opt into using a library, and when you do it becomes a package manager's issue not yours.

Re: Python Is Eating the World

#896
post #42

Earlier quoted context omitted.

>Most people just cross their fingers and hope dependencies don't change Is there anything wrong with pip freeze > requirements.txt and then pip install -r requirements.txt ? This would install the exact versions

I've had a good experience with pip-tools ( https://github.com/jazzband/pip-tools/ ) which takes a requirements.in with loosely-pinned dependencies and writes your requirements.txt with the exact versions including transitive dependencies.

Take my upvote. This has helped us a ton. So nice that it resolves dependencies. Only issue we're running into is that we don't use it to manage our dependencies for our internal packages (only using it at the application level). I've been advocating we change so that we simply read in the generated requirements.txt/requirements-dev.txt in setup.py

Re: Python Is Eating the World

#897
post #884

Earlier quoted context omitted.

Static typing means that types are figured out statically by looking at the source code, and type errors are detected then when it notices a mismatch. Dynamic typing means that types are worked out at runtime by looking at live objects when code operating on them executes. Strong typing means that types cannot be substituted for other types. In C, you can write `int x = "one"` and the char * (address of) "one" is aut…

"Dynamic typing" is really just case analysis at runtime. Every static language is capable of dynamic typing, it's not some feature that statically typed languages lack. A dynamic language is really just a static language with one type.

Why aren't statically typed programs really just dynamically typed programs where all the types happen to be statically inferable?

Re: Python Is Eating the World

#898
post #852

Earlier quoted context omitted.

Not automatically coercing values is all that strong typing means. Getting a type error before you run the program is static typing. They're separate axes, and both useful to talk about in a language.

> Not automatically coercing values is all that strong typing means. It's at best a colloquial term and it's misleading to non-technical management.

[deleted]

Re: Python Is Eating the World

#899

Earlier quoted context omitted.

>In one case, I was iterating over the contents of what was supposed to be a list, but in some rare circumstances could instead be a string. Instead of throwing a type error, Python happily went along with it, and iterated over each character in the string individually. I've been using python for about 13 years professionally and I wrote up a list of "things I wish python would fix but I think probably never will" an…

> I wrote up a list of "things I wish python would fix but I think probably never will" What else is on your list? I'd be interested to see what other parts of Python you would wish to change.

Among other things:

* Implicitly casting strings, integers, dates, etc. to boolean (e.g. "if x" being true if x is a non empty string). Cause of more unexpected bugs that I can count, but would cause massive headaches if implemented and memories of the the 2-to-3 transition would scare anybody away from doing this I think.

* Treating booleans as integers (True + True = 2). Probably wouldn't cause that many headaches if implemented but everybody still seems to think it's a neat idea for some reason.

* Treating non-package dependencies of pip packages (e.g. C compilers, header files) as something that is either the package's problem or the OS's problem. Nobody looks at this problem and thinks "I should solve this".

Re: Python Is Eating the World

#900

Earlier quoted context omitted.

The solution to this is Poetry. https://poetry.eustace.io It's good. Projects should use it.

I agree. Most of the issues the parent mentions have been solved with poetry and pipenv. And if you need "to create a redistributable executable with all your dependencies". You can either use pyinstaller [0] or nuitka [1] both of which are very actively maintained/developed and continually improving. [0]: https://github.com/pyinstaller/pyinstaller [1]: https://github.com/Nuitka/Nuitka

Pipenv is plagued with problems and issues. It takes half an hour to install dependencies to our project. The —keep-outdated flag doesn’t (didn’t?) work, so I don’t know if my pipfile is being modified because the constraints require changing versions or because the package manager is errantly updating versions to latest. There are mixed messages about the kind of quality the project aims for. I would not recommend.

Frankly I’ve been burned enough that I won’t use any new packaging technology for Python because everyone thinks they’ve solved it, but once you’re invested you run into issues.

Post reply on HN