TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: cataclysm v0.1 – the final Python module?

7 pointsby thoraxabout 2 years ago
cataclysm is an over-the-top experiment to take more of the human out of coding.<p>Any function you give it, it generates and executes. No need to think about what you need, it&#x27;ll make it for you.<p>I haven&#x27;t taught it to use itself yet if a module isn&#x27;t installed, but that&#x27;s next on the agenda once GPT4 isn&#x27;t so slow.<p>Video intro here: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ZK8fUuQDgZ4">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ZK8fUuQDgZ4</a><p>Some random examples when using <i>global</i> cataclysm:<p><pre><code> &gt;&gt;&gt; uhoh = first_prime_with_3_digits() &gt;&gt;&gt; print(uhoh) 101 &gt;&gt;&gt; scary_words = get_italicized_phrases_wikipedia(page=&quot;Global catastrophic risk&quot;, only_lowercase_words=True, min_length=6) &gt;&gt;&gt; print(scary_words[:5]) [&#x27;existential risks&#x27;, &#x27;existential catastrophe[16]&#x27;, &#x27;global&#x27;, &#x27;terminal&#x27;, &#x27;permanent,&#x27;] </code></pre> Fun experiment: I fed it some of the &#x27;tests&#x27; for other simple Python based modules and it was pretty good at implementing what was needed to succeed at them by replacing their module name with `doom.`. Obviously lots it can&#x27;t do, but it&#x27;s already surprisingly reliable.<p>You&#x27;ll need a GPT4 API key-- it works with ChatGPT 3.5 turbo but that code is a little less reliable (and it can&#x27;t generate as lengthy code).<p>It has two modes-- the ridiculous &#x27;global&#x27; cataclysm mode for use in notebooks&#x2F;interpreter that lets you hand-wave any function name and it&#x27;ll cook it up for you. This is a bit scary (a typo turns into random code execution), so the second mode is just to use &#x27;doom.&#x27; in front of any function name and it&#x27;ll generate&#x2F;cache its best guess for the right code given where it&#x27;s called in the call stack (and its name&#x2F;types&#x2F;parameter names&#x2F;etc).<p>A bit extreme, but a small concept to help us adjust to the impending cataclysm ahead of us. :)

2 comments

JohnBerrymanabout 2 years ago
Now that it&#x27;s released, it&#x27;s time to experiment with what it can do.<p>``` from cataclysm import doom<p>def mystery_func(): while True: pass<p># predict if specified function halts print(doom.does_it_halt(mystery_func)) ```
评论 #35399786 未加载
thoraxabout 2 years ago
Now that it&#x27;s released, it&#x27;s time to experiment with what it can do.<p><pre><code> from cataclysm import doom # App gets the img file from the command line and saves it as a new file at half size with _half appended to the name doom.resize_app() </code></pre> Turned out to be all that&#x27;s needed for a command-line file resize app (with PIL installed).