frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Altermagnets: The first new type of magnet in nearly a century

https://www.newscientist.com/article/2487013-weve-discovered-a-new-kind-of-magnetism-what-can-we-do-with-it/
108•Brajeshwar•2h ago•27 comments

Show HN: Improving search ranking with chess Elo scores

https://www.zeroentropy.dev/blog/improving-rag-with-elo-scores
86•ghita_•3h ago•20 comments

KDB-X: KX releases FREE Commercial KDB license

https://www.defconq.tech/blog/From%20Elite%20to%20Everyone%20-%20KX%20Community%20Edition%20Breaks%20Loose
12•AUnterrainer•50m ago•2 comments

Chain of thought monitorability: A new and fragile opportunity for AI safety

https://arxiv.org/abs/2507.11473
39•mfiguiere•3h ago•10 comments

Pgactive: Postgres active-active replication extension

https://github.com/aws/pgactive
189•ForHackernews•8h ago•58 comments

Mkosi – Build Bespoke OS Images

https://mkosi.systemd.io/
22•leetrout•1h ago•3 comments

How and where will agents ship software?

https://www.instantdb.com/essays/agents
5•stopachka•12m ago•0 comments

Weave (YC W25) is hiring a founding AI engineer

https://www.ycombinator.com/companies/weave-3/jobs/SqFnIFE-founding-ai-engineer
1•adchurch•59m ago

Shipping WebGPU on Windows in Firefox 141

https://mozillagfx.wordpress.com/2025/07/15/shipping-webgpu-on-windows-in-firefox-141/
278•Bogdanp•11h ago•111 comments

Cloudflare 1.1.1.1 Incident on July 14, 2025

https://blog.cloudflare.com/cloudflare-1-1-1-1-incident-on-july-14-2025/
447•nomaxx117•14h ago•299 comments

I'm switching to Python and actually liking it

https://www.cesarsotovalero.net/blog/i-am-switching-to-python-and-actually-liking-it.html
172•cesarsotovalero•10h ago•263 comments

How I lost my backpack with passports and laptop

https://psychotechnology.substack.com/p/how-i-lost-my-backpack-with-passports
45•eatitraw•1d ago•37 comments

Mill: A better build tool for Java, Scala, and Kotlin

https://mill-build.org/mill/index.html
35•lihaoyi•2h ago•11 comments

What's happening to reading?

https://www.newyorker.com/culture/open-questions/whats-happening-to-reading
49•Kaibeezy•3d ago•113 comments

'Gentle Parenting' My Smartphone Addiction

https://www.newyorker.com/culture/infinite-scroll/gentle-parenting-my-smartphone-addiction
16•fortran77•2h ago•15 comments

Tilck: A Tiny Linux-Compatible Kernel

https://github.com/vvaltchev/tilck
233•chubot•14h ago•44 comments

Thunderbird: Fluent Windows 11 Design

https://github.com/Deathbyteacup/fluentbird
187•skipnup•3d ago•98 comments

Atopile – Design circuit boards with code

https://atopile.io/atopile/introduction
39•poly2it•3d ago•11 comments

Show HN: An MCP server that gives LLMs temporal awareness and time calculation

https://github.com/jlumbroso/passage-of-time-mcp
44•lumbroso•3h ago•28 comments

MARS.EXE → COM (2021)

https://chaos.if.uj.edu.pl/~wojtek/MARS.COM/
115•reconnecting•4d ago•33 comments

Ukrainian hackers destroyed the IT infrastructure of Russian drone manufacturer

https://prm.ua/en/ukrainian-hackers-destroyed-the-it-infrastructure-of-a-russian-drone-manufacturer-what-is-known/
481•doener•9h ago•325 comments

Show HN: BloomSearch – Keyword search with hierarchical bloom filters

https://github.com/danthegoodman1/bloomsearch
17•dangoodmanUT•3d ago•3 comments

GPUHammer: Rowhammer attacks on GPU memories are practical

https://gpuhammer.com/
237•jonbaer•17h ago•80 comments

In-depth system walkthrough: cloud-based VOD

https://app.ilograph.com/demo.ilograph.AWS%2520Video-On-Demand/Workflow
5•billyp-rva•3d ago•0 comments

LLM Daydreaming

https://gwern.net/ai-daydreaming
147•nanfinitum•15h ago•115 comments

Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation

https://dataramen.xyz/
36•oleksandr_dem•6h ago•37 comments

Show HN: Shoggoth Mini – A soft tentacle robot powered by GPT-4o and RL

https://www.matthieulc.com/posts/shoggoth-mini
551•cataPhil•1d ago•102 comments

cppyy: Automatic Python-C++ Bindings

https://cppyy.readthedocs.io/en/latest/
60•gjvc•5h ago•15 comments

Reflections on OpenAI

https://calv.info/openai-reflections
667•calvinfo•1d ago•350 comments

Denver's Deepest Dinosaur

https://pubs.geoscienceworld.org/uwyo/rmg/article/60/1/1/657560/Denver-s-deepest-dinosaur
15•gmays•4h ago•8 comments
Open in hackernews

I'm switching to Python and actually liking it

https://www.cesarsotovalero.net/blog/i-am-switching-to-python-and-actually-liking-it.html
170•cesarsotovalero•10h ago

Comments

messe•9h ago
> the Python interpreter is natively integrated in all Unix distros

It's included in the default install of most desktop/server Linux distros (with plenty of exceptions), but I don't believe any of the BSDs ship it in their base system.

IIRC macOS used to have python 2 in its default install, but I vaguely recall that being deprecated and removed at some point. My only Mac is on the other side of the country at the moment, so I can't check myself.

blitzar•9h ago
I dont think python is pre-installed on macOS now. (uv has replaced it for me)

Edit: Unlike older versions of macOS that came with Python 2.7 pre-installed, newer macOS versions (Catalina and later) no longer include Python pre-installed.

oneeyedpigeon•9h ago
macOS dropped PHP recently too—doing a wonderful job of losing all that developer share that Apple was slowly building up.
frizlab•9h ago
Why? Installing python and php can be done in 2 seconds with brew, and you have control over what you install instead of using whatever is in the system, with deprecated versions, etc. It is actually much better now. System tool should be left to the system.
est•9h ago
if you install commandline tools there's

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/

wiseowise•9h ago
Virtually zero professional developers that I know use built in Python or PHP. Maybe it’s good enough for occasional scripting purposes, though.
stby•8h ago
I much prefer installing it myself, with the required version for my project and at a known and common location.
comradesmith•8h ago
I think it’s better for developers to not have conflicting system distributions.

Though for a while there having built in interpreters was great for kids and learners.

latexr•8h ago
Technically macOS doesn’t come with Python pre-installed, but it does provide you with a simple path to do it.

https://news.ycombinator.com/item?id=44580198

The removal was in Monterey. Catalina and its successor Big Sur very much still had it. Catalina was the one that removed 32-bit support.

tovazm•7h ago
I think they realised the security implications,

you could just take a random person macbook, open the terminal and launch python3 -m http.server 3000 --directory ~

then on the local network you could download all his files

latexr•6h ago
If you have access to their MacBook and can open a terminal, even `rsync` (which comes preinstalled) would do the job.

It seems much more likely to me they were just tired of having to manage the languages (and being constantly criticised they were behind) and simply chose to remove them.

latexr•8h ago
Python 2 was removed in Monterey 12.3, which was incredibly stupid and disruptive as it caught everyone by surprise. We all knew Apple said they would remove it, but everyone was expecting them to be sensible and do it on a new major OS release, like they did with PHP, not mid-cycle.

https://developer.apple.com/documentation/macos-release-note...

I wonder if that kerfuffle is why they ended up not removing Ruby and Perl yet, despite the same promise. macOS’ Ruby is around 2.6. Perl I somehow doubt they’ll get to, as it’s such an important part of Unix admin I bet they themselves use it somewhere.

There is still a /usr/bin/python3 which is a shim. When you call it, if you don’t have the Xcode Developer Tools you’ll be asked to install them (it’s a non-scary GUI dialog which takes two clicks) and then you’re set. That is also a few versions behind the cutting edge, but it does get updated sometimes.

v5v3•9h ago
"the second best language for any job"
tim-kt•9h ago
Meaning the first best language depends on the job?
stefcoetzee•8h ago
Of course :)
bravesoul2•9h ago
There are many jobs where the .Net/Java/Go triad would be in the top 3. I lump them together as typed languages that are mainstream, performant, have a GC and a featured library.
eurekin•8h ago
I'm at a java shop. All customer facing apps are in java. Our tools and glue code is mostly in python. Similar for data processing workflows
bravesoul2•8h ago
Yes that might demonstrate the point. Would Python be your second choice for the customer facing apps?
eurekin•2h ago
Unfortunately, might not be easy in practice. It took years of effort to pass some certifications and audits and I don't think adding another language could be recouped now
reedf1•9h ago
> Python has done a good job of hiding its legacy ugliness (such as __init__, __new__, and similar aberrations), swettening its syntax to accomodate developers with good taste.

What exactly is the problem with __init__ or __new__? @dataclass is very nice syntactic sugar, but are we arguing here that having access to initializer/allocator/constructor dunder methods is "legacy ugliness"? This is the core of pythonic built-in aware python. Bizarre.

wiseowise•9h ago
Bizarre is that you don’t consider it ugly.

Kotlin: constructor is either part of class definition or keyword constructor.

Ruby: initialize

JS: constructor

Python: ______new______, _______init_______

Literally this meme: https://knowyourmeme.com/memes/three-headed-dragon

reedf1•8h ago
I had honestly not considered that the author might have been talking about the visual aesthetic of the dunder methods themselves. Honestly that has me a bit stumped; all I can say is that if you don't like underscores, don't pick python.
t43562•8h ago
You don't call __init__ directly so the ugliness is limited to the definition which seems fairly minimal to me. It seems to be a naming convention for methods that are not invoked by name anywhere and that's at least informative when you're reading the class definition.

IMO this is less horrendous than e.g. go's insistence that exported functions are indicated by a capital letter - that really affects code using the module not just the definition.

NoboruWataya•8h ago
I like that magic method names generally all follow the same form so it's obvious that they are magic methods and not intended to be part of the public API. Whether that form uses double underscores or something else doesn't really matter to me as they are not being called directly.
63stack•7h ago
Would you consider a constructor magic though?
lou1306•7h ago
"Magic methods" is just the name people use for these special methods (another is dunder methods). They're "magic" because you do not call them by name, rather they are invoked by the interpreter in specific situations.
fiedzia•5h ago
> it's obvious that they are magic methods and not intended to be part of the public API

Is there an alternative API? No. This is public API regardless of anyone's intentions. Though "it's weird" is really not a very strong argument against it.

trylist•2h ago
Public API refers to the user of the class, not the implementer. You never call __init__ directly. __new__ allows modifying object creation itself for the implementer, but the user of the class will never call it.
freehorse•2h ago
There are private and public methods. Private methods are only supposed to be called within other methods, as in privately. Public methods are the ones that are normally called through the code, repl, by the user or whatever. You are not supposed to write `myclass.__add__(x)` anywhere except where you define the class itself and its methods.
Izkata•1h ago
There's actually 4 kinds:

  def foo(... # public
  def _foo(... # internal
  def __foo(... # munged
  def __foo__(... # magic
Internal is more convention as the language doesn't really do anything with it, but it does with munged, and magic methods are specifically for things implemented in the language.

Internal and munged don't exactly map to private and protected, but are kinda similar ish.

freehorse•9m ago
Oh right. I am not really into python, had read some doc about naming conventions some poitns.

In any case I actually like how one can use underscores to point on how exposed some method is supposed to be. Makes it simpler to actually know what to skip and what not.

__MatrixMan__•1h ago
There are several alternative API's. @dataclass is one, Pydantic offers another, there's also attrs, plus less general things like namedtuple.

Admittedly it's obnoxious when you've got habits for one and you're on a team that uses another--totally flies in the face of the zen re: "there should be only one obvious way to do things".

...but that was always a rather ambitious goal anyway. I'm ok navigating the forest of alternative API's if it means not being locked into something that I can only change by choosing an entirely different language. I'm happy that it's very easy to tell when somebody is mucking about with python internals vs when they're mucking about with some library or other.

dncornholio•8h ago
I have found to believe that ugly and beautiful are irrelevant. As long as it's doing the job and not cause major headaches. Life is too short to worry about syntax.
orphea•6h ago
Right? I'm kind of surprised that a few underscores invoke such strong emotions in people.
nottorp•1h ago
> Life is too short to worry about syntax.

Every programming language you use will annoy you in some way. You stop caring after a few of them.

timeon•7h ago
Can you elaborate bit what is the problem here? Is it shape of the characters or something else?
brabel•7h ago
Amazing. If you need to ask this question I am guessing you have spent too long with Python . No other language uses this underscore madness for special methods or otherwise. Because it’s just , I don’t know a more appropriate word for it , stupid.
Octoth0rpe•2h ago
Oh yes they do: https://www.php.net/manual/en/language.oop5.magic.php

The programming languages world is broad/varied enough that any statement like "no other language does this!" is almost certainly wrong (outside of esoteric languages, which python and php most certainly are not)

Twirrim•2h ago
What's actually amazing is how you're unable to answer a straight question.

If you call something "stupid" it doesn't really convey anything meaningful, especially not in the way you're using there, it comes across as "I don't actually have a reason I don't like it, I just don't".

dumah•3h ago
I’m not sure why you’re comparing __new__ to constructors in other languages.

Ruby has the same thing but it’s called ‘new’.

Implementing the type of customization (idiomatically) that __new__ provides in Kotlin and JS isn’t any cleaner.

parentheses•3h ago
That's kind of the point. These methods are never meant to be called directly. They're used to desugar.

I think it's fairly short sighted to criticize these. FWIW, I also did that the first time I wrote Python. Other languages that do similar things provide a useful transparency.

__MatrixMan__•1h ago
It's like the bright orange garments that hunters wear, the ugliness is sort of the point. It says "this is a different sort of thing."
ddejohn•24m ago
Ugliness is not the point of hi-vis vests lol, the point is to not get shot by other hunters.
guhcampos•1h ago
Some-other-language-user complaining about python ugliness:_____new_____ and _____init_____

Same-other-language-user:

((()))()()()({}{}{{(((())){}}}}{}{}{};;;;();)(;}}}

*not supposed to be correct syntax, it's just a joke

slightwinder•54m ago
As if other language don't have their warts.. Ruby and Javascript for example have hideous syntax, comparing this with some special naming is quite bizarre.

But who cares? It's syntax, it has its purpose.

moffkalast•21m ago
I would think the dumber thing is having to create an empty file called __init__.py for a package to register as a package. And relative imports being completely fubar.
thaumasiotes•9h ago
Probably the system of giving special meaning to what are otherwise ordinary identifiers. __ isn't a reserved keyword in Python or anything. But there's a set of conventions you're supposed to follow when naming methods and attributes, and they're visibly artificial. It would be cleaner to make the features that are a special part of the language definition also a special part of the language syntax instead of running them in indistinguishably with other nonsimilar things.

In C++, if you want to define the binary + operator on a class, you give the class a method with the special name `operator+`. In Python, to do the same thing, you give the class a method with the pseudo-special name `__add__`. You don't think the Python way is worse?

reverius42•8h ago
I'm not sure how "operator+" is supposed to be appreciably different from "__add__".
brabel•7h ago
One is a sensible choice a human might pick. The other is not.
orphea•6h ago
Both are doing their job just fine?
acdha•5h ago
So who were the non-humans who picked the one you don’t like?
acdha•7h ago
> You don't think the Python way is worse?

Have you considered how much familiarity might shape your reaction to the two? Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax.

Here’s a counter argument: the Python methods are normal method declarations whereas C++ developers have to learn that “operator=“ means something different than what “operator =“ (or any other assignment statement) would mean, and that this is the only context where you can use those reserved symbols in method names.

To be clear, I don’t think either of these is a big deal - the concepts and usage are harder to learn than the declaration syntax – but I think it’s incredibly easy to conflate familiarity with ease of acquisition for things like this.

thaumasiotes•6h ago
> Have you considered how much familiarity might shape your reaction to the two?

It doesn't.

> Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax.

No, the Python methods are just ordinary methods with valid names. What 'arbitrary restrictions' are you referring to?

acdha•5h ago
The arbitrary restriction is that you have to just learn a specific pattern and follow it. I can’t have my Python class use “addition” if I hate underscores or my C++ code use “mathematical_division” if I’m horribly pedantic. In both cases, it’s just a particular design decision by the language developers I have to learn, and in both cases I won’t think much of it after the initial acclimation.
kemayo•2h ago
Funnily enough, just starting your class method/variable name with __ does do magic things as a pseudo-keyword. Specifically, it mangles the name for callers outside of that class -- `self.__foo` would need to be accessed as `obj._ClassName__foo`. It's python's approach to having private methods, while remaining somewhat ideologically opposed to them existing.

This doesn't apply to the dunder methods, though. They're magically exempt from this magical mangling, so you could call them directly if you wanted. ¯\_(ツ)_/¯

> You don't think the Python way is worse?

They seem about equivalent? I don't see any real reason to pick one or the other, beyond personal preferences.

andyjohnson0•9h ago
> What exactly is the problem with __init__ or __new__? @dataclass is very nice syntactic sugar, but are we arguing here that having access to initializer/allocator/constructor dunder methods is "legacy ugliness"?

My read was that the "ugliness" was in the method naming, and specifically the double underscores, not the availability of the methods themselves.

smcleod•9h ago
Python as a language is nice. Python's version and package management is nothing short of a nightmare.
est•9h ago
Python's package management is OK. The main culprit is .so libraries

Think JNI or cgo management.

t43562•8h ago
Yes, I've never really understood the complaint about python packaging - building native code is not something that is ever easy to guarantee across multiple distributions and operating systems.

Those native packages can be in any language and require any odd combination of tools to build. Who has truly solved that problem?

nikisweeting•8h ago
wheels, conda, docker, firecracker, unikernel, flatpak
t43562•7h ago
flatpak, docker ? i.e. include an almost complete distribution just to make one package work? but what if you want that package to work in the distribution you have now? What if you need 2 different packages that are in different flatpacks or different docker images?
staunton•2h ago
Set them up, each in its own container, and use GRPC to communicate between them...

(Not even kidding, I've seen people do this)

Orygin•2h ago
If you don't need to link C lib, you can build any combination of arch and OS for a golang program. The default tooling allows you to do so easily.

If you need to link a C lib, there are ways to set it up to compile other OS (and maybe other archs).

RamblingCTO•19m ago
I'll throw in BLAS and LAPACK. Fuck, what a nightmare it always has been to get scipy running. I've always ended up with a wild mix of conda and pip installed shit that just wouldn't work.
macawfish•6m ago
It is not okay (maybe uv fixes this?)
jcattle•9h ago
Going to be honest: With uv it really isn't that bad anymore. Sure, the whole packaging ecosystem is still really bad, but uv abstracts over most of it. Unless you're doing some really esoteric stuff you'll be just fine.
xyzsparetimexyz•9h ago
Using a nix devshell has worked out well for scripts for me so far. I haven't figured out what that workflow is like for larger projects though. I'm not interested in learning Uv
smallerfish•2h ago
There's nothing to learn. Get Claude code to install uv into your devshell and cut over your requirements. 5 minutes.
expenses3•58m ago
AI? :vomit_emoji:
__MatrixMan__•57m ago
Or do it yourself, 10 minutes
__MatrixMan__•1h ago
As a nix user, you hardly need to know uv, but you might later need to know how to work together with non-nix-users who use uv. It's easy.

There will be a file: uv.lock You can use uv2nix to get a single nix package for all the project's python dependencies, which you can then add to your devshell like anything else you find in nixpkgs (e.g. right alongside uv itself). It ends up being two or three lines of code to actually get the package, but you can just point a LLM at the uv2nix docs and at your flake.nix and it'll figure them out for you.

Your devshell will then track with changes that other devs make to that project's dependencies. If you want to modify them...

   edit pyproject.toml # package names and versions
   uv lock             # map names and versions to hashes (nix needs hashes, finds them in uv.lock)
   nix flake lock      # update flake.lock based on uv.lock
   nix develop         # now your devshell has it too
This way you're not maintaining separate sources of truth for what the project depends on, and the muggles need not think about your nix wizardy at all.
expenses3•59m ago
Didn't I say I wasn't interested?
__MatrixMan__•52m ago
You created a place where the interaction between nix devshells and uv was relevant, I put something there to help passers-by that might be interested in those topics. It wasn't actually for you.
lazzlazzlazz•9h ago
This hasn't really been true for a while now. `uv` has radically improved the experience.
cedws•8h ago
There’s still 20 years of projects using everything that became before uv. They didn’t upgrade the moment uv came into existence. Data science-land still uses other rubbish too.
zimpenfish•8h ago
> They didn’t upgrade the moment uv came into existence.

There's also projects that can't use `uv` because it doesn't like their current `requirements.txt`[0] and I have no bandwidth to try and figure out how to work around it.

[0] We have an install from `git+https` in there and it objects strongly for some reason. Internet searches have not revealed anything helpful.

bootsmann•6h ago
Unrelated to uv but the problem with having a git ref in requirements.txt is that pip will treat it as a fixed version so it will strictly narrow the other dependencies it can resolve, which gets exceptionally difficult to reason about once that packages also loads a package from another git ref. Throwing everything into codeartifact (or equivalent on other clouds) is better longterm.
bborud•8h ago
For the last 20 years that has been the mantra. Some X "solves" all the problems.

Except it doesn't. It just creates another X that is popular for a while, and doesn't somehow retroactively "fix" all the chaotic projects that are a nightmare to install and upgrade. Yes, I understand people like Python. Yes, I understand the LLM bros love it. But in a real production environment, for real applications, you still want to avoid it because it isn't particularly easy to create robust systems for industrial use. You may survive if you can contain the madness in a datacenter somewhere and have people babysit it.

bodge5000•2h ago
I can get that Pythons not for everyone, it certainly has its flaws and maybe uv is just another transient solution which will come and go and others have. I might disagree, but I can accept that. What I can't accept is the idea that it should be avoided for real production environments, which is frankly a bit ridiculous considering all the real applications and real production environments running on Python.
bbkane•2h ago
I think that's true until it isn't, and people are really rallying around uv.

Here's to hoping it manages to actually solve the Python packagig issue (and lots of people are saying it already has for their use cases)!

turtlebits•1h ago
I've ignored the trends and just used the bog standard requirements.txt with pip and a virtualenv and have had no problems in the past 10+ years. Either way, you always want to catch production deploys if something breaks.
davepeck•57m ago
> But in a real production environment, for real applications, you still want to avoid it because it isn't particularly easy to create robust systems for industrial use.

This is silly, disproven by the massive Python codebases found in "real production environment"s throughout the tech industry and beyond, some of which are singlehandedly the codebases behind $1B+ ventures and, I'd wager, many of which are "robust" and fit for "industrial use" without babysitting just because they're Python.

(I get not liking a given language or its ecosystem, but I suspect I could rewrite the same reply for just about any of the top 10-ish most commonly used languages today.)

zanellato19•35m ago
Some of the biggest codebases in the world are in Python, this is a bizarre statement that reeks of the hn superiority complex.
viccis•32m ago
>Except it doesn't.

That is only true if you never reexamine the universality of your statement. I promise that it is possible to "solve" the mess that was Python's ecosystem, that uv has largely done so, and that your preconceptions are holding you back from taking advantage of it.

timw4mail•4h ago
It's like the (usually) interpreted equivalent to C/C++. There are lots of 'standard' package management choices.

And it seems like the package resolution is finally local by default, although that requires a 'virtualenv', which seems to be a legacy of the global packaging system.

__MatrixMan__•1h ago
I expect that for every two python users who know what `pip` is, there are three who are discouraged from thinking about the environment at all. Given that, focusing on the language and not the packaging is the right choice. Packaging is most often somebody else's problem.

It's just HN users are more likely to be that somebody else. Probably we have to deal with non-python dependencies anyway so we're reaching for bigger hammers like docker or nix. It would be nice if there wasn't a mess of python package managers, but whichever one I use ends up being a somewhat unimportant middle-layer anyway.

polotics•9h ago
It's funny, I'm the opposite: LLMs have made it easy to draft something in Python, then translate to a more appropriate language for the target problem-domain, for example Go.
brabel•7h ago
Agree . We had training to learn how LLM applications can be developed and it was obviously in Python. Never liked Python but between dependencies issues (the demo project used uv but somehow the author forgot to declare some dependencies which she probably had installed globally) which cost hours of everyone’s time, and the persistent magic going on (pipe operators that do nothing similar to unix pipes, wtf!, puydantic shit just to declare a data type with metadata and lots of things like this) nearly everyone immediately switched to a typed language like Kotlin (they have a nice AI framework) as soon as we got the basics of how things work.
revskill•9h ago
So, i don't get it, now i still need to have a uv venv ?
akkad33•9h ago
The principle of uv as much as I understand is to not tinker with virtual environments. With commands like uv run, uv sync etc you shouldn't have to worry about the virtual env and whether it's activated etc. if you are in a project, it will automatically pick up the right Python version . However if you want to do something not possible through those commands you can still get down to the virtual env. Plus for auto complete in IDEs you generally need to select the venv
mpeg•9h ago
I use this vscode extension called "python envy" that changes venv automatically depending on which folder of a monorepo you are in, it's great! Wish vscode had it built-in
akkad33•1h ago
Never heard of it, will try. Thanks
blitzar•9h ago
You install uv not python, you use "uv run <file>" instead of "python <file>", you dont think about anything else.
Vaslo•4h ago
If you are working in Data Science/ML its the best bet for handling dependencies in your project compared to the rest of the tools. Its use has exploded, especially because you can do ‘uv pip whatever’ if you insist on using pip.
andrewstuart•9h ago
Said with a note of surprise?

Made me think this is probably normally a Ruby developer indoctrinated against Python. The article doesn’t seem to say what they have come from.

drewcoo•9h ago
> Ruby developer indoctrinated against Python

Ruby devs think about code differently. Like Perl, they embrace TIMTOWTDI.

https://perl.fandom.com/wiki/TIMTOWTDI

Also, there's a pride in writing elegant code as opposed to following "Pythonic" conventions. Excellence is not conformity.

I use Python a lot more often now because it's seen as simpler and more approachable and easier to force compliance. I miss Ruby.

t43562•8h ago
IMO "pythonic" is mostly about using the features the language has rather than trying to treat it as if it was Java or C++.

Having said that, in reviews you do get lazy comments like "not pythonic" or "not best practises" which often boil down to the reviewer just not liking something and being too much of an *** to say why. This is supposed to be a total shutdown that you cannot argue with and it's the kind of thing that might put you off the term "pythonic" for life.

"There should be one-- and preferably only one --obvious way to do it."

This is probably the core thing you might have issue with but I think its not really about conforming in how you write your own code but about the thing you make being easy for others to use.

greener_grass•5h ago
I love this sentiment:

> There should be one-- and preferably only one --obvious way to do it.

But I often don't think the Pythonic way is a very good way to do it. And this leaves you a bit stuck!

Mawr•7h ago
> Like Perl, they embrace TIMTOWTDI.

Yeah, and it's the wrong approach. Of course, you can have whatever preference you want, but in terms of engineering, it's plain wrong.

wiseowise•9h ago
There’s a footnote:

> If you know me, you know I used to be mostly a Java/JavaScript/R kind of guy. ↩

riffraff•8h ago
It's in the footnotes, they're a java/javascript/R dev.
xandrius•8m ago
So, if you don't fancy Python you must be labeled a Ruby developer? Weird take.
bravesoul2•9h ago
I like Python for the language, and for a lot of jobs the threading model limitations do not matter. Its a great language to get stuff done. I find the package management story challenging but I will try uv next time!
sudosays•8h ago
If you haven't already you should check out uv: https://github.com/astral-sh/uv

It solves a lot of the package management headaches for me.

rich_sasha•8h ago
I resisted pipx, poetry, anaconda and probably some other things, as I didn't see the point over venv+pip. But uv is just so damn good, there's no going back.
gjvc•8h ago
pipdeptree is all you need for many things, but uv is such a joy to use it's hard to resist, sure.
bootsmann•5h ago
Feel like pipx walked so uv could run, it popularized the idea of abstracting the environment management away from the user.
zeppelin101•1h ago
pipx is still the best tool for standalone utility type of packages: "yt-dlp", "glances" (like htop), etc.
asa400•1h ago
You can, however, use uv for this, e.g., `uvx yt-dlp` works like it would in pipx.

https://docs.astral.sh/uv/guides/tools/

Roark66•8h ago
From what? It would be useful to mention towards the front of the post so we know what is the context in which you approach python.

I've switched to python primarily (from perl) in early 2010s (I think my first "seriously" used version was 2.6. This is mostly for system management, monitoring, and data transformation /visualisation. Nothing fancy like AI back then in a work setting.

I found the biggest impact was not so much on writing code but on it remaining readable for a very long time, even if it was created hastily "just get this working now" style. Especially in a team.

Python is still one of my favourites and the first tool I reach if bash is not enough for what I'm trying to do.

pyman•8h ago
From what I was told, Python was originally seen as a Swiss Army knife for sysadmins. It started gaining more traction when Canonical adopted it as the main language for Ubuntu 4.10 in 2004.

Then, in 2005, Guido van Rossum was hired by Google to work on Google Cloud. That opened the door for wider adoption in academia, since Python had strong math libraries and integrated well with tools researchers were already using, like Hadoop, right around the time big data and ML were starting to take off.

Also, between 2005 and 2006, two important things happened: Ruby on Rails came out and inspired Django, which was starting to gain popularity, and web developers were getting tired of Perl's messy syntax. That's how Python quickly became a solid choice not just for server-side scripts, but for building proper web apps. In the meantime, another language that could be embedded directly into HTML was storming the web: PHP. Its syntax was similar to JavaScript, it was easy to pick up, lowered the barrier to entry for software development, worked straight out of the box, and didn't require thousands of print statements to get things done.

The 3 Ps made history. According to programmers from 20 years ago, they were like religions. Each had its own philosophy and a loyal group of followers crusading online, getting into heated debates, all trying to win over more adopters. The new generation of devs is more pragmatic. These days it's less about language wars and more about picking the right tool for the job.

darkstar_16•8h ago
> These days it's less about language wars and more about picking the right tool for the job

You should talk to the Java advocates in my company :) The language wars are still around, it's just Java vs the rest now.

pyman•6h ago
One of my colleagues, a retired programmer who spent 20 years at Microsoft, told my students that it used to be Java vs Visual Basic, until Microsoft brought in the big guns, like Anders Hejlsberg. That's when it turned into Java vs .NET, and things really started to heat up :)
wiseowise•3h ago
Java unequivocally won the war, though.
tgv•7h ago
Python's success is entirely due to entry-level programming courses. They all switched to Python, because you have to explain less. I don't think I heard about web servers in Python before 2012. I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly.

PHP's popularity isn't really from 2005-2006. It was popular at the end of the 90s, and it looks like JS as much as it looks like a potato.

theshrike79•7h ago
With python you can just go: 'print "hello, world!"' and that's a full-ass program

You run it by saying `python hello.py`.

Compare that to the amount of crap you need(ed) with 2005 Java just to have something running.

The shittiness of ActivePython and generally getting python to run on Windows were a bit of a hurdle, but still it was easier than the competition

taeric•2h ago
I mean, it isn't like you couldn't get similarly terse scripts in other languages. Common LISP, as an easy example people love to beat up on.
nottorp•1h ago
You could, but then they deprecated the paranthesis less form in 3.x :)
pyman•6h ago
> Python's success is entirely due to entry-level programming courses.

Yeah, after 2008. And by 2014, it had overtaken Java in many CS programs. But I was referring to the events that led to that.

stevesimmons•6h ago
> I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly.

Python had web servers from 2000, including Jim Fulton's Zope (really a full framework for a content management system) and in 2002 Remi Delon's CherryPy.

Both were useful for their day, well supported by web hosting companies, and certainly very lightweight compared to commercial Java systems that typically needed beefy Sun Solaris servers.

sylens•4h ago
In my experience AWS also contributes a lot to this. Boto3 is a great library for interacting with AWS services
wiseowise•4h ago
> Python's success is entirely due to entry-level programming courses. They all switched to Python, because you have to explain less.

Nonsense.

> I don't think I heard about web servers in Python before 2012.

More nonsense.

> I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly.

Extreme nonsense.

https://medium.com/signal-v-noise/ruby-has-been-fast-enough-...

And this is when Python was edging Ruby performance wise.

MoreQARespect•2h ago
This is entirely backward. They all started switching when python was already immensely popular after the popularity boosts given by sysadmin, django and numerical/datascience users.
__rito__•2h ago
This is what I have seen as well. When Python became ubiquitous in the industry, they started teaching it in the colleges.

I come from a core science background. I studied Physics. And it was like this in my institute: FORTRAN -> A lot of C, small amount of FORTRAN -> C -> Python. I was taught C, but from the exact next year, it was switched to the Python ecosystem.

It was done much later when Python became the standard in research universities, the language of recent research papers, etc.

A generation of Scienctists learned C/FORTRAN/MATLAB in college/grad school as it was taught, but they switched to Python early/mid career. Teaching Python in undergrad followed.

I also taught a mid-career Economics professor Python. She used SPSS before for her papers. Humanities professors doing data crunching are now switching to Python, too. There is a clear trend.

taeric•2h ago
I argue that Python's success was almost entirely due to it not adopting any best practices on dependency management and being installed by default on systems.

Being default installed was almost certainly the larger factor. As evidenced by how much pain it caused people when they started using dependencies that were not stable. They had to add specific support for it to not let you pip install things to the system install.

runjake•2h ago
1. Python was pretty popular well before entry-level programming courses adopted it. I think they adopted Python because it was a good general purpose scripting language, multiplatform, easy to install and get going, that taught programming concepts in a more approachable way for beginners.

2. Python on web servers was a thing long before 2012. You had Zope in 1998 or so, and it was pretty popular for a while, and hugely influential to subsequent web frameworks. Django came out in about 2005. TurboGears, Pylons in about 2005 or so. Flask in 2010... and these are just the more popular frameworks.

3. I think the author meant that PHP was also vaguely C-like in syntax, like JS. Keyword: vaguely. You had a common way of declaring stuff with curly braces and semi-colons.

dragonwriter•2h ago
> Python's success is entirely due to entry-level programming courses.

No, entry-level courses were in a mix of Scheme, C, and other languages until Java’s industrial ubiquity ended up in it becoming a popular choice, but not completely displacing the others. Then as Python (along with the broader class of dynamic OO scripting languages) became quite popular, Python got added to the mix, but, unlike Java, it fairly quickly displaced not only Java but a lot of what had been around longer in introductory courses.

Python’s industrial success drove its initial use in introductory courses, but doesn't fully explain it, as it doing what Java never did indicates.

I think the people teaching introductory courses find it less of a compromise to industrial popularity than they did with Java.

Python’s success is multifaceted, some of it is right-place right-time, a lot of it is the ecosystem it built because of that, but a lot of it is, I think, that it turns out to be a language that has been designed (both initially and in how it is been managed over time) to be a very good language for real people solving real problems, despite not adhering to any of what various typing and performance and paradigm purists like to posit as the essential features of a good language.

stevesimmons•6h ago
The key factor imo was Travis Oliphant merging the competing numeric and numarray libraries into numpy in 2005. That quickly became the foundation of Python as the key environment for open source numeric processing.

It brought across a ton of users from R and Matlab.

Pandas, Matplotlib and ScikitLearn then consolidated Python's place as the platform of choice for both academic and commercial ML.

troad•2h ago
> According to programmers from 20 years ago, they were like religions. Each had its own philosophy and a loyal group of followers crusading online, getting into heated debates, all trying to win over more adopters.

It's very weird reading something you lived through described in these terms, as though it were being described by an anthropologist.

Can't help but wonder what the future will have to say about today.

"In 2025, programmers used 'frameworks' to hang 'apps' from some kind of 'web'. They believed these frameworks gave them magic powers. Many even fought in 'flame wars' on this topic, which experts believe involved the use of fire to destroy webs woven by competing programmers."

Twirrim•2h ago
> The 3 Ps made history. According to programmers from 20 years ago, they were like religions. Each had its own philosophy and a loyal group of followers crusading online, getting into heated debates, all trying to win over more adopters. The new generation of devs is more pragmatic. These days it's less about language wars and more about picking the right tool for the job.

I feel like the religious wars aspects of this is completely overblown. The conversations around languages really hasn't changed all that much in the last 20 years. Look at the way you see things happening in HN, heck even in the comment thread right here. It's the exact same kinds of discussions as happened back 20 years ago, with exactly the same kind of pragmatism.

I think the gulf comes about from the fact that the primary sources are conversations occurring between people that are largely anonymous behind an online handle, interacting with people that aren't face to face. There's always been an element of exaggeration in the interactions. What might be a "Umm, no" with a maybe a shake of the head, becomes "Your mother was a hamster and your father smells of elderberries". Almost every party involved comes to recognise the particular cultural quirks (which varied from forum to forum) and how to translate what was said, to what was actually meant.

t43562•8h ago
I'm glad someone else discovered they can like python.

I got forced to learn it for a project where I was proposing Ruby and the customer insisted on Python. This was years ago when Ruby was much slower. I was annoyed but I got used to it and here I am enjoying it many years later.

I take issue with the description and use of make though! :-D What is the point of it if you're not going to use dependencies? One might as well just write a script with a case statement..... I'm adding smileys because I don't mean to be all that serious but I really do think that the failure of the youth of today to get to grips with Make is a sad reflection on our culture....... and get off my lawn, ok? :-)

pphysch•2h ago
> One might as well just write a script with a case statement.....

I started with this and evolved into simple flat Makefiles, because they're basically the same but Make feels more standard (there's a Makefile here vs. there's a random bash script here).

DataDaoDe•8h ago
Python has done an impressive job over the years of making steady robust improvements. The typing and tooling has just gotten better and better. There are still plenty of problems though, imho async is still a much bigger pain than it should be (compared to other runtimes with a very nice experience like go or elixir, even dotnet has been less pain in my experience). Overall I like python, but it mainly boils down to the robust libraries for things I do (ML, Data munching/analysis)
dmz73•8h ago
I don't know what I am doing wrong but nothing written in Python has ever worked for me. I download the .py repo from from github or wherever and try to run it - errors. I try to install missing libraries pip this and that - errors. I battle fixing endless error with dependencies and when the .py finally runs - errors - wrong version of whatever library or wrong patch of this or that or the "production ready" .py does not work correctly on Windows or single file script uses excel library that has changed in incompatible ways 3 times in 2 years. I Download all the files from the flashy looking web site and follow all the instructions to the letter - errors. Python is anything but "robust". It is the most fragile environment in the universe, worse than c, c++ and javascript put togeter, at least this is my experience with it.
vrighter•7h ago
This is exactly my experience too. I avoid python software like the plague, because even when it does work, I can not rely on it continuing to work when python gets updated on my system.
zeppelin101•1h ago
This is where uv comes in to save the day.
DataDaoDe•5h ago
That’s wild. The last time I had that experience with Python must have been more than 10 years ago. I’ll admit a decade ago you definitely did need to know way to many details about way too many tools from virtualenvs to setuotools to wheels, etc. to get things working from somebody else’s project, but imho, poetry and uv have really changed all that.
latexr•8h ago
> I started to code more in Python around 6 months ago. Why? Because of AI, obviously. It’s clear (to me) that big money opportunities are all over AI these days.

I find this depressing. Not only are LLMs covertly reducing our ability to think and make decisions, they’re now also making people voluntarily conform to some lower common denominator.

It’s like humanity decided to stagnate at this one point in time (and what a bad choice of point it was) and stop exploring other directions. Only what the LLM vomits is valid.

mrpopo999999•8h ago
humanity tried to save time and allocate it to other pursuits, don't worry
taosx•8h ago
Unpopular opinion: I think I’m going to wait for version 4 /jk. But honestly, I’ve been spoiled by modern languages like Rust, Go, and even TypeScript with modern tooling, strong typing, stability, and performance out of the box. Right now, I’m just interacting with LLMs, not building them.

That said, I remember writing myself a note a few years ago to avoid Python projects. I had to clean up code from all over the company and make it ready for production. Everyone had their own Python version, dependencies missing from requirements.txt, three way conflicts between 2 dependencies and the python version, wildly different styles, and a habit of pulling in as many libraries as possible [1]. Even recalling those memories makes my stomach turn.

I believe constraints make a project shine and be maintainable. I'd prefer if you throw at me a real python instead of a python project.

[1] Yes, I'm aware of containers, I was the unlucky guy writing them.

bigiain•8h ago
> Unpopular opinion: I think I’m going to wait for version 4

In my personal timeline, people giving up waiting for Perl 6 were a huge source of early Python developers.

1ncunabula•1h ago
What makes TypeScript better than Python? I don't get it..
theLiminator•35m ago
I don't have a strong love for python, but all the tooling the author mentioned has actually made python fairly decent to use now.

Still could be better, but I think Python's really hit its stride now.

Surac•8h ago
have fun!
CoolCold•8h ago
> Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros

That's kind of very optimistic evaluation - literally anything beyond "import json" will likely lead you into the abyss of virtual envs. Running something created with say Python 3.13.x on Ubuntu 22.04 or even 24.04 (LTSs) / Rocky 9 and the whole can of worms opened.

things like virtual envs + containers (docker like)/version managers become a must quickly.

nikisweeting•8h ago
this is solved by uv
CoolCold•8h ago
> things like virtual envs

I consider my point as still valid with UV, what you wanted to express?

On UV specifically - say 'asdf' compiles python right on your system from official sources - means using your ssl libs for example. UV brings Python binary - I feel worried on this.

charliermarsh•12m ago
uv works just as well with whatever Python you want to bring -- you're not required to use the Pythons that uv is capable of installing on your machine.
acdha•7h ago
“import json” is the kind of thing which requires picking and installing libraries in batteries-not-included languages, and it’s just one of many modules which are in the standard library. That’s not a compelling basis for large projects but over the years I’ve shipped a ton of useful production code which never needed more than the stdlib and thus spent no time at all thinking about deployment or security patching.

Also, it’s not the 2000s any more. Using venv to isolate application installs is not very hard anymore and there have been decent package managers for a long time.

wpm•2h ago
I have a silly theory that I only half joke about that docker/containers wouldn't've ever taken off as fast as it did if it didn't solve the horrible python dependency hell so well. You know something is bad when fancy chrooting is the only ergonomic way of shipping something that works.

My first taste of Python was as a sysadmin, back in 2012 or so, installing a service written in Python on a server. The dependency hell, the stupid venv commands, all this absolute pain just to get a goddamn webserver running, good lord. It turned me off of Python for over a decade. Almost any time I saw it I just turned and walked away, not interested, no thanks. The times I didn't, I walked right back into that pile of bullshit and remembered why I normally avoided it. The way `brew` handles it on macOS is also immensely frustrating, breaking basic pip install commands, installing libraries as commands but in ways that make them not available to other python scripts, what a goddamn disaster.

And no, I really have no clue what I'm talking about, because as someone starting out this has been so utterly stupid and bewildering that I just move on to more productive, pleasant work with a mental note of "maybe when Python gets their shit together I'll revisit it".

However, uv has, at least for my beginner and cynical eyes, swept away most of the bullshit for me. At least superficially, in the little toy projects I am starting to do in Python (precisely because its such a nicer experience), it sweeps away most of the horrid bullshit. `uv init`, `uv add`, `uv run`. And it just works*.

stanleydrew•1h ago
> I have a silly theory that I only half joke about that docker/containers wouldn't've ever taken off as fast as it did if it didn't solve the horrible python dependency hell so well.

I don't think this is a silly theory at all. The only possibly silly part is that containers specifically helped solve this problem just for python. Lots of other software systems built with other languages have "dependency hell."

asa400•1h ago
> However, uv has, at least for my beginner and cynical eyes, swept away most of the bullshit for me.

uv is _much_ better than what came before. As someone who has only had only glancing contact with Python throughout my career (terrible experiences at jobs with conda and pip), uv feels like Python trying to actually join the 21st century of package management. It's telling that it's in Rust and clearly takes inspiration from Cargo, which itself took inspiration from Ruby and Bundler.

paradox460•12m ago
The funniest thing for me is that you can use uv in mise to install Python cli programs in a surprisingly elegant manner.
turtlebits•1h ago
You should always use virtual envs. They're a single directory, how are they an abyss? Pip now complains if you try to install a package system wide.
unethical_ban•4m ago
For shadow IT, anything that requires "installation" vs. being in the base system or being added as a file to a project is an inconvenience.

It's why I like using Bottle for small Python frontends: download the file and import.

(I'm ranting based on personal experiences with IT in the past. Yes in general virtualenv is the baseline)

ziml77•1h ago
Yes, please use virtual envs or containers. I know it seems overly heavy and hard to manage, but you don't want to end up in a situation where you're afraid to update the system because the library upgrades might break some of your Python code.
igor47•8h ago
Good write up, and solid choices. As someone primarily working in python in the last few years, I have a very similar stack.

Two additional suggestions:

* mise to manage system dependencies, including uv version and python itself

* just instead of make; makefile syntax is just too annoying.

Mise actually has a command runner as well which I haven't tried yet, and might work better for running commands in the context of the current environment. It's pretty nice when your GitHub actions workflow is just:

* Install mise

* mise install everything else

elemcontrib•8h ago
I don't see how the OP layering utilities on top of python remediates on the claim that the language is not "production ready". Which it clearly is.
flyinghamster•7h ago
I've avoided Python for a long time, but I'm getting roped in myself, mainly because certain tasks seem to require a lot less code than Java or Perl.

That said, call me old-fashioned, but I really take issue with "curl $URL | bash" as an installation method. If you're going to use an install script, inspect it first.

limagnolia•1h ago
If your going to execute the code anyway, you either have to inspect everything or trust whoever is providing it. There is nothing special about bash that makes it more dangerous to execute than python.
drdrey•7m ago
do you also inspect binary installers?
Mawr•7h ago
Just a small note on the code in the linked script:

    API_KEY = os.environ.get("YOUTUBE_API_KEY")
    CHANNEL_ID = os.environ.get("YOUTUBE_CHANNEL_ID")
    
    if not API_KEY or not CHANNEL_ID:
        print("Missing YOUTUBE_API_KEY or YOUTUBE_CHANNEL_ID.")
        exit(1)
Presenting the user with "Missing X OR Y" when there's no reason that OR has to be there massively frustrates the user for the near zero benefit of having one fewer if statement.

    if not API_KEY:
        print("Missing YOUTUBE_API_KEY.")
        exit(1)
    if not CHANNEL_ID:
        print("Missing YOUTUBE_CHANNEL_ID.")
        exit(1)
Way better user experience, 0.00001% slower dev time.
niux•2h ago
Why not add a boolean flag and use a single exit(1) at the end? That way the user can see all the environment variables that have not been set.
gvalkov•2h ago
This is nitpicking, but this is a good usecase for the := operator:

  if not (API_KEY := os.getenv("API_KEY")):
      ...
For internal tools I just let os.environ["API_KEY"] raise a KeyError. It's descriptive enough.
arthurcolle•1h ago
I always forget this syntax exists. When was this introduced?
gvalkov•1h ago
In Python 3.8 - https://peps.python.org/pep-0572/
DangitBobby•1h ago
October 2019 in Python 3.8

https://docs.python.org/3/whatsnew/3.8.html

cranium•1h ago
The Walrus operator! Introduced in Python 3.8 according to the PEP 572.

Really nice to combine 1) checking if something exists and 2) act on it

tyrust•1h ago
I write a decent amount of Python, but find the walrus operator unintuitive. It's a little funky that API_KEY is available outside of the `if`, perhaps because I had first seen the walrus operator in golang, which restricts the scope to the block.
bobbylarrybobby•1h ago
This isn't really unique to the walrus operator, it's just a general python quirk (albeit one I find incredibly annoying). `for i in range(5): ...` will leave `i` bound to 4 after the loop.
slightwinder•1h ago
This is just Pythons scoping, which is not restricted by block, but function. You have the same effect with every other element.
wcrossbow•2h ago
Even better is to try to fetch all the env variables and then report on all of the missing ones.
pyuser583•1h ago
It would be better to do both: print out the detailed string or strings, then exit if either are printed.
danielrico•1h ago
Even better, check all the conditions and report all the errors. Don't make me add the first variable, run it again and get another error.

Sometimes that's inevitable, bit noisy of the time it isn't.

taeric•30m ago
I'm surprised there isn't an argparse like thing for documenting expected environment variables.
paisawalla•4m ago
Taking ephemeral arguments like channel ID from the environment is more offensive to observability and user comfort
firecall•6h ago
“I started to code more in Python around 6 months ago. Why? Because of AI, obviously. It’s clear (to me) that big money opportunities are all over AI these days. And guess what’s the de facto programming language for AI? Yep, that sneaky one.”

Why is that?

Why Python for AI?

johnisgood•5h ago
Possibly because many available LLMs run your Python code in a sandbox, which means less friction for vibe coders, or it may be a contributing factor at the very least.
AlexeyBrin•4h ago
> Because many available LLMs run your Python code in a sandbox, which means less friction for vibe coders.

This is false, a lot of non "vibe coders" are using Python for AI because of PyTorch and a many other AI libraries have first class Python support.

johnisgood•4h ago
How do you know that it is not the reason or not ONE of the reasons? Seems pretty reasonable to me to use ChatGPT, Claude, or whichever one supports it.

I am pretty sure some people (maybe this individual, too) may be using Python because their scripts can be executed in a sandbox on one of these websites.

Heck, if it was as good at Factor or Forth as it is at Python, I would be writing more of them, too.

In any case, you cannot claim that it is not one of the reasons. Can you?

AlexeyBrin•3h ago
I read your initial message, now edited, as this is THE reason. Of course it can be one of the reasons for which the author chose Python.

Also the vibe coding part gave me the impression that you were implying that people that use/chose Python for AI are all vibe coders which is again false. Sorry if I misunderstood you, but this is what I got from your initial message.

johnisgood•2h ago
No worries. I think there was a misunderstanding because even with my original message, I did not intend to suggest that people who use or choose Python for AI are all vibe coders, or at least I didn't think I did hint at that.
AlexeyBrin•4h ago
Because you get first class support in many AI libraries like PyTorch, TensorFlow and so on ... Most of these libraries can be used from other programming languages too, but it is easier to find good documentation and examples for Python.
Hizonner•5h ago
I wonder what the poor guy is switching from.
moribvndvs•3h ago
I don’t understand “switching” to anything. The job picks the tool, not the other way around.
Bridged7756•1h ago
I think it's mostly boredom-driven career choices.
1vuio0pswjnm7•2h ago
"And guess what's the de facto programming language for AI? Yep, that sneaky one."

Is this referring at all to to PyTorch. If not, any guesses what the author has in mind

"Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros."

Is this referring to GNU/Linux.

UNIX (UNIX-like) includes more than Linux; some UNIX distributions do not include Python in the base system

Where it is left as choice to the user whether to install it

I know this because I use such distributions and, unless some software needs it, I do not install Python

In such case, when I am done using that software I uninstall it^1

For example, he mentions retrieving YouTube channel metadata

I do not use Python for this; I use a 19-line shell script (ash not bash), its startup time is faster

Unlike Python, it is included in the base system of the UNIX distributions (both Linux and BSD) that I use

But if I need to test something using yt-dlp, then I might temporarily install Python

1. I compile Python from source and one annoying aspect of the project , in addition to the slow startup time, is their failure to include an uninstall target in their Makefile

megaloblasto•1h ago
"And guess what's the de facto programming language for AI? Yep, that sneaky one."

He's referring to Python in general

"Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros."

I think he means that its available or readily available in many major linux distributions like Ubuntu, Fedora, NixOS, etc. I don't think native is the right word.

I use bash too but Python is amazing. You're right, there are problems related to packaging and speed, but it is still very often the right tool for the job. It's powerful, easy to use, and open source.

donkeybeer•5m ago
What is the reason you prefer not to simply let python lie around? Security?
ic_fly2•2h ago
pydantic basemodel has made dataclasses redundant.
_Wintermute•2h ago
Dataclasses have the one massive benefit of not being an additional dependency.
ddejohn•10m ago
This. You also don't really need Pydantic unless you're de/serializing data from external sources. A dataclass is perfectly cromulent if you're just passing around data internally.
yomismoaqui•2h ago
Python is the 2nd best language at everything.
nilamo•2h ago
And the first best is python3!
runjake•2h ago
I really don't find the Python language elegant at all. I prefer the Ruby syntax.

But Python's tooling, particularly with what Astral is doing (uv, ruff, ty), is so good, I'm always using Python and virtually never using Ruby. And yeah, the rich libraries, too.

Arch-TK•2h ago
Ubiquitous VSCode - honestly a tragedy.
Night_Thastus•2h ago
I love writing Python. However, there are caveats:

1: I don't like dealing with language crossing boundaries with it - it's painful, especially if to/from a compiled language - there's just too much friction. It's easy to write but hard to maintain.

2: Debugging python can be...painful. If you have a pure perfect environment dedicated to pure python and all the tooling set up, it can be breezy. But if you have something messier like C++ that calls Python or vice-versa and are using an editor not made for Python like QTCreator then suddenly it becomes hell.

Who owns this data!? Where was this initialized!? What calls this function!? What type is this data!?!?!?!? These questions are so effortless in C++ for me and so very painful in Python. It slows efforts to a crawl.

It feels exhausting to have to go back to print statements, grep, and hand-drawing a graph that shows what functions call what just to figure out WTF went wrong. It's painful to a degree that I avoid it as much as possible.

...and don't even get me started on dealing with dependency problems in deployments...

gh02t•2h ago
I've long lusted after a smooth debugging workflow writing Cython that would let you seamlessly debug between Python and C/C++. I think there are some hacks to do it, but nothing really well integrated.
jlarocco•2h ago
When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination.

I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)

wk_end•1h ago
Yes, I'd say Python's crown as the go-to lightweight scripting and web development language was mostly ceded to JS.

It's still reigning champion of data science, and of course it has a huge number of uses and users still around, but it's not really cool or in vogue outside of those circles.

jraph•1h ago
Do people really turn to JS (instead of Python) for lightweight scripting? Are we talking about the "better Bash" use case?
ajkjk•1h ago
that would be very surprising
tempest_•1h ago
JS devs do, and there are a lot of them
roflchoppa•1h ago
I mean if its really light weight, and I want to avoid bash, then JS is not too bad. The downside being that the built-ins are not really there compared to Python.

The famous answer.... _it depends_.

mjr00•1h ago
> It's still reigning champion of data science, and of course it has a huge number of uses and users still around, but it's not really cool or in vogue outside of those circles.

This is a wild take. You're never going to get a fully accurate measurement but every source I've seen[0][1][2] puts Python as the most common programming language by a country mile.

If it doesn't seem "cool" or "in vogue", that's because everyone is already using it.

[0] https://www.tiobe.com/tiobe-index/ [1] https://pypl.github.io/PYPL.html#google_vignette [2] https://www.pluralsight.com/resources/blog/upskilling/top-pr...

slightwinder•1h ago
Python has never been THE web development language, that's always been JavaScript. Python is one of the more popular server-side languages, and JavaScript has move from frontend to backend in the last decade too. Not sure whether this has really taken the crown of any backend-language.

And what is lightweight scripting? Isn't scripting by definition lightweight?

But Python overall is still very popular outside the Data Science-circles. Not sure where this claim is coming from.

ravenstine•1h ago
I personally dislike Python, but it does surprise me that anyone is acting like it's generally disliked because that has definitely not been my impression since time immemorial. I doubt that it's gone out of fashion. More likely, acting like something actually doesn't suck after all has become the clickbait framework du jour.
vinceguidry•1h ago
There are massive numbers of devs who would never even think of trying to code in a dynamically-typed language, even though the big players all have gradual typing. They don't know what they're missing.
leptons•1h ago
I have no problem with dynamically-typed languages, my main problem with Python is the significant whitespace. I really do not like it. I can deal with everything else in Python, or any other programming language, but significant whitespace is what kills it for me.
biztos•39m ago
Having gotten back into Python for a project after some time away, I found the solution (for me) is to automatically fix the whitespace every time I run the code.

I just have a line in my Justfile that does this. Probably would be better to format on save but I use different editors and haven’t gotten around to it.

Still doesn’t fix the creeping doubts about everything in a language conceived by people who made that whitespace call, but it removes the specific pain point.

guhcampos•1h ago
Apparently the author used to be a Java person. I have this feeling - or prejudice - that people still in the Java World are a bit out of tune with the tech industry, working on huge legacy projects on big retail or US banking. These people tend to be conservative and resistant to change, so maybe that's where these types of articles are coming from.
tombert•1h ago
I gave a talk recently at a conference about how modern Java doesn’t suck very much, and that the worst part of Java is Java developers, who seem to be completely intellectually unambitious.

I don’t think Java makes anyone unambitious, I think it’s that Java is taught in schools and unambitious people don’t feel the need to learn anything else, and they get jobs at unambitious corporations. It selection-biases towards unambitious people who don’t want to learn more than they have to.

Compare this to something like Clojure or Haskell or something, which isn’t routinely taught at schools and is not very employable. People who learn these languages generally seek out these things because they’re interested in it. This selection-biases towards intellectually ambitious people.

As a result, Java people can be insufferable for people like me.

The people who make Java have actually made the platform and language pretty ok in the last two decades, but I had to fight at a previous job to use NIO, which I think was introduced in Java 4, but none of my coworkers had really heard of it or used it because the regular Java blocking IO has been “good enough”.

dzonga•28m ago
link to talk please if recorded.

I think one comment I saw here on HN that Java is better if written in Pythonic way. I agree completely with that stance.

but yeah within Java you've 'merchants of complexity' people who wanna do things in the most abstract way rather than the simple way.

btw Java can be as simple as Go.

munificent•1h ago
I have a related feeling or prejudice that people not in the Java World view their corner as "the tech industry" without realizing that they are living in a village compared to the giant metropolis that is the Java World.

Java programmers may not blog as much, and Java doesn't show up on Hacker News as much, but not being Extremely Online does not mean that it isn't extremely widely used by real people whose experiences are just as valid.

bunderbunder•1h ago
If the TIOBE index is an even remotely useful indicator, Python's an even bigger giant metropolis.
trchek•1h ago
You may know all this and are just singling out the Hacker News crowd. But I read your comment and thought "surely he doesn’t think Java is much bigger than Python?" I’m not even sort of sure Python is smaller.

Edit more succinct

dec0dedab0de•1h ago
you could say the same thing about a dozen other languages, but there is definitely a stereotypical cranky java dev that is frustrated writing corporate crud apps that should in theory be blazingly fast, but never quite are for reasons. They revel in the verbosity, and look down on anyone they feel is taking the easy path. If you've never met one you're lucky, but they've been at every company I ever worked for.
PeterStuer•1h ago
I worked in .Net land before switching to Pythonville. It's very much like Java metropolis, but with less CS graduates.
camcil•45m ago
Lest we forget that Python is ~4 years older than Java.
supriyo-biswas•21m ago
This is absolutely correct as someone who has worked in a few Java shops. Although, the same thing is Java's failing, as it is well nigh impossible for people external to the Java ecosystem to learn what's inside it without having work-related exposure.
bunderbunder•1h ago
Java shops are certainly where I've witnessed the most disdain for Python. IME the strongest feelings tend to come from people who didn't actually have any significant experience with Python, and perhaps don't even have much practical experience with any language that isn't Java. So they tended to consider it to be objectively inferior purely because it's interpreted and dynamically typed.

At a previous job I did manage to put a chip in that when I demonstrated replacing one of our Java services with a Python implementation. It was a fraction of the code, and achieved much better latency and throughput. Obviously not every Python program is going to do that. But my point isn't that Python is better, it's that these kinds of things are never so cut-and-dried. Many non-trivial Python programs are just thin shells around a large core of very well-optimized and battle-tested C/C++/Rust code. And Java, for its part, can also accumulate a lot of dynamic language-style performance losses to pointer chasing and run-time type lookups (and GC churn) if you're not careful about how you use generics. As always, the devil's in the details. It's also less able to pull the "actually I'm a C++" trick because using a compacting garbage collector makes it difficult to interop with native code without paying a hefty marshaling tax.

deepsun•46m ago
I have way more experience with Python than Java. In at least 4 companies (including Google that I wouldn't call a javashop) we used mainly Python.

Still I believe Java is a better application language. Python is a better scripting language (replacement for Bash). Small apps tend to be easier on Python, but large apps are way easier on Java, both for syntax (types) and ecosystem (libs).

mey•32m ago
That is general take as well. A lot of small apps/simulators are in python. Ops scripts tend to be python. Java for the core/data. Refactoring/tooling is easier in Java when you are dealing with a 100k codebase imo. Typescript always.

Seen plenty of coding horrors in both ecosystems...

bunderbunder•27m ago
Mostly agreed, though I would add that I'm generally happier with Python as a default for reasonably sized services that don't have a lot of (non-numpy-friendly) compute load and therefore don't have a pressing need for multithreading. Which is a lot of what happens now that we're all trapped in the cloud. Like you say, small apps tend to be easier in Python.
NomDePlum•1h ago
I've always felt X was far superior to Y, and don't get me started on Z or W.
rs186•35m ago
I think at least half of amazon.com and AWS run on Java.
pea•32m ago
I feel like the opposite is also true. People view Java as enterprise Java from 2008; a clunky outdated language for bad, verbose spaghetti code.

In fact, a lot of the most interesting plt and compiler r&d going into real world applications is on the jvm (project loom, graal etc), and the features of modern Java (pattern matching, records, etc) make it a great choice for lots of projects that aren’t legacy enterprise apps.

callc•1h ago
I coded happily in python for many years and fell out of love with it.

It doesn’t ship with a first party package manager so you got the community trying to fill this gap. Use any other language with good tooling like golang or rust and it is a breath of fresh air.

Python used as an actual PL is a footgun because it’s dynamic scripted. (Don’t tell me about using tools X, Y, Z, mypy, …) You essentially become the compiler checking types, solving basic syntax errors when uncommon paths are executed.

A programming language that’s only good for < 100 line scripts is not a good choice.

I honestly wish python were in a better state. I switched to rust.

rsyring•59m ago
> A programming language that’s only good for < 100 line scripts is not a good choice.

What a bunch of crap. It's so trivial to show very popular and useful programs written in Python that far exceed this number I'm not even going to do the work.

What a lazy criticism.

stanleydrew•1h ago
> Is this just junior devs who never learned it

Seems more like it's fallen out of favor with senior devs who have moved to Go/Rust.

ajkjk•1h ago
you'd be crazy (senior or not) not to use Go for Go stuff and Python for Python stuff
biztos•34m ago
I use both, with a preference for Go but I feel like I should be doing more Python just to keep it fresh.

It seems like two of the main entries under “Python stuff” are “working with people who only know Python” and “AI/ML because of available packages.”

What are some others?

pyuser583•1h ago
I consider this self-inflicted. Pythons Async functionality is … unfortunate.

JavaScript has much more intuitive async syntax, which was actually borrowed from a Python framework.

For whatever reasons, the Python folks decided not to build on what they had, and reinvents things from scratch.

bee_rider•1h ago
I don’t know anything about go. But Rust is more of a competitor to C and C++, right? It is sort of bizarre if these languages are butting heads with a scripting language like Python.

Python compares fairly well to Bash or JavaScript or whatever, right? (Maybe JavaScript is better, I don’t know anything about it).

tombert•1h ago
I have had a somewhat unearned distaste for Python for the last decade or so.

I mostly just don’t like some of the design decisions it made. I don’t like that lambdas can’t span multiple lines, I don’t like how slow loops are, I don’t like some functions seem to mutate lists and others don’t, and I am sure that there are other things I missed.

But it really comes down to the fact that my career hasn’t used it much. I occasionally have had to jump into it because of scripting stuff, and I even did teach it for a programming 101 course at a university, but I haven’t had a lot of exposure otherwise.

For scripting stuff for myself, I usually end up using Clojure with GraalVM (yes I know about babashka), or nowadays even just a static linked compiled language like Rust.

I don’t really understand why people think that compiled languages can’t be used for scripting (or at least task automation), honestly. Yes you have to add a compilation step. This involves maybe one extra step during development, but realistically not even that. With Rust I just do cargo run while developing, I don’t see how that’s harder than typing Python.

Joker_vD•1h ago

    msedit main.py && ./main.py
    !!
    !!
But indeed, pressing F5 solves that for both Rust and Python
dec0dedab0de•1h ago
why would you want a lambda to span multiple lines? How would that be any better than a function?
tombert•1h ago
Because sometimes I want to have logic that spans multiple lines and I don't want to assign it a name. An easy example might be something with a `map` or a filter. For example, in JavaScript

    [1,2,3,4].filter(x => {
        let z = x * 2;
        let y = x * 3; 
        let a = x / 2; 
        return (z + x * a) % 27 == 2;
    });
Obviously I know I could name this function and feed it in, but for one-off logic like this I feel a lambda is descriptive enough and I like that it can be done in-place.

You're free to disagree, but I think there's a reason that most languages do allow multi-line lambdas now, even Java.

frutiger•34m ago
Off topic: you didn’t use y.
ddejohn•32m ago
> Obviously I know I could name this function and feed it in, but for one-off logic like this I feel a lambda is descriptive enough and I like that it can be done in-place.

FWIW, you'd also have the benefit of being able to unit test your logic.

rs186•31m ago
If your style is doing a lot of functional programming, multi-line lambda is a very natural thing to do. Other times you want to use a variable or several variables without actually passing it around as an argument. It makes sense especially if you are already used to it in Java/C++/JavaScript/Go.

Is it "better" than a named function? No, of course, they work mostly the same. But we are not talking about better or not. We are talking about syntax just for the sake for syntax, because some people prefer to write code in a way you don't necessarily care about.

bko•43m ago
The most insane python feature is that for loops keep their intermediate variable.

for x in [1,2,3]: print(x)

x sticks around! So you'll always have these random variables floating around, and hope you don't use the wrong one.

And to add insult to insult to injury, if you're using mypy for type checking you'll get a nice error if you try to reuse x with a different type:

for x in ['a', 'b', 'c']: print(x) << Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]

And the types I can never trust. I've used all the tooling and you still get type errors in runtime. It's also ridiculously slow.

I would also like optional chaining (e.g. foo?.bar?.baz) and a million other features that other high level programming languages have.

m0llusk•1h ago
The v2 to v3 transition threw a lot of people.
codethief•53m ago
Can we please stop reiterating the same old stories? That was years ago. Most Python devs these days never wrote a single line of Python 2. I learned it 16 years ago and, while frameworks like Django were still in the middle of the transition back then, I pretty much started learning & writing Python 3 right away.
dec0dedab0de•1h ago
When it got big enough that companies were forcing people to learn it. People automatically hate things they didn't choose themselves.

Plus there has been a rising sentiment against dynamic typing by masochists over the last decade or so.

verandaguy•39m ago

    > by masochists
Hey! The masochism pays dividends. I can't do anything with duck typing that I can't also do with `dyn Trait` abuse :)
macawfish•1h ago
After using Rust's tooling, Python's tooling is obscenely painful. Like intolerable. Which makes some of us feel overwhelmingly frustrated with the language itself. The amount of time I've squandered on Python because of its tooling... I'm never getting that back.

But then uv came along. It's not just another poetry or pipenv or whatever. It works well and it has uvx and `uv tool install` and other nice things.

Previously when I saw that something was written in Python I'd curse under my breath because I don't have the mental energy to make a virtual environment and source its shell script and remember where I put it just to try something out. On arch Linux I can't just pip install something without going through some crazy setup that I used to have patience for but as I get older it's been better to just curse that snake language altogether and spend time doing something more chill like writing rust.

But now I can just type "uvx" and it works. I'm probably not going to start writing python again any time soon, but at least now I have less reason to be disappointed with people who themselves choose to write Python.

jonas21•50m ago
A decade ago, Python was pretty rough around the edges in production. Of course you could make it work, but you had to sacrifice a lot in terms of:

- Environment / dependency management

- Type safety

- Performance

As the author points out, these have largely been addressed now by uv, type hints, pydantic, FastAPI, etc.

dccsillag•33m ago
Typing still sucks big time. Same for perf, unless you are working with numerics that fit with something like NumPy or JAX.
codazoda•47m ago
I haven't tried uv but my biggest pain point with Python has been the way env works. I always find it painful and odd.

Backward compatibility, which I suppose is closely related to needing to use env, is also a pain. In my experience you can't go forward or backward in many cases. It's especially painful on projects that don't change very often. I'm sure that an active codebase can probably be kept updated from version to version, but if you've waited a bunch of versions, it seems painful.

But, I'm not sure I've given it a fair shake because I haven't needed to. It's use in AI does make it an attractive option, now more than ever.

taeric•33m ago
I think for a lot of us, it was very frustrating when it was being pushed with no real analog for the practices we had in other languages. Poetry used to be pushed as how to do dependency management, but it was not obvious that it was not necessarily your build manager, as well. Even today, I'm not entirely clear what the standard approach is for how to manage a project. :(
macawfish•17m ago
If I were to try again I'd go with uv, it seems way way better
whatever1•17m ago
I think during the python 2-> 3 transition period (which was almost a decade long) a lot of people started looking into alternatives, because frankly that mess was the last straw. In the scientific domain this is when Julia started growing.

Of course then crypto bros happened and the rest is history.

whinvik•4m ago
Out of curiosity, why would I use Dataclass vs a Pydantic Basemodel. If we did not have a PyDantic dependency I could imagine wanting to use Dataclass. But if I have it, why not use everywhere?