Python lib generates its code on-the-fly based on usage
32 comments
·May 12, 2025turbocon
anilakar
Didn't someone back in the day write a library that let you import an arbitrary Python function from Github by name only? It obviously was meant as a joke, but with AIcolytes everywhere you can't really tell anymore...
atoav
Why not go further? Just expose a shell to the internet and let them do the coding work for you /s
userbinator
It's like automatically copy-pasting code from StackOverflow, taken to the next level.
null
3abiton
Sounds like a fun way to learn effective debugging.
extraduder_ire
Are there any stable output large language models? Like stablediffusion does for image diffusion models.
tibbar
If you use a deterministic sampling strategy for the next token (e.g., always output the token with the highest probability) then a traditional LLM should be deterministic on the same hardware/software stack.
roywiggins
Deterministic is one thing, but stable to small perturbations in the input is another.
emporas
It imports the bugs as well. No human involvement needed. Automagically.
selcuka
This is amazing, yet frightening because I'm sure someone will actually attempt to use it. It's like vibe coding on steroids.
- Each time you import a module, the LLM generates fresh code
- You get more varied and often funnier results due to LLM hallucinations
- The same import might produce different implementations across runs
baq
There are a few thresholds of usefulness for this. Right now it’s a gimmick. I can see a world in a few years or maybe decades in which we almost never look at the code just like today we almost never look at compiled bytecode or assembly.
latentsea
There's not much of a world in which we don't check up and verify what humans are doing to some degree periodically. Non-deterministic behavior will never be trusted by default, as it's simply not trustable. As machines become more non-deterministic, we're going to start feeling about them in similar ways we already feel about other such processes.
NitpickLawyer
> Non-deterministic behavior will never be trusted by default, as it's simply not trustable.
Never is a long time...
If you have a task that is easily benchmarkable (i.e. matrix multiplication or algorithm speedup) you can totally "trust" that a system can non-deterministically work the problem until the results are "better" (speed, memory, etc).
extraduder_ire
I'm both surprised it took so long for someone to make this, and amazed the repo is playing the joke so straight.
jaflo
See also: https://github.com/drathier/stack-overflow-import
>>> from stackoverflow import quick_sort
>>> print(quick_sort.sort([1, 3, 2, 5, 4]))
[1, 2, 3, 4, 5]
roywiggins
Possibly the funniest part is the first example being a totp library
behnamoh
can it run Doom tho?
from autogenlib.games import doom
doom(resolution=480, use_keyboard=True, use_mouse=True)
polemic
> from autogenlib.antigravity
As a joke, that doesn't feel quite so far-fetched these days. (https://xkcd.com/353/)
conroy
you'd be surprised, but there's actually a bunch of problems you can solve with something like this, as long as you have a safe place to run the generated code
thephyber
I was super interested in genetic programming for a long time. It is similarly non-deterministically generated.
The utility lies in having the proper framework for a fitness function (how to choose if the generated code is healthy or needs iterations). I used whether it threw any interpretation-time errors, run-time errors, and whether it passed all of the unit tests as a fitness function.
That said, I think programming will largely evolve into the senior programmer defining a strategy and LLM agents or an intern/junior dev implementing the tactics.
NitpickLawyer
> That said, I think programming will largely evolve into the senior programmer defining a strategy and LLM agents or an intern/junior dev implementing the tactics.
That's basically what goog wants alphaevolve to be. Basically have domain experts give out tasks that "search a space of ideas" and come up with either novel things, improved algorithms or limits / constraints on the problem space. They say that they imagine a world where you "give it some tasks", come back later, and check on what it has produced.
As long as you can have a definition of a broad idea and some quantifiable way to sort results, this might work.
thornewolf
nooooo the side project ive put off for 3 years
Noumenon72
From now on you'll be able to just do `import side_project` until it works.
pyuser583
Of course, this code was generated by ChatGPT.
malux85
This is horrifying
I love it
bjt12345
Can it input powerpoint slides?
Wow, what a nightmare of a non-deterministic bug introducing library.
Super fun idea though, I love the concept. But I’m getting the chills imagining the havoc this could cause