[HN Gopher] A.I. can now write its own computer code - that's go... ___________________________________________________________________ A.I. can now write its own computer code - that's good news for humans Author : flippyhead Score : 41 points Date : 2021-09-10 12:53 UTC (10 hours ago) (HTM) web link (www.nytimes.com) (TXT) w3m dump (www.nytimes.com) | You-Are-Right wrote: | Can it write an AI that writes code? | marstall wrote: | When i think about the work i do as a fairly blue collar front- | end engineer writing react and swift code, it's interesting to | consider how this could fit in and help. | | The problem areas it seems to excel at are somewhat self- | contained, which is in contrast to the code I write, usually all | about integrating multiple systems and bodies of knowledge (user | device, network, data schema, industry practices, product | requirements etc). | | I too rarely, to my occasional regret, have a chance to write a | more pure function whose function can be explained so concisely | as the miraculous codex demos are. Helper functions ("count the | words" etc) are sprinkled throughout my code for sure but are | mostly provided to me by the platforms I inhabit. | | Codex's ability to explain a piece of code in plain english | seemed exciting at first, but the type of "other people's code" I | am usually puzzling over has so many tentacles into the specific | "business rules" and arcana of the service i'm writing to. How | would Codex know about all that? | | Of course codex has already blown my mind several times so I am | quite open to it someday being able to ingest an entire set of | interrelated codebases and break them down for me succinctly. | That doesn't even seem far-fetched, based on what we've seen to | this point. | | The thing that is ringing a bell for me the most is the idea of | it being able to understand APIs and generate correct code for | them. That could be a neat learning tool and save some | boilerplate. Kind of like scaffold-generation code, but on | steroids ... | neonate wrote: | https://archive.md/fz2xN | | http://web.archive.org/web/20210910154656/https://www.nytime... | xyzzy21 wrote: | Good luck with that. | | Simple information theory arguments assure this will not work out | so well. | hasmanean wrote: | My printer can print art. | | That makes it an artist. | krsdcbl wrote: | i like this comparison a lot | abecedarius wrote: | Worth remembering that just a few years before Deep Blue beat | Kasparov, grandmasters were saying that was indefinitely far off. | And that in the face of a clear steady ratings trend. You need to | account for the rate of progress, not just the current abilities. | | (Yes, there's more to software development than coding.) | | (Didn't read the article, it's nytimes.) | brundolf wrote: | Nobody tell them compilers have been writing their own computer | code based on higher-level instructions for half a century ;) | dekhn wrote: | Cade Metz is such a tool. | raxxorrax wrote: | It writes Javascript, that doesn't count. | | I doubt it read any API specs and implemented the code for that | matter. | | The sentence he wrote in this case is probably a programming | language that got transpiled to JS. | | disclaimer: Only saw the picture because the article is behind a | paywall. | Raro wrote: | Codex has the capacity to write decent Python code. A large | part of getting great results from it is writing clear, well | separated, prompts. Also taking it off streaming mode, to get | best N results, and penalizing repetition, improves the output | dramatically. Even better if you can give further hints (e.g. | import pandas) before submitting. | | Of course, it's merely trained on code it's seen on GitHub, so | it certainly has a particular smell to it (disclaimer: I focus | on Data Science related code, which is not always of the | highest quality and has its share of cargo-culting). | | Most of the demos you will likely have seen are in streaming | mode, have vague prompts with a high temperature setting. | chinga1204 wrote: | > I doubt it read any API specs and implemented the code for | that matter. | | That should be easier than an unbounded philosophical | discussion with an eight year old sensemaking vocabulary in- | formation. | [deleted] | ta988 wrote: | How long before people use it to pass interview leetcode-level | questions. | gavinray wrote: | The quality of the code it produces is not very good. | | I have been trying this out, I can share a bit of my | experiences/thoughts below: | | ------- | | I've been writing JavaScript/TypeScript fulltime for ~6-7 years | now. Day in, and day out, and I happen to love + ardently | follow the progress of the language. | | In the middle of my functions using "const" and "for (let thing | of things)", it will try to autosuggest code snippets using | "var" and "for (var i=0, i < things.length; i++) { var thing = | things[i]". | | There's two problems I see here: 1. Languages | evolve. Newer language features that devs should be taking | advantage of don't get suggested because training data doesn't | exist on it yet. 2. The code quality isn't great, as | you have to assume the majority of programmers are not | producing the world's best code, and so that is the data it was | trained on. | | I saw the same thing in Java. Using JDK16, it would never | suggest autocompletions for Records, or multi-line strings, or | pattern matching. | | If I had accepted its suggestions, what I would have wound up | with, was code that TECHNICALLY worked, but was very low | quality and used dated techniques. | | Many things it suggests can now be solved in a few lines using | recent features of languages that there isn't enough training | data on. So it will never suggest them. | samsquire wrote: | Code that uses older constructs is not always bad code. It | almost never means the author is an idiot. Code that is | poorly readable or badly designed is bad code. | | Theres not necessarily an advantage to rewriting older code | with newer versions of the same because it works. | | You're kind of implying that you dont write bad code. But | from your reasoning all your code is bad because a newer way | will replace your code. | | So many opinions about code are wrong and I think you take | something too seriously when it doesn't really matter. If | someone uses var rather than let, that doesn't make them an | idiot, it just means they're using an older construct. The | difference is so unimportant that it rarely makes a | difference to code understandability or readability. | | Most developers go through your phase of thinking other | people are idiots because they don't know something you do. | But in the grand scheme of things, it makes no serious | difference to code quality. That pedantic person just wastes | everybody's time in a code review and spins their wheels when | they could be learning to write more understandable code. | avinassh wrote: | > I have been trying this out, I can share a bit of my | experiences/thoughts below | | How do I try it? Any instructions on setting it up | ta988 wrote: | It is explained in the video... | jvm_ wrote: | Leetcode interview questions will adapt to ask for the wrong | answer. You'll have to write broken code to prove you can code | better than the correct code AI can spit out. | Wildgoose wrote: | I remember "The Last One", a program generator written in 1981. | So the idea of programs writing programs is nothing new. | | Improvements by purposeful self-modification would be a different | matter... | | https://en.wikipedia.org/wiki/The_Last_One_(software) | tluyben2 wrote: | They have been saying our jobs are obsolete because AI longer | than that anyway. The stuff that codex generates is not the | work we do and as such it's pretty useless. I see AI more in | frontend code: have designers think up things and have the AI | generate React that gives the best possible (machine learned) | user experience from those designs (like: this looks like a | form with a list right next to it: that will be best with this | html on mobile and desktop). At least that seems possible now | while writing code that adds value outside that rather does | not. | emanuele232 wrote: | I think i saw a workin product that does exactly that but i | can't remember the name | tluyben2 wrote: | There is at least one that was here about 2 years ago but | was not good. | humanistbot wrote: | The semantics of "AI that can write its own computer code" is | hurting my head. What is the line between an "AI" code generator | that inputs natural language and outputs code in a high-level | software language, versus a high-level language compiler that | inputs structured instructions and outputs machine/bytecode? At | some point, these "AI" / autocoding systems are just a higher | level of code abstraction, right? If you showed a modern python | script to an assembly developer from 1975, they'd probably call | that a code-generating AI. Or am I missing something? | avmich wrote: | I think it's good to remind that a common theme in AI | development history is that whatever advances AI tools | demonstrate become considered "non-AI" - even if before it was | seen as AI-worthy. | yk wrote: | I guess there needs to be some "design" involved in the | process. So a python program determines the sequence of machine | code instructions uniquely (given some assumptions of | repeatable builds, or lets just say on a given computer without | updates and so on...), an AI on the other hand needs to have | some freedom to choose which specific program it runs, lets say | if the specs say "feature X has to be user configurable" then | the AI has to make the decision wether that should be in a | config file or in a GUI element. | endisneigh wrote: | Luckily for anyone in the software writing profession, writing | the actual code is the easy part. Anyone who watches the video in | its entirety will be made painfully aware of this. | | That aside - what I'd actually prefer is something that does the | opposite of this. Rather than write code, I'd rather it actually | help decide what I should be doing, not give me how it's | implemented. | | Example: | | > "Make twitter" | | - "OK. Do you mean a short message sending service like | "Twitter.com" when you say 'twitter'? | | > "Yes" | | - "OK" | | - "How many users are you thinking this will have?" | | > "20 million" | | - "Alright, where are these users located?" | | > "All over the world?" | | - "Will they all be on simultaneously?" | | > "Yes" | | - "OK, what are your latency requirements?" | | > ... | | The end of this discussion could be a fully architected design in | the abstract, with recommendations on specific technologies to | use, the tradeoffs and the costs, if applicable. | | A plus if said architecture could be specified in a way that | makes it easy to deploy. This logic could be used for high level | implementation designs, and even UI/UX. | thesz wrote: | What you describe is an interpolation. It is a solution for | what already exists. You can interpolate this long, bisecting | various axis ranges that specify a problem (short messages | using text, using emojis only, using pictures, using videos, | using...). This is exactly the stuff NN are good for - after | all, they are universal approximators for functions with | bounded domain and bounded codomain. | | At some point of time you will need to extrapolate. Twitter was | an extrapolation, Google was an extrapolation as well. | | Can a system trained to provide you with system design of a | Twitter clone let you help with the design of, say, Medium? | DonHopkins wrote: | It could even design all the dark UI patterns and dopamine | feedback loops and freemium economics and user segmentations | and privacy invasions and personal data exploitations and | penis-swastika logos for you! | BizarroLand wrote: | Why does it have to be penis swastikas? And furthermore, why | has no one investigated the possibility of vagina swastikas? | Aren't we being a bit sexist in the midst of all of this | hyper-racist fascist ideology? | Mirioron wrote: | People like drawing penises and swastikas. I think it's | because they're simple shapes, but also taboo. A bot might | very well imitate that. | gremloni wrote: | I don't agree that writing code is the easy part. Making | changes to and maintaining a huge code base is no joke. | shados wrote: | That kind of makes the point. Writing the code is the easy | part. Designing a system that's easy to maintain is hard. But | a lot of that is decided before you write your first line. | dgb23 wrote: | I love designing programs, programming and everything around | it, it's my job. I constantly jumping back and forth between | being worried that I won't be able to do this in the | foreseeable future and realizing that these systems don't solve | the problems I'm solving. | 37ef_ced3 wrote: | These systems don't solve the problems you're solving? | | Not yet, but give it a couple years. | | You will join the taxi drivers, and so will I. | qualudeheart wrote: | Neither of you is going to be a taxi driver because taxi | driving is easier to automate than software engineering. | | Part of me _is_ pessimistic about AI programming tools, | part of me thinks they'll only enhance the agency of | existing programmers. | | Either way taxi driving is probably easier to automate and | only requires modifications to Tesla's self driving tech. | commandlinefan wrote: | > pessimistic about AI programming tools | | I suspect that these tools (if they do anything at all, | anyway) will just make it harder to learn programming as | a newcomer - just as all the advances in programming that | have come about in my lifetime have. IDE's are great, | until they do something you didn't expect, and then you | have to understand what it is they're automating in order | to figure out how to get them to do what it is you really | want. Try explaining a Java classpath or dependency | problem to somebody who's never opened a command-line | terminal before. Docker is great - until it expects to | find something that you happen to not have installed. | What will probably happen here is that you and I will be | fine, because we'll be able to effortlessly wield these | new tools as they're just doing quickly what we used to | do slowly, but new students to programming will have an | even steeper hill to climb than we did. | brundolf wrote: | The taxi drivers haven't been replaced by computers yet | either. | handrous wrote: | You mean we'll _become_ taxi drivers, or we 'll join them | in unemployment due to self-driving cars? If the latter, | that's great because it means I'm good for at least 20 more | years of this career. | dgb23 wrote: | There are two things that I want to address here. | | For one I still call a Taxi when I need one. Happy to pay a | bit of extra to get a professional driver. I don't want to | bash on people using other services or people providing | those, but it's not for me. | | Similarly my clients call me and my colleagues because they | have a problem that needs solving, we solve it partly with | programming because that is how we can solve it exactly, | reliably and freely. We don't typically use low-code tools | because they can trap us and they don't scale with our | ability and understanding, and the productivity they | promise is true for narrow uses. Our clients don't use them | because it will and has taken them too much time to learn | and use them with mediocre to (really) bad results, they | want the problem to be taken care of and are willing to | make a trade. | | The second point is that I simply refuse to stop adapting | and learning. I'm happily adopting technology into my | repertoire when the tradeoff is worth it. Analyzing and | understanding those tradeoffs is part of the job. Expanding | knowledge is part of the job. And this was always true for | anyone who works in software related fields, our community | always has had to adapt, adopt and evolve, balancing | pragmatism and curiosity. | bumby wrote: | _" insert a Russian book at one end and come out with an | English book at the other," Doctor Dostert predicted that | "five, perhaps three years hence, interlingual meaning | conversion by electronic process in important functional | areas of several languages may well be an accomplished | fact."_[1] | | -IBM Press Release 1954 regarding the 701 translator | | Predicting the problem will be solved in a few short years | is the easy part. Execution to realize those predictions is | much harder. | | [1] https://www.ibm.com/ibm/history/exhibits/701/701_transl | ator.... | BizarroLand wrote: | It would be easy to translate any book into any other | book (if every language was a one-to-one variant of each | other with no differences in slang or metaphor or | cultural backdrop that converts simple turns of phrases | into a medley of aphorisms each deserving of their own | short stories.) | | Other than that all you need is a camera, a computer and | a dictionary. | bumby wrote: | If that were true, we should expect to be able to feed | that initial quote through multiple translations with | minimal meaning loss. Here is the result of translating | that entire phrase from _English - > Greek -> Serbian -> | Creole -> English_ with a popular translating tool: | | _" put a Russian book at one end and an English book at | the other, "predicted Dr. Dostert."_ | | It completely loses its original meaning not to mention | the latter half of the quote. | | I think the constraint of "if every language was a one- | to-one variant" is too constricting to be of use in the | real world. The reason why this is hard is because that | rule rarely holds true. Language is more about | communicating _concepts_ than just words. Translating | one-to-one concepts is much harder because you need to | understand context. | quonn wrote: | Yawn. Seriously, don't worry about it. | 37ef_ced3 wrote: | First they came for Lee Sedol, and I did not speak out-- | Because I was not a professional game player. | | Then they came for the taxi drivers, and I did not speak | out-- Because I was not a taxi driver. | | Then they came for the frontend programmers, and I did | not speak out-- Because I was not a frontend programmer. | | Then they came for me--and there was no one left to speak | for me. | pvaldes wrote: | > they came for me | | They tried, but there was not any taxi on sight | ResearchCode wrote: | Mind that those taxis were all supposed to drive themselves | since 2018. | mLuby wrote: | aicoder< What is a User? nocoder> a User registers | with a unique email and a password of more than 16 characters, | but not the weird ones just the normal ones. Oh, and on | registration give the user a unique id. aicoder< So, | email the user their unique id? nocoder> No, no, | it's our little secret. aicoder< Would you like to | design the registration form now? nocoder> God no, | just make a standard form. With client-side validation. And | server-side validation too, just to be safe. And give it some | flair, we're a cool company after all. aicoder< (I | don't get paid enough for this shit.) nocoder> Wait, | what? aicoder< Would you like to add the flair now? | coding123 wrote: | Wouldn't it be easier to just have people open source a generic | architected 20 million simultaneous user system with low | latency and kubernetes/helm charts as a github project? | enobrev wrote: | That's an interesting use of the word "easy". | postalrat wrote: | I have an idea and all the details. Are you available to do the | easy part? | dkersten wrote: | Just because its easy (relative to everything else, also it | depends on what you mean by "all the details"), doesn't mean | it doesn't take time and therefore money. | | You might argue, _" well then generating the code is still a | win"_ and it might be, but its a micro-optimization. If the | AI can do the easy part but not the hard part, its akin to | shaving seconds from an operation that takes hours. Its | focusing on the wrong thing. If the AI could instead do the | hard part, you would save a lot lot more effort and therefore | money. Once that's done, by all means, automate the easy part | too, but until then, the priorities are off. | | You might still say that this is worth it, saving those | seconds still means you don't have to pay for them, even if | the majority of the cost is still there. This is possibly | true and all well and good. I don't really care, because I'll | still have a job doing the hard part. The issue is that when | these AI's are mentioned, the "hard part" is always glossed | over, the AI is sold as this thing that will automate all | development, where it really should be sold as a thing that | shaves a little off the total cost of development, but that | the hard and therefore expensive parts are still there. | | Sure, there are some development tasks that are fairly | trivial and some companies that do mainly these might go out | of business, but you still have the stories of oracle selling | a website to the government agency for $100 million, because | it has to interact with a slew of legacy systems, deal with | ambiguous tax codes/regulations/requirements. There's a lot | of tech out there that has these complexities and that's not | going to be automated by these AI's for now, until they | tackle _" the hard part"_. | | A note on "all the details": if you truly have all the | details (refined unambiguous requirements, detailed | architecture with all the use cases and edge cases outlined | and documented, technology tradeoffs investigated and | documented etc etc) then great, it would be quick, easy and | cheap to implement then. Unfortunately, what is more common, | is that a non-developer will say this and "all the details" | really isn't all the details at all and just the tip of the | iceberg. | Traubenfuchs wrote: | Whenever a smart business career friend comes to me with a | wagging tail telling me about this "idea that will change | anything", unable to tell me what his value would be in the | partnership I would like to be allowed to slap them once. | endisneigh wrote: | maybe - what's your idea and the details? If your details | leave any room for ambiguity then we'll have to call off the | engagement :) | sschueller wrote: | I am not looking forward to the day I have to fix or enhance | legacy code written by some AI that is long gone and no one knows | how anything works... | refactor_master wrote: | Then you put another AI on top of that, designed to fix legacy | code bugs. | | And another AI on top of that, and... | aogaili wrote: | While this impressive but building software is about the larger | understating of the environment and the intent of the users etc. | Coding is just translating the solution from the developers head | to the machines to execute. | | This is coding using natural language. It associates natural | language text with code but it understands nothing really in the | way humans understand larger context. | sharemywin wrote: | Here's a pretty impressive demo. | | https://www.youtube.com/watch?v=SGUCcjHTmGY | | I think they said it handles something like 37% of requests. | | Btw, don't watch it if your worried at losing your job to a | computer. | bavell wrote: | Watched it, very impressive for AI but not at all worried about | losing my job :) | Traubenfuchs wrote: | Hi! What is your job and why are you not worried? | | I am also looking for reasons not to be worried! | wing-_-nuts wrote: | https://www.old.reddit.com/r/financialindependence | endisneigh wrote: | i'm curious - if you're worried based off that video - why? | Traubenfuchs wrote: | I wrote what I wrote before watching it. After watching | it I am not afraid for the coming... 5-10 years. Ok. But | what then? Why am I afraid, what am I afraid of? | | In the last years "AI" started to make surprising leaps | every few years. What we got now is the "child of a new | species". It's still a child. But it can grow. The | species we are seeing scares me, as an overpaid | codemonkey. I can compete with a child of it, but I could | not compete with an adult of it. Imagine this system, but | more advanced, more tuned to your specific domain. | | The systems we work with are all trapped in mind boggling | complexity, but what if AI starts to untangle this, what | if AI starts to truly become the only human-machine | interface to produce software? | OneEyedRobot wrote: | It seems to me that the problem from a programmers | standpoint isn't that their job will disappear but that | the definition of their job will change quite a lot. | | I always think of the example of supermarket cashiers. | Formerly a fairly skilled job but now merely providing | cheap meat-robot manipulators for a scanner. The person | is still there but has a job concentrated down to the few | things a person does better, and those things aren't | always the fun things. | bcrosby95 wrote: | I don't see a world where this happens. Not because the | AI will never be smart enough, but instead because if the | system is smart enough to turn this into a low skill job, | then you could just have domain experts use it - which is | the holy grail of programming tools. | MrsPeaches wrote: | I wonder if "coding/coder" will go the same way as | "computing/computer" [1] | | [1] https://en.m.wikipedia.org/wiki/Computer_(occupation) | sethammons wrote: | That is a very impressive demo! However, I don't see this as a | job eliminator. I see this as a turbo button for some | development tasks, like starting out and scaffolding an | application. Notice that they still had to define "functions" | that the neural net could then leverage, they had to speak in | precise ways in a given order; it is a different way of coding, | but still coding. | Andy_G11 wrote: | This is pretty amazing. The guys are absolutely right - it's | still early days for this tech and the sky would seem to be the | limit. | | Coders are always climbing the learning ladder and should add | co-working with a code-writing AI to their toolkit, especially | if it truly is 'open' (CoPilot will be a paid service I | believe?). | | The long term possibilities for eliminating many types of | labour seem enormous. It is not so easy yet to understand what | forms of labour will be not only resilient in the face of this | developing tech, but even 'antifragile' to it. If these are few | (could by definition be an oxymoronic assumption), how will the | relative returns on labour vs returns on asset ownership | diverge? Will a fundamental revision of socio-economic systems | be required? | howmayiannoyyou wrote: | Evaluated OpenAI Codex for weeks now. It cuts 1/2 the time off my | current coding time, largely by producing syntax correct code & | reducing lookups to docs/stack/etc. | | At the same time, it's hopelessly wrong or broken about 1/3 of | the time. | | On balance - it is revolutionary. For real world use - it is | still very experimental. | avmich wrote: | Can we ask Codex to write in languages like Haskell where it's | hard to make "small" mistakes, because types are catching you? | Or does it circumvent that? | PartiallyTyped wrote: | Considering Haskell is much more dense than most languages, | it should be harder to create those small mistakes because | the produced code is much shorter, but I haven't tested it, | so take this with a grain of salt. ___________________________________________________________________ (page generated 2021-09-10 23:00 UTC)