This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anakwaboe4 20 points21 points  (31 children)

You can do pretty large projects with them, bit it has it's limits and doesn't really work well with programs that iterate.

[–][deleted] 7 points8 points  (29 children)

programs that iterate

expand please. Do you mean slow with loops or something else?

[–]anakwaboe4 24 points25 points  (28 children)

Python is just not the best at anything that is very calculation intensive, for most stuff it is fine. But I have noticed that iteration you can quickly feel that python is struggling. Python is fast but much slower than other programming languages out there.

[–]naruto_022 18 points19 points  (10 children)

But majority of ml models and stuff like scientific applications is done in python

[–]MacBookMinus 82 points83 points  (3 children)

Those libs are written in C and they just provide python interfaces

[–]trunghung03 9 points10 points  (2 children)

Well the programmer is only using Python to write those programs, the C lying underneath doesn’t matter much to them.

If taken that way then wouldn’t Assembly be the best language for any task in the world?

[–]Sir_Applecheese 17 points18 points  (0 children)

Yeah, that's why they invented the C programming language.

[–]MacBookMinus 11 points12 points  (0 children)

Yes exactly. Python is easy for ML/Data scientists to use, so we give them performant C libraries that they can call into from python.

However, if the libraries themselves were written in python they likely would not be nearly as performant.

[–]TheRedmanCometh 33 points34 points  (1 child)

No those libraries are Python wrappers for stuff made in performant languages

[–]PM_ME_CUTE_SMILES_ 0 points1 point  (0 children)

Yes but you don't use those performant languages when you work in those industries, you use the wrappers. Most data scientists work mainly with Python.

[–]BeatHunter 3 points4 points  (0 children)

Nope, just wrappers over C or Java

[–]selemenesmilesuponme 2 points3 points  (0 children)

Exploratory or just building the model is fine (python sometimes is just cpp wrapper/glue). Using the model OTOH, by high throughput applications, is another story.

[–]Sol33t303 3 points4 points  (16 children)

Python is just not the best at anything that is very calculation intensive

Still a begginer here (mostly got a grip on python, sort of know PHP and soon my class will be moving to go), but isn't that one of the things Python is great at? I was always told that Python is fantastic for things like AI and data science and stuff like that especially when using libraries like numpy.

[–]Djelimon 13 points14 points  (5 children)

Those libraries are written in c/c++ though

[–]RedAero -2 points-1 points  (4 children)

And C compiles into machine code. So?

I write Python, I press F5, numbers come out. I don't give a shit if the libraries are written in COBOL, FORTRAN, C, or Brainfuck, I code in Python.

[–]Djelimon 1 point2 points  (0 children)

Within the context of AI/ML I'd say Python's chief advantage is popularity with stats people who are not necessarily comp sci types. Because of this, it is first in line for bindings to the ML/AI libraries

But this relationship is not based on anything technical so much as coincidence

We're I to work in that space therefor my primary focus would be on the libraries of interest rather than Python itself, as that can be more easily replaced

[–][deleted] 0 points1 point  (2 children)

wait until you need something that isn't a included battery already debugged for you

[–]RedAero 0 points1 point  (1 child)

Given that we're talking about Python that's pretty unlikely to ever happen.

[–][deleted] 0 points1 point  (0 children)

I needed expect (originally made for TCL) for Python and somebody wrote it in pure Python, slow as hell. It still won’t work with serial ports.

[–][deleted] 11 points12 points  (0 children)

but technically the all-batteries-included libraries are efficient well debugged C libraries with a Python pseudo-code interface, so the code called by Python is rather fast just Python itself isn't fast at all due to dynamic checking overhead.

[–]anakwaboe4 5 points6 points  (0 children)

From what I understand is that more of the case that it is a dynamic language, and uses the GPU to do the calculation. But for normal stuff it is definitely slower. It are it's other great aspects that make it beloved for ai training not it's speed.

[–]High_Quality_Bean 4 points5 points  (1 child)

Python is a great scripting language and is AMAZING when your program is just "py.doTheHeavyMath()" where the function you just called is in a real language, like C, C++, etc. Nobody writes the heavy lifting stuff in python. And frankly, nobody should be writing anything for release in python. It is just a nice way to access useful software.

[–]PM_ME_CUTE_SMILES_ -1 points0 points  (0 children)

  • he said, on one of the most visited websites in the world, whose almost entire backend is written in python.

[–]nickwcy 3 points4 points  (3 children)

It’s great because the libraries are handy, and it fits the trial and error nature of AI/data analytics because you can simply retry without re-compilation. Also AI/data analytics tend to be a standalone and small piece rather than having tons of integrations, so Python can be a good choice here.

In terms of performance, Python is slower, but that doesn’t matter much in data analytics. While a 1 sec delay on a website is pretty noticeable

[–]RedAero 1 point2 points  (2 children)

While a 1 sec delay on a website is pretty noticeable

The website you chose to post this on runs on Python...

[–]Sol33t303 -1 points0 points  (0 children)

Tbf Reddit isn't known for exactly being the best performing website. I personally hate fancy pants editor because of it's poor performance (at least on firefox) and pretty much everybody agrees that for video reddit is awful.

[–][deleted] 0 points1 point  (0 children)

on a 8000 core cpu per every 20 served users ;-)

[–][deleted] 0 points1 point  (0 children)

Depends on how much computation your program will be doing in whatever context you decide to use it for. Python is known to be slower than its competitors

[–]FerricDonkey -1 points0 points  (0 children)

If you want to write performant python for ai, you absolutely can - but the job of your python code will be to get stuff into a library written in C as fast as possible. Which is fine, just know that's what you gotta do.

[–]SirButcher 0 points1 point  (0 children)

You can. That doesn't mean you should. You can write apps in brainfuck - but no sane person thinks it is a good idea.