![]() |
|
![]() |
| You have no idea what I'm actually doing, yet you are convinced something bad is bound to happen, although you can't say what exactly that bad thing will be.
That's not useful feedback. |
![]() |
| I feel like most things that will benefit from moving to multiple cores for performance should probably not be written in Python. OTH "most" is not "all" so it's gonna be awesome for some. |
![]() |
| Yes, this is similar to how Go works. IIRC the same approach was available in Python as a library, “greenlet”, but Python’s core developers rejected it in favour of `async`/`await`. |
![]() |
| I think it wouldn’t work as nicely with python, which deeply builds on C FFI. Java has a different history, and almost the whole ecosystem is pure, making it able to take advantage of it. |
![]() |
| C++ and python are not the only options though.
Julia is one that is gaining a lot of use in academia, but any number of modern, garbage collected compiled high level languages could probably do. |
![]() |
| Yes, but then extensions can already release the GIL and use the simple and industrial strength std::thread, which is orders of magnitude easier to debug. |
![]() |
| Sure! I tried pybind11, and some other things. cppyy was the first I tried that didn't give me any trouble. I've been using it pretty heavily for about a year, and still no trouble. |
![]() |
| > should not be written
IDK what l should and shouldn't be written in, but there are a very large # of proud "pure Python" libraries on GitHub and HN. The ecosystem seems to even prefer them. |
![]() |
| it may not be tactful but it sure is factful (even if that last word is ungrammatical, at least the sentence is poetical). he he he.
jfc. guido knows ;), this thread is getting weirder and weirder, creepier and creepier. are you literally implying that I should lie about known facts about python slowness? "tactful" my foot. then I guess the creators of PyPy and Unladen Swallow (the latter project was by Google) were/are not being tactful either, because those were two very prominent projects to speed up Python, in other words, to reduce its very well known slowness. There is/was also Cython and Pyston (the latter at Dropbox, where Guido (GvR, Python creator) worked for a while. Those were or are also projects to speed up Python program execution. https://en.m.wikipedia.org/wiki/PyPy https://peps.python.org/pep-3146/ Excerpt from the section titled "Rationale, Implementation" from the above link (italics mine): [ Many companies and individuals would like Python to be faster, to enable its use in more projects. Google is one such company. Unladen Swallow is a Google-sponsored branch of CPython, initiated to improve the performance of Google’s numerous Python libraries, tools and applications. To make the adoption of Unladen Swallow as easy as possible, the project initially aimed at four goals:
]Your honor, I rest my case. |
![]() |
| don't worry about unpopularity, bro. worry about being true. the rest will take care of itself. if not, you are in the wrong company, forum, or place, and better to work on getting out of there. |
![]() |
| https://news.ycombinator.com/item?id=40949564
^ read. The OP responds in the thread. tldr, literally what I said: > It also makes everything slower (arguable where that ends up, currently significantly slower) overall. longer version: If there was no reason for it to be slower, it would not be slower. ...but, implementing this stuff is hard. Doing a zero cost implementation is really hard. It is slower. Where it ends up eventually is still a 'hm... we'll see'. To be fair, they didn't lead the article here with: > Right now there is a significant single-threaded performance cost. Somewhere from 30-50%. They should have, because now people have a misguided idea of what this wip release is... and that's not ideal; because if you install it, you'll find its slow as balls; and that's not really the message they were trying to put out with this release. This release was about being technically correct. ...but, it is slow as balls right now, and I'm not making that shit up. Try it yourself. /shrug |
![]() |
| FWIW, I think the concern though is/was that for most of us who aren't doing shared-data multiprocessing this is going to make Python even slower; maybe they figured out how to avoid that? |
![]() |
| If I had a penny for every time I gave up on compiling C++ software because there's no way to know what dependencies it needs, I'd be a millionaire. Python at least lists them. |
![]() |
| I’m not going to refute your points. If you’re going to wear rose-tinted glasses about all of the bad parts about python, that’s fine, I also like python. |
![]() |
| Right so; I'll try that next time. Thanks. I just go by the very prominent "pip install X" on every pypi page (as well as "pip install .." in many READMEs). |
![]() |
| Its more probable that you are trying to install the deps in the system python. And using pip instal xxxxx -u will install them in your user directory rather than the system. I'm pretty sure modern Ubuntu warns you against doing that now anyway.
If you're installing for a small script then doing python -m venv little_project in you home dir is straightforward, just active it after [1] I'm using rye[2] now and its very similar to Rust's Cargo, it wraps a bunch of the standard toolchain and manages standalone python versions in the background, so doesn't fall into the trap of linux system python issues. [1]https://docs.python.org/3/library/venv.html [2]https://rye.astral.sh/ |
![]() |
| This is the truth right here. The issues are with people using (not officially) deprecated tools and workflows, plus various half baked scripts that solved some narrow use cases. |
![]() |
| Optional static typing, not really. Those type hints are not used at runtime for performance. Type hint a var as a string then set it to an init, that code still gonna try to execute. |
![]() |
| 'dynamic' in C# is considered a design mistake and pretty much no codebase uses it.
On the other hand F# is much closer to the kind of gradual typing you are discussing. |
![]() |
| Is java dynamically typed as well, then? It does reify generics, so only some part is type checked, what is the level at which it is statically/dynamically typed? |
![]() |
| > In practice it’s quite usable
It would be super helpful if the interpreter had a type-enforcing mode though. All the various external runtime enforcement packages leave something to be desired. |
![]() |
| https://github.com/python/mypy
> Python itself doesn't do that The type syntax is python. MyPy is part of Python. It's maintained by the python foundation. Mypy is not part of CPython because modularity is good, the same way that ANSI C doesn't compile anything, that's what gcc, clang, etc are for. Mojo is literally exactly the same way, the types are optional, and the tooling handles type checking and compilation. |
![]() |
| The interpreter does not and probably never will check types. The annotations are treated as effectively meaningless at runtime. External tools like mypy can be run over your code and check them. |
![]() |
| I think static typing is a waste of time, but given that you want it, I can see why you wouldn't want to use Python. Its type-checking is more half-baked and cumbersome than other languages, even TS. |
![]() |
| Protection from untrusted input is something that has to be considered in any language.
Not yet been a real world concern in my career, outside webforms, which are handled by framework. |
![]() |
| Python 3.12 introduces a little bit of JIT. Also, there is always pypy.
For efficient dependency management, there is now rye and UV. So maybe you can check all those boxes? |
Really excited for this. Once some more time goes by and the most important python libraries update to support no GIL, there is just a tremendous amount of performance that can be automatically unlocked with almost no incremental effort for so many organizations and projects. It's also a good opportunity for new and more actively maintained projects to take market share from older and more established libraries if the older libraries don't take making these changes seriously and finish them in a timely manner. It's going to be amazing to saturate all the cores on a big machine using simple threads instead of dealing with the massive overhead and complexity and bugs of using something like multiprocessing.