this post was submitted on 22 Dec 2025
23 points (100.0% liked)

Technology

41050 readers
124 users here now

A nice place to discuss rumors, happenings, innovations, and challenges in the technology sphere. We also welcome discussions on the intersections of technology and society. If it’s technological news or discussion of technology, it probably belongs here.

Remember the overriding ethos on Beehaw: Be(e) Nice. Each user you encounter here is a person, and should be treated with kindness (even if they’re wrong, or use a Linux distro you don’t like). Personal attacks will not be tolerated.

Subcommunities on Beehaw:


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 3 years ago
MODERATORS
 

Why are most machine learning models (not frameworks) written in Python? Even through almost any programming language can be used for machine learning?

you are viewing a single comment's thread
view the rest of the comments
[–] tal@lemmy.today 17 points 2 days ago* (last edited 2 days ago) (1 children)

My impression from what code I've looked at is that little computation is done by the Python code itself, so there's little by way of gains to be had by trying to use something higher-performance, which eliminates a lot of the reason one would use some other languages.

Python's cross-platform, albeit with a Unix heritage, so it doesn't create barriers there. It's already widely-used, a mature language that isn't going anywhere and with a lot of people who know it.

It's got an ecosystem for distributing libraries over the network, and there's a lot of new code going out and being distributed rapidly.

Python isn't statically-typed. Static typing can help write more-robust code. If you're writing, say, the next big webserver, I'd want to have that checking. But for code that may often be running internally in a research project


and this is an area with a lot of people doing research


a failure just isn't that big a deal. So, again, some of the reasons that one might use another language aren't there.

And I imagine that there's also inertia. Easier to default to use what others would use.

If you have another language in mind, you might mention that, see if there might be more-specific things. I could come up with more meaty plausible guesses if what you were wondering is something like "why isn't everyone using SmallTalk?" or something.

[–] ryannathans@aussie.zone 6 points 1 day ago (1 children)

YouTube does alright being written in python, and being strongly typed Python is leaps and bounds beyond the JavaScript that I am now seeing on the server side 🙃

[–] unique_hemp@discuss.tchncs.de 1 points 1 day ago (1 children)

No sane person is putting plain JS on the server nowadays, it's TS by far most of the time.

[–] ryannathans@aussie.zone 3 points 1 day ago

Unfortunately I have to deal with the insane