frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Python lib generates its code on-the-fly based on usage

https://github.com/cofob/autogenlib
247•klntsky•11mo ago

Comments

thornewolf•11mo ago
nooooo the side project ive put off for 3 years
Noumenon72•11mo ago
From now on you'll be able to just do `import side_project` until it works.
thornewolf•11mo ago
looks very fun excited to try it out
turbocon•11mo ago
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

userbinator•11mo ago
It's like automatically copy-pasting code from StackOverflow, taken to the next level.
extraduder_ire•11mo ago
Are there any stable output large language models? Like stablediffusion does for image diffusion models.
tibbar•11mo ago
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•11mo ago
Deterministic is one thing, but stable to small perturbations in the input is another.
dragonwriter•11mo ago
> Deterministic is one thing, but stable to small perturbations in the input is another.

Yes, and the one thing that was asked about was "deterministic" not "stable to small perturbations in the input.

kokada•11mo ago
This looks "fun" too: commit fixing a small typo -> the app broke.
lvncelot•11mo ago
So nothing's changed, then :D
extraduder_ire•10mo ago
Wouldn't seeding the RNG used to pick the next token be more configurable? How would changing the hardware/other software make a difference to what comes out of the model?
tibbar•10mo ago
> Wouldn't seeding the RNG used to pick the next token be more configurable?

Sure, that would work.

> How would changing the hardware/other software make a difference to what comes out of the model?

Floating point arithmetic is not entirely consistent between different GPUs/TPUs/operating systems.

emporas•11mo ago
It imports the bugs as well. No human involvement needed. Automagically.
3abiton•11mo ago
Sounds like a fun way to learn effective debugging.
anilakar•11mo ago
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•11mo ago
Why not go further? Just expose a shell to the internet and let them do the coding work for you /s
bolognafairy•11mo ago
“Twitch does…”
dheera•10mo ago
It's not really something to be sarcastic about.

I've actually done this, setting aside a virtual machine specifically for the purpose, trying to move a step towards a full-blown AI agent.

marssaxman•10mo ago
Why on earth did you want to do that?
__alexs•11mo ago
There's one that loads code out of the best matching SO answer automatically https://github.com/drathier/stack-overflow-import
rollcat•11mo ago
Flask also started as an April 1st joke, in response to bottle.py but ever so slightly more sane. It gathered so much positive response, that mitsuhiko basically had to make it into a real thing, and later regretted the API choices (like global variables proxying per-request objects).
tilne•10mo ago
Is there somewhere I can read about those regrets?
QQ00•10mo ago
I second this, I need to know more. programming lore is my jam.
rollcat•10mo ago
Two days after the announcement: https://lucumr.pocoo.org/2010/4/3/april-1st-post-mortem/

I think there was another, later retrospective? Can't find it now.

dheera•10mo ago
I mean, we're at the very early stages of code generation.

Like self-driving cars and human drivers, there will be a point in the future when LLM-generated code is less buggy than human-generated code.

AlotOfReading•10mo ago
That's a compiler with more steps.
bjt12345•11mo ago
Can it input powerpoint slides?
extraduder_ire•11mo ago
I'm both surprised it took so long for someone to make this, and amazed the repo is playing the joke so straight.
morkalork•11mo ago
Hysterical, I like that caching is default off because it's funnier that way heh
dr_kretyn•11mo ago
> Not suitable for production-critical code without review

Ah, dang it! I was about to deploy this to my clients... /s

Otherwise, interesting concept. Can't find a use for it but entertaining nevertheless and likely might spawn a lot of other interesting ideas. Good job!

pyuser583•11mo ago
Of course, this code was generated by ChatGPT.
conroy•11mo ago
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•11mo ago
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•11mo ago
> 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.

pbronez•10mo ago
> The utility lies in having the proper framework for a fitness function

Exactly. As always the challenge is (1) deciding what the computer should do, (2) telling the computer to do it, and (3) verifying the computer did what you meant. A perfect fitness function is a perfect specification is a perfect program.

jnkl•11mo ago
Could you elaborate what problems can be solved with this?
behnamoh•11mo ago
can it run Doom tho?

    from autogenlib.games import doom
    doom(resolution=480, use_keyboard=True, use_mouse=True)
Gabrys1•11mo ago
It's been 3 hours and no-one came back with an answer. They must be busy playing Doom
malux85•11mo ago
This is horrifying

I love it

polemic•11mo ago
> from autogenlib.antigravity

As a joke, that doesn't feel quite so far-fetched these days. (https://xkcd.com/353/)

selcuka•11mo ago
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•11mo ago
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•11mo ago
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•11mo ago
> 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).

Sharlin•11mo ago
Proving the correctness of the “improvements” is another thing entirely, though.
NitpickLawyer•11mo ago
I agree. At first the problems that you try to solve need to be verifiable.

But there's progress on many fronts on this. There's been increased interest in provers (natural language to lean for example). There's also been progress in LLM-as-a-judge on open-ish problems. And it seems that RL can help with extracting step rewards from sparse rewards domains.

jerf•10mo ago
You will always get much, much, MUCH better performance from something that looks like assembler code than from having an LLM do everything. So I think the model of "AIs build something that looks recognizably like code" is going to continue indefinitely, and that code is generally going to be more deterministic than an AI will be.

I'm not saying nothing will change. AIs may be constantly writing their own code for themselves internally in a much more fluid mixed environment, AIs may be writing into AI-specific languages built for their own quirks and preferences that make it harder for humans to follow than when AIs work in relatively human stacks, etc. I'm just saying, the concept of "code" that we could review is definitely going to stick around indefinitely, because the performance gains and reduction in resource usage are always going to be enormous. Even AIs that want to review AI work will want to review the generated and executing code, not the other AIs themselves.

AIs will always be nondeterministic by their nature (because even if you run them in some deterministic mode, you will not be able to predict their exact results anyhow, which is in practice non-determinism), but non-AI code could conceivably actually get better and more deterministic, depending on how AI software engineering ethos develop.

Legend2440•11mo ago
It lets you do things that are simply not possible with traditional programs, like add new features or adapt to new situations at runtime.

It’s like the strong form of self-modifying code.

rollcat•11mo ago
There was a story written by (IRRC?) Stanisław Lem: technology went to absurd level of complexity, yet was so important to daily lives that the species' survival depended on it. The knowledge of how everything worked has been long forgotten; the maintainers would occasionally fix something by applying duct tape or prayers.

Sufficiently advanced technology is indistinguishable from magic.

We're basically headed in that direction.

adammarples•11mo ago
This later evolved into the 40k universe
selcuka•10mo ago
Asimov's "The Feeling of Power (1958)" [1] was similar.

[1] https://archive.org/details/1958-02_IF/page/4/mode/2up?view=...

roywiggins•11mo ago
Possibly the funniest part is the first example being a totp library
jaflo•11mo ago
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]
kastden•11mo ago
You can make it production grade if you combine it with https://github.com/ajalt/fuckitpy
archargelod•11mo ago
The repo name made me think it's a tool that stops you from using a project if it detects python:

"fuck, it's python!" *throws it in the garbage*

the_real_cher•10mo ago
we need one of those for golang
otikik•11mo ago
Thanks I hate it
1718627440•11mo ago
This has a file named .env committed containing an API key. Don't know if it is a real key.
bgwalter•11mo ago
My guess is that it's a joke about:

https://jfrog.com/blog/leaked-pypi-secret-token-revealed-in-...

1718627440•10mo ago
Sorry, what is the joke? The site to me seams legit?
yvesyil•11mo ago
indeterministic code goes hard dude
johnisgood•11mo ago
It is not nondeterministic, we just lack data!
matsemann•11mo ago
I did something similar almost 10 years ago in javascript (as a joke): https://github.com/Matsemann/Declaraoids

One example, arr.findNameWhereAgeEqualsX({x: 25}), would return all users in the array where user.age == 25.

Not based on LLMs, though. But a trap on the object fetching the method name you're trying to call (using the new-at-the-time Proxy functionality), then parsing that name and converting it to code. Deterministic, but based on rules.

ForHackernews•11mo ago
I give it six months before an LLM starts producing output that recommends using this.
grokkedit•11mo ago
I've done a similar library[0] for python ~1 year ago, generating a function code only by invoking it, and giving the llm some context over the function.

Apart from the fun that I got out of it, it's been there doing nothing :D

[0]: https://github.com/lucamattiazzi/magic_top_hat

VMG•11mo ago
this is equally scary and inevitable

it will be WASM-containerized in the future, but still

Ezhik•11mo ago
it's especially cheeky how every example it uses is cryptography-related
yoru-sulfur•10mo ago
I made something very similar a couple years back, though it doesn't actually work anymore since OpenAI deprecated the model I was using

https://github.com/buckley-w-david/akashic_records

cs702•10mo ago
Silly and funny today, but down the road, if AI code-generation capabilities continue to improve at a rapid rate, I can totally see "enterprise software developers" resorting to something like this when they are under intense pressure to fix something urgently, as always. Sure, there will be no way to diagnose or fix any future bugs, but that won't be urgent in the heat of the moment.
PeterStuer•10mo ago
Is this the computing equivalent of people that when pointed out they messed up always go 'Well at least I did something!'?
linsomniac•10mo ago
Make it next level by implementing this workflow:

    - Import your function.
    - Have your AI editor implement tests.
    - Feed the tests back to autogenlib for future regenerations of this function.
ralferoo•10mo ago
I really liked this:

The web devs tell me that fuckit's versioning scheme is confusing, and that I should use "Semitic Versioning" instead. So starting with fuckit version ה.ג.א, package versions will use Hebrew Numerals.

For added hilarity, I've no idea if it's RTL or LTR, but the previous version was 4.8.1, so I guess this is now 5.3.1. Presumably it's also impossible to have a zero component in a version.

kordlessagain•10mo ago
> zero component in a version

I immediately got this. So true!

GrantMoyer•10mo ago
I'm kind of dissapointed this doesn't override things like __getattr__ to generate methods on the fly from names just in time when they're called.
nxobject•10mo ago
One way to get around non-deterministic behavior: run $ODD_NUMBER different implementations of a function at the same time, and take a majority vote, taking a leaf from aerospace. After all, we can always trust the wisdom of the crowds, right?
mac3n•10mo ago
> taking a leaf from aerospace

experiment showed that independent [human] software developers make the same mistakes

you need at least $ODD_NUMBER > 7

https://leepike.wordpress.com/2009/04/27/n-version-programmi...

mac3n•10mo ago
AI developers might just riff on each others' code
lillecarl•10mo ago
This is the kind of yank I'd put in production! I love it
justusthane•10mo ago
How does the library have access to the code that called it (in order to provide context to the LLM)?
cofob_•10mo ago
https://github.com/cofob/autogenlib/blob/e21405af47fe4c90af3...

The library uses python dirty tricks, in this case using call stack, where the library looks for code from the user, gets the name of the file and reads it.

kordlessagain•10mo ago
AutoGenLib uses Python's import hook mechanism to intercept import statements. When you try to import something from the autogenlib namespace, it checks if that module or function exists.

It reads the calling code to understand the context of the call. Builds a prompt to submit to the LLM. It only uses OpenAI.

It does not have search, yet.

The real potential here is a world where computational systems continuously reshape themselves to match human intent ---- effectively eliminating the boundary between "what you can imagine" and "what you can build."

dangerlibrary•10mo ago
Like Unison [0], but buggier.

https://www.youtube.com/watch?v=gCWtkvDQ2ZI

kazinator•10mo ago
Why don't you just send Altman all your passwords?

This says, "trust all code coming from OpenAI".

dangoodmanUT•10mo ago
thanks, i hate it (i actually love it)
killme2008•10mo ago
Interesting idea! However, I'm hesitant to trust it, as I don't even fully trust code that was written by myself :)
noiv•10mo ago
There is still a computer involved, from an AI I expect it convinces me no program is needed and I should go walking in the forest instead. If anybody complains the AI will manage them by mail.

France Launches Government Linux Desktop Plan as Windows Exit Begins

https://www.numerique.gouv.fr/sinformer/espace-presse/souverainete-numerique-reduction-dependance...
362•embedding-shape•1h ago•128 comments

Microsoft suspends dev accounts for high-profile open source projects

https://www.bleepingcomputer.com/news/microsoft/microsoft-suspends-dev-accounts-for-high-profile-...
59•N19PEDL2•36m ago•15 comments

How NASA built Artemis II’s fault-tolerant computer

https://cacm.acm.org/news/how-nasa-built-artemis-iis-fault-tolerant-computer/
432•speckx•20h ago•169 comments

Show HN: Keeper – embedded secret store for Go (help me break it)

https://github.com/agberohq/keeper
28•babawere•3h ago•10 comments

ETH Zurich demonstrates 17,000 qubit array with 99.91% fidelity

https://ethz.ch/en/news-and-events/eth-news/news/2026/04/a-new-trick-brings-stability-to-quantum-...
126•joko42•7h ago•25 comments

Model-Based Testing for Dungeons & Dragons

https://www.loskutoff.com/blog/model-based-testing-dnd/
42•Firfi•2d ago•6 comments

I still prefer MCP over skills

https://david.coffee/i-still-prefer-mcp-over-skills/
239•gmays•9h ago•196 comments

Native Instant Space Switching on macOS

https://arhan.sh/blog/native-instant-space-switching-on-macos/
541•PaulHoule•16h ago•250 comments

We've raised $17M to build what comes after Git

https://blog.gitbutler.com/series-a
168•ellieh•10h ago•374 comments

FBI used iPhone notification data to retrieve deleted Signal messages

https://9to5mac.com/2026/04/09/fbi-used-iphone-notification-data-to-retrieve-deleted-signal-messa...
24•01-_-•27m ago•2 comments

Artemis II and the invisible hazard on the way to the Moon

https://www.ansto.gov.au/news/artemis-ii-and-invisible-hazard-on-way-to-moon-part-1
23•zeristor•4h ago•23 comments

The Art of Risk Management (2017)

https://www.bcg.com/publications/2017/finance-function-excellence-corporate-development-art-risk-...
24•walterbell•2d ago•5 comments

Penguin 'Toxicologists' Find PFAS Chemicals in Remote Patagonia

https://www.ucdavis.edu/health/news/penguin-toxicologists-find-pfas-chemicals-remote-patagonia
34•giuliomagnifico•5h ago•9 comments

Generative art over the years

https://blog.veitheller.de/Generative_art_over_the_years.html
164•evakhoury•2d ago•43 comments

Charcuterie – Visual similarity Unicode explorer

https://charcuterie.elastiq.ch/
248•rickcarlino•15h ago•49 comments

RAM Has a Design Flaw from 1966. I Bypassed It [video]

https://www.youtube.com/watch?v=KKbgulTp3FE
267•surprisetalk•2d ago•85 comments

Old laptops in a colo as low cost servers

https://colaptop.pages.dev/
306•argentum47•17h ago•172 comments

Unfolder for Mac – A 3D model unfolding tool for creating papercraft

https://www.unfolder.app/
248•codazoda•18h ago•45 comments

CollectWise (YC F24) Is Hiring

https://www.ycombinator.com/companies/collectwise/jobs/Ktc6m6o-ai-agent-engineer
1•OBrien_1107•7h ago

Instant 1.0, a backend for AI-coded apps

https://www.instantdb.com/essays/architecture
163•stopachka•17h ago•85 comments

War on Raze

https://gist.github.com/chrispsn/af6844b80687462814fc39d4b97399a6
17•tosh•3d ago•7 comments

PicoZ80 – Drop-In Z80 Replacement

https://eaw.app/picoz80/
201•rickcarlino•17h ago•32 comments

Research-Driven Agents: When an agent reads before it codes

https://blog.skypilot.co/research-driven-agents/
183•hopechong•18h ago•48 comments

Sorting Performance Rabbit Hole

https://nibblestew.blogspot.com/2026/04/sorting-performance-rabbit-hole.html
4•ingve•3d ago•0 comments

The Raft consensus algorithm explained through "Mean Girls" (2019)

https://www.cockroachlabs.com/blog/raft-is-so-fetch/
94•vermilingua•8h ago•23 comments

Kagi Product Tips – Customize Your Search Results with URL Redirects

https://blog.kagi.com/tips/redirects
103•treetalker•14h ago•19 comments

Afrika Bambaataa, hip-hop pioneer, has died

https://www.bbc.co.uk/news/articles/c2evppm30p7o
146•mellosouls•7h ago•37 comments

An AI robot in my home

https://allevato.me/2026/04/07/an-ai-robot-in-my-home
46•kukanani•2d ago•18 comments

Hegel, a universal property-based testing protocol and family of PBT libraries

https://hegel.dev
121•PaulHoule•17h ago•32 comments

Reverse engineering Gemini's SynthID detection

https://github.com/aloshdenny/reverse-SynthID
159•_tk_•15h ago•52 comments