(no title)
fiyec30375 | 2 months ago
The main reasons being it is slow, its type system is significantly harder to use than other languages, and it's hard to distribute. The only reason to use it is inertia. Obviously inertia can be sufficient for many reasons, but I would like to see the industry consider python last, and instead consider typescript, go, or rust (depending on use case) as a best practice. Python would be considered deprecated and only used for existing codebases like pytorch. Why would you write a web app in Python? Types are terrible, it's slow. There are way better alternatives.
solatic|2 months ago
With that said... there is a reason why ML went with Python. GPU programming requires C-based libraries. NodeJS does not have a good FFI story, and neither does Rust or Go. Yes, there's support, but Python's FFI support is actually better here. Zig is too immature here.
The world deserves a Python-like language with a better type system, a better distribution system, and not nearly as much dynamism footguns / rope for people to hang themselves with.
uxcolumbo|2 months ago
https://pragprog.com/titles/smelixir/machine-learning-in-eli...
A Practical Guide to Machine Learning in Elixir - Chris Grainger
https://www.youtube.com/watch?v=Es08MRtSkoE
gspr|2 months ago
Huh. I've found Rust's FFI very pleasant to work with. I understand that Zig's is second to none, but what does Python offer in this domain that Rust (or Go) doesn't?
seanw444|2 months ago
Nim. The tooling is still immature though.
NetMageSCW|2 months ago
wiseowise|2 months ago
krzyk|2 months ago
Why replace a nice language like python with anything coming out of javascript?
chpatrick|2 months ago
If TypeScript had the awesome python stdlib and the Numpy/ML ecosystem I would use it over Python in a heartbeat.
christophilus|2 months ago
fiyec30375|2 months ago
hu3|2 months ago
Has shortcomings like all languages but it brought a lot of advanced programming language concepts to the masses!
IshKebab|2 months ago
There are some things that aren't as good, e.g. Python's arbitrary precision integers are definitely nicer for scripting. And I'd say Python's list comprehension syntax is often quite nice even if it is weirdly irregular.
But overall Deno is a much better choice for ad-hoc scripting than Python.
CamperBob2|2 months ago
If ML fulfills its promise, it won't matter in the least what language the code is/was written in.
If it doesn't, it won't matter anyway.
dkarl|2 months ago
(OCaml is probably what I'm looking for, but I'm having a hard time getting motivated to tackle it, because I dread dealing with the tooling and dependency management of a 20th century language from academia.)
rangerelf|2 months ago
https://nim-lang.org
eru|2 months ago
Yes, OCaml would be a decent language to look into. Or perhaps even OxCaml. The folks over at Jane Street have put a lot of effort into tooling recently.
archargelod|2 months ago
https://nim-lang.org
Hasnep|2 months ago
yawaramin|2 months ago
ufmace|2 months ago
fiyec30375|2 months ago
loic-sharma|2 months ago
Disclaimer: I work on Flutter at Google.
wiseowise|2 months ago
rahen|2 months ago
Market pressure. Early ML frameworks were in Lisp, then eventually Lua with Torch, but demand dictated the choice of Python because "it's simple" even if the result is cobbled together.
Lisp is arguably still the most suitable language for neural networks for a lot of reasons beyond the scope of this post, but the tooling is missing. I’m developing such a framework right now, though I have no illusions that many will adopt it. Python may not be elegant or efficient, but it's simple, and that's what people want.
Joker_vD|2 months ago
wild_egg|2 months ago
strunz|2 months ago
hu3|2 months ago
And part of those who still complain are momentarily stuck with it.
Just like survivorship bias. It's productive to ponder on the issues experienced by those who never returned.
josephg|2 months ago
As an example, almost everyone I’ve worked with in my career likes using macOS and Linux. But there are entire software engineering sub communities who stick to windows. For them, macOS is a quaint toy.
If you’ve never met or worked with people who care about typing, I think that says more about your workplace and coworkers than anything. I’ve worked with plenty of engineers who consider dynamic typing to be abhorrent. Especially at places like FAANG.
Long before typescript, before nodejs, before even “JavaScript the good parts”, Google wrote their own JavaScript compiler called Closure. The compiler is written in Java. It could do many things - but as far as I can tell, the main purpose of the compiler was to add types to JavaScript. Why? Because googlers would rather write a compiler from scratch than use a dynamically typed language. I know it was used to make the the early versions of Gmail. It may still be in use to this day.
tayo42|2 months ago
roadside_picnic|2 months ago
Python has multiple excellent options for this: JAX, Pytorch, Tensorflow, autograd, etc. Each of these libraries excels for different use cases.
I also believe these are cases where Python the language is part of the reason these libraries exist (whereas, to your point, for the matrix operations pretty much any language could implement these C wrappers). Python does make it easy to perform meta-programming and is very flexible when you need to manipulate the language itself.
superice|2 months ago
I am probably biased against Python, so take this opinion with a grain of salt, but it feels to me like a whole ecosystem of amateur software devs (but professional ML-engineers, data scientists etc) cobbling together something that barely works.
I’m old enough at this point that I remember the whole old guard of software engineers falling over themselves to hate on JS and Node, call the ecosystem immature, and be quick to point out how that is not “real” software. But in the past 10-15 years it appears JS and Node got their shit together, while Python is still completely and utterly stuck in managing dependencies and environments like it is 2012. And if you ask professional Pythonistas about this, you always get an answer like “oh it’s actually really easy, you must not have taken the time to really look at it, because Python is easy, it’s just pseudocode look how amazing it all is”
I really wish ML hadn’t standarized on Python. As a user of ML tools ans frameworks but not a fulltime ML engineer it just constant pain.
fastasucan|2 months ago
There is no problems with this in modern python if you just use the right tooling.
robomartin|2 months ago
> The main reasons being it is slow, <snip>, and it's hard to distribute.
Don't forget that Python consumes approximately 70x more power when compared to C.
fwip|2 months ago
vovavili|2 months ago
yunnpp|2 months ago
Speed is the least concern because things like numpy are written in C and the overhead you pay for is in the glue code and ffi. The lack of a standard distribution system is a big one. Dynamic typing works well for small programs and teams but does not scale when either dimension is increased.
But pure Python is inherently slow because of language design. It also cannot be compiled efficiently unless you introduce constraints into the language, at which point you're tackling a subset thereof. No library can fix this.
fiyec30375|2 months ago