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.

OpenAI's Codex sure knows a lot about HN [video]

374 pointsby tectonicalmost 4 years ago

21 comments

tectonicalmost 4 years ago
Here&#x27;s the entirety of the prompt:<p><pre><code> &lt;|endoftext|&gt;&#x2F;* This code is running inside of a bookmarklet. Each section should set and return _.*&#x2F; &#x2F;&#x2F; The bookmarklet is now executing on example.com. &#x2F;&#x2F; Command: The variable called _ will always contain the previous result. let _ = null; &#x2F;* Command: Add a new primary header &quot;[PAGE TITLE]&quot; by adding an HTML DOM node *&#x2F; (() =&gt; { let newHeader = document.createElement(&#x27;h1&#x27;); newHeader.innerHTML = &#x27;[PAGE TITLE]&#x27;; document.body.appendChild(newHeader); _ = newHeader; return newHeader; })() &#x2F;* Command: Find the first node containing the word &#x27;house&#x27; *&#x2F; (() =&gt; { let xpath = &quot;&#x2F;&#x2F;*[contains(text(), &#x27;house&#x27;)]&quot;; let matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; _ = matchingElement; return matchingElement; })() &#x2F;* Command: Delete that node *&#x2F; (() =&gt; { _.parentNode.removeChild(_); return _; })() &#x2F;* Command: Change the background color to white *&#x2F; (() =&gt; { document.body.style.backgroundColor = &#x27;white&#x27;; _ = document.body; return document.body; })() &#x2F;* Command: Select the contents of the first pre tag *&#x2F; (() =&gt; { let node = document.querySelector(&#x27;pre&#x27;); let selection = window.getSelection(); let range = document.createRange(); range.selectNodeContents(node); selection.removeAllRanges(); selection.addRange(range); _ = selection; return selection; })() &#x2F;&#x2F; The bookmarklet is now executing on [PAGE URL]. It is customized for [PAGE TITLE] and knows the correct CSS selectors and DOM layout. let _ = null; &#x2F;* Command: [USER INPUT] *&#x2F;</code></pre>
tvirosialmost 4 years ago
This might totally work and it&#x27;s kind of impressive if it does. I&#x27;m still biased towards ultra skepticism towards all of this since the trustworthiness of all demos like this is completely corrupted at this point due to cherry picking and other deceptive tricks.
评论 #28193135 未加载
评论 #28192374 未加载
评论 #28192305 未加载
Zenstalmost 4 years ago
I&#x27;ve looked at some demo&#x27;s of OpenAI Codex and it&#x27;s pretty impressive start for sure. Something like this tied into R and a whole level of data analysis would become far more accessible to those with business knowledge who don&#x27;t really want to learn the nuances of tools.<p>But I must say, having lived thru the 80&#x27;s fad of code generating sudo 4gl&#x27;s, the code this produces is pretty darn good indeed.<p>Now when something like this can handle a Google coding exam - that&#x27;s going to be an epic milestone. Though old coding exam questions would equally offer up some great material to push this thru it&#x27;s paces.
评论 #28195375 未加载
monkeydustalmost 4 years ago
Been playing around with codex over the weekend as a on developer. Certainly impressive and also occasionally frustrating when you push it. The natural language to SQL are still the best and most consistent demos.
评论 #28193431 未加载
评论 #28193335 未加载
leereevesalmost 4 years ago
Heh, codex has a sense of humor. When asked to add &quot;a url for the video on YouTube&quot;, codex added the url below. I won&#x27;t spoil the surprise, but it&#x27;s not the video linked in the OP:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dQw4w9WgXcQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dQw4w9WgXcQ</a>
评论 #28192173 未加载
评论 #28192459 未加载
评论 #28192737 未加载
评论 #28193270 未加载
评论 #28192122 未加载
评论 #28193587 未加载
Waterluvianalmost 4 years ago
This was cute and neat until I connected the dots: natural language means voice APIs for cheap.
评论 #28191933 未加载
dangalmost 4 years ago
The submitted URL was <a href="https:&#x2F;&#x2F;twitter.com&#x2F;tectonic&#x2F;status&#x2F;1426980192317177859" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;tectonic&#x2F;status&#x2F;1426980192317177859</a> but the video seems like the real submission here, so I changed it. I also changed the title to a nice representative phrase from the video.
37ef_ced3almost 4 years ago
How does Codex learn the relationship between English and code?<p>Is it purely through the comments in the training corpus?
评论 #28192757 未加载
评论 #28192771 未加载
archibaldJalmost 4 years ago
thanks for the info! great stuff!<p>gpt3&#x27;s generalization-by-description never ceases to amuse me; but the difficult thing here is to get the right abstraction layers layered nicely in the conceptual lasagna.<p>This is where category theory becomes extremely powerful.<p>It has occured to me that codex-davinci has an intuitive &quot;understanding&quot; of constructs like monads, or something along that line.
评论 #28192471 未加载
评论 #28214249 未加载
评论 #28192291 未加载
cushalmost 4 years ago
Imagine trying to do this on a normal site where an input is controlled and nested in 300 divs
评论 #28193844 未加载
aardvarkralmost 4 years ago
That’s incredible to watch and really does go to show that a picture (or video) is worth a thousand words.
评论 #28192693 未加载
astreaalmost 4 years ago
Welp, where will all of us end up when this gets sufficiently complex?
评论 #28192838 未加载
评论 #28194717 未加载
评论 #28192797 未加载
评论 #28197366 未加载
nathan_phoenixalmost 4 years ago
Doesn&#x27;t this only work so well on HN only because HN uses really simple html and css? What about more complex sites?
评论 #28192381 未加载
amrrsalmost 4 years ago
05:39 <a href="https:&#x2F;&#x2F;youtu.be&#x2F;tNcBQBTeyf4" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;tNcBQBTeyf4</a><p>You can see how OpenAI Codex misses some details about HN scraping. What&#x27;s impressive that you might notice is the variable names it chooses which seems to show the nature of HN scraping codes on the internet
naveen99almost 4 years ago
open source attempt at a clone,(not by me…)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;CodedotAl&#x2F;gpt-code-clippy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;CodedotAl&#x2F;gpt-code-clippy</a>
muzsteralmost 4 years ago
if you listen carefully you can hear the music...
MagicWishMonkeyalmost 4 years ago
Any tips on getting this to run as an extension?
评论 #28192315 未加载
8eyealmost 4 years ago
openai as a compiler in the browser would be interesting
评论 #28193196 未加载
deracalmost 4 years ago
maybe see if it can beat a simple forum captcha of the 1+1= variety
zwrightalmost 4 years ago
holy shit
aaron695almost 4 years ago
This demo wouldn&#x27;t have been out of place in the 80&#x27;s.<p>Maybe everyone is smarter now and is is looking at some sort of underlying process. Or maybe it&#x27;s just more of the same.<p>It make no sense to auto fill &#x27;the video&#x27; The correct answer is I don&#x27;t understand. That was a mistake. It also bold&#x27;ed the (site) which is not correct.<p>It&#x27;s a short demo that clearly would have had many test runs.<p>The fact it &#x27;learned&#x27; to do a bad Behat is amazing. But there&#x27;s no reason to think it can equal Behat in 10 years time. Chess AI had a way forward, it&#x27;s not clear this does.