[HN Gopher] An Elixir/LiveView game written entirely by ChatGPT
___________________________________________________________________
An Elixir/LiveView game written entirely by ChatGPT
Author : heeton
Score : 160 points
Date : 2022-12-03 16:20 UTC (6 hours ago)
(HTM) web link (thetinycto.com)
(TXT) w3m dump (thetinycto.com)
| thisisthenewme wrote:
| This seems a bit scary because of its potential impact on me as a
| Software Developer. On the other hand, I'm also very excited to
| use this in personal projects and for learning. At least at its
| current state, however, it doesn't seem all that trustworthy. I
| was trying to see if it can give me good answers to queries that
| I've been unable to find with Google. For instance for query "How
| can I generate a kubernetes token that can be used to access a
| cluster?", it replied with answer for kubeadmin which is
| reasonable because I didn't give any context. I'm using k3s so I
| needed an approach that worked with it. I followed up with "Is
| there a specific command to do the above in k3s?". It responded
| to that with the following. Yes, k3s is a
| lightweight Kubernetes distribution that includes a utility
| called k3s-kubeconfig that can be used to generate Kubernetes
| tokens. k3s-kubeconfig is a command-line tool that is included
| with k3s, and it provides various subcommands for generating and
| managing Kubernetes tokens and configuration files. To
| generate a Kubernetes token with k3s-kubeconfig, you can use the
| token generate subcommand. This subcommand allows you to specify
| the token's expiration time, as well as the authentication groups
| and usernames that it should be associated with. Here
| is an example of how to use the k3s-kubeconfig command to
| generate a Kubernetes token: k3s-kubeconfig token
| generate \ --ttl 24h \ --groups
| system:bootstrappers:kubeadm:default-node-token \
| --username kubelet-bootstrap In this example, we use
| the k3s-kubeconfig token generate subcommand to generate a new
| Kubernetes token. We specify a time-to-live (TTL) of 24 hours
| using the --ttl flag, and we associate the token with the
| system:bootstrappers:kubeadm:default-node-token authentication
| group and the kubelet-bootstrap username. Please note
| that this is just an example, and you may need to adjust the
| k3s-kubeconfig command and its flags according to your specific
| k3s setup and configuration. For more information, you can refer
| to the k3s-kubeconfig documentation or consult a k3s expert.
|
| I was initially impressed because after all my Google searches, I
| had never learned that there was a `k3s-kubeconfig` tool. That
| excitement quickly turned into amusement because turns out the
| tool doesn't exist.
| ilaksh wrote:
| I'm imagining that someone who understands how this stuff works
| will eventually make a system similar to ChatGPT but also give it
| the ability to interact with a programming environment and work
| towards a working program iteratively.
|
| But its really going to be something when it also "understands"
| whats happening on screen, such as the input fields, buttons,
| etc., rather than just text.
|
| Is there a community like a Discord or reddit or something that
| is specifically tracking AI programs that write programs for you?
| I feel like it is now important for me to take advantage of these
| tools in order to stay relevant as a programmer. Or at least, the
| stuff that comes out in the next few years.
| dchichkov wrote:
| The current approach in which ChatGPT is trained likely allows
| for that. ChatGPT keeps claiming it is a "language model". In
| fact it is a reinforcement learning agent trained with proximal
| policy optimization. We've certainly seen reinforcement
| learning agents (trained with PPO) interacting with what
| happens on screen (such as playing StarCraft, etc) and
| outplaying best human players. So yes, I expect we'll see a lot
| of interesting stuff in the next few years.
| booleandilemma wrote:
| You're saying it's lying about itself?
| ronsor wrote:
| In my experience, ChatGPT lies a surprising amount - not
| really on purpose, though. It'll claim to be incapable of
| certain things, but still do them (and well!) if coaxed.
| counttheforks wrote:
| It's also happy to spew nonsense and claim it as fact.
| davidw wrote:
| Holy crap does this thing keep amazing me.
|
| I asked it to write me some code in Erlang that displays a
| mandelbrot set in ascii. I did have to tweak a few things it did
| not get quite right, but:
| $$$
| $$$
| $ $$$$$$$$
| $$$$$$$$$$$$$
| $$$$$$$$$$$$$$$
| $$$$$$$$$$$$$$$$$
| $ $$$$$$$$$$$$$$$$$
| $$$$$ $$$$$$$$$$$$$$$$$$
| $$$$$$$ $$$$$$$$$$$$$$$$$
| $ $$$$$$$ $$$$$$$$$$$$$$$$$
| $ $$$$$$$ $$$$$$$$$$$$$$$$$
| $$$$$$$ $$$$$$$$$$$$$$$$$
| $$$$$ $$$$$$$$$$$$$$$$$$
| $ $$$$$$$$$$$$$$$$$
| $$$$$$$$$$$$$$$$$
| $$$$$$$$$$$$$$$
| $$$$$$$$$$$$$
| $ $$$$$$$$
| $$$
| $$$
| spyder wrote:
| ChatGPT is awesome and seems better than OpenAI's codex
| playground.
|
| Asked both of them to draw an owl in JavaScript and codex
| produced non-sense rectangles or circles with multiple tries:
|
| https://jsfiddle.net/709wxmc1/
|
| ChatGPT produced working code for a very simple bird head at
| first try and then I also asked to animate the eyes:
|
| https://jsfiddle.net/Lb6suzad/
| mrtksn wrote:
| I've tried the same earlier today on ChatGPT. It was mostly hit
| and miss but what I find impressive is that when the code
| would't work, I was able to tell to fix it it it was fixed
| every time.
| YeGoblynQueenne wrote:
| It's, uh, fascinating: GPT: Graveyards, Pits &
| Treasure Gems: 0 [Dig up the next
| grave?] Gems: 10 [Dig up the next
| grave?] Gems: 20 [Dig up the next
| grave?] Gems: 30 [Dig up the next
| grave?] Gems: 40 [Dig up the next
| grave?] Gems: 50 [Dig up the next
| grave?] Gems: 60 [Dig up the next
| grave?] ... [Dig up the next grave?]
| Gems: You fell into a pit. You are dead
|
| Edit: yes, it's code that works. But how much can it do? So far,
| not so much. And we've had things that could generate code that
| works for decades, only people weren't interested because it
| wasn't neural nets and they weren't advertised by OpenAI &
| Microsoft or Google. Search for "program synthesis".
| qsort wrote:
| Precisely. There's a schizophrenic attitude around LLM. People
| simultaneously refuse to accept what they're really good at and
| attribute to them capabilities they don't really have.
|
| In this very thread there are people who claim they're afraid
| gpt3 is coming for their job. You must really suck at
| engineering if you think this is competition.
| JacksonGariety wrote:
| > People simultaneously refuse to accept what they're really
| good at and attribute to them capabilities they don't really
| have.
|
| That's called neurosis generally.
| coffeebeqn wrote:
| Yeah this is hardly a game? The only choice is keep adding +10
| or close the browser tab.
| blacksmithgu wrote:
| ChatGPT could probably pass most FAANG programming interviews -
| it's successfully done linked list inversion, binary tree
| searches, dynamic programming like knapsack, and will even do
| program design if you ask it how to design a data structure or
| class.
| Der_Einzige wrote:
| It's been an open secret on blind that cheating on remote
| interviews is highly, highly common, and has been with language
| models since late 2019. Best part is that these same folks end
| up getting promoted because as it turns out once you have
| passed the stupid coding hazing ritual, most jobs at the FAANG
| will NOT need you to solve leetcode style problems.
|
| I'm honestly excited as heck that something will finally kill
| off this practice. Don't let the door hit you on the ass on the
| way out, leetcode.
| bugfix-66 wrote:
| The training set is full of code for these problems.
|
| Put your query into Google and see how many thousands of
| answers appear.
|
| Your tests are in the training set.
| avip wrote:
| True but the horrifying truth is 95% of our actual problems
| at work are also in the training set...
| dpflan wrote:
| This idea is why I wanted to see the code created by GPT at
| each step during this conversation for this post...
| teaearlgraycold wrote:
| Oh wow. I'd love to see someone set up an environment where GPT
| solves a programming interview incrementally as a human would -
| with a teleprompter of describe-as-you-go text for the
| interviewee to read out. Couple it with speech-to-text for
| follow up questions and you can conman your way through any
| coding focused interview.
|
| Not that I want or need this to pass interviews. But it would
| finally force the industry to find a better way to evaluate
| candidates.
| aloner wrote:
| Cheat on your Technical Interview as a Service(tm)
| ninkendo wrote:
| I pasted in the question I typically ask candidates at $dayjob.
| It did better than the _vast majority_ of candidates. (It's a
| very open ended architectural question that's specific to the
| industry I'm in.)
|
| At the end I said "write it in Rust" and it wrote a plausibly
| good implementation.
|
| I'm not sure I can trust remote interviews any more...
| qzw wrote:
| Actually it sounds like recruiting just got a lot easier for
| you!
| xrd wrote:
| But if it's a remote job, won't that same developer do great
| by just delegating all their tasks to the AI, just like they
| did in the interview? Crazy stuff.
| naiv wrote:
| Same here. It passed the tests for backend / frontend and
| created perfect unit tests as well.
| abecedarius wrote:
| That's close to answering a question from a bit over a year
| ago: "in 5 years will there be an AI that's better than 90%
| of unassisted working programmers at solving new leetcode-
| type coding interview questions posed in natural language?"
| https://news.ycombinator.com/item?id=29020401
|
| It didn't get a very welcoming reception -- "highly
| unlikely", and the tenor of other opinions in those comments
| then tended the same way. But I was being too _conservative_.
| (I thought so at the time but it felt sort of outside an
| Overton window of reasonable technology opinions.)
| desireco42 wrote:
| I don't get it. It is just a button with number going up.
|
| Is there a text that is not shown to me?
| qayxc wrote:
| Took me a while, but apparently sometimes you get a message
| saying you died from falling into a pit. Calling it "a game" is
| a bit hyperbolic, but the fact an AI model generated this from
| just a few prompts is still impressive.
| temp00345 wrote:
| It's writing correct Clojure code and Clojurescript components,
| it's producing the CSS and the SQL migrations and it has context
| of what it is working on, so you can just say "repeat the same
| CSS but use a green tint".
|
| I'm amazed.
| BurnerBotje wrote:
| I tried to copy paste the Advent of Code puzzles into the chat,
| and it just spewed out code that worked like it was nothing. It
| worked for the day 1 and day 2 puzzels. I'm impressed it also
| "remembered" that I wanted the result as JavaScript
| bugfix-66 wrote:
| EMIRELADERO wrote:
| Why are you so snarky? Yes, of course this won't solve things
| it has never seen in its training set. It's not an AGI. But
| so what? It's still amazing nontheless. Is your point that
| since it's not "intelligent" we should dismiss it?
| NavinF wrote:
| He's just spamming his website in every thread related to
| ML. The snark gets more attention.
| buzzerbetrayed wrote:
| I had to go back and reread GPs comment because I didn't
| sense any snark the first time. Still not sure if I do.
| cercatrova wrote:
| I've interacted with that account before and they were
| always snarky, as if their test they made is the arbiter of
| intelligence and that we shouldn't be so impressed by AI
| that to me is actually impressive.
| jasonjmcghee wrote:
| For what it's worth, this is likely one of the easier puzzles
| you could give it because there are so many solutions in a
| number of languages all over the web.
| avarun wrote:
| The training set is limited to 2021 and earlier and it sounds
| like the GP asked for solutions to yesterday's Advent of Code
| puzzle.
| BurnerBotje wrote:
| Yes correct. It does however still explain in detail what
| needs to happen (I omitted the results for the sample
| data's).
| [deleted]
| AIPoem wrote:
| recuter wrote:
| Kill this with fire..
| skilled wrote:
| I just hope when the price is set for this, it's not too high,
| and on top of that - I also hope it will be possible to have the
| model write long scripts/functions without breaking because it
| does so often in the current iteration.
| devoutsalsa wrote:
| This made a lot more sense after I read the writeup.
| spapas82 wrote:
| Hey Alex! Cool project :) Reminds me of something we worked on
| together some months before ;)
| booleandilemma wrote:
| How long until I have to suspect my coworkers of having this
| thing write code for them?
|
| Are students not going to need to use adderall anymore? /s
| eddsh1994 wrote:
| I tried to solve Day 3 of Advent of Code earlier and ChatGPT fell
| over completely - it sounded like it knew what it was doing but
| couldn't get the right solution. Day 1 was solved immediately
| though. I think the only thing that gives me hope programming
| isn't dying is that the best spec of a problem is the program so
| someone will still have to do requirements engineering etc, but
| maybe it'll move into systems engineering over traditional
| software development.
|
| Anyone know how we, as tech workers, can keep on top of this so
| we're not useless in 5 years time?
| mfashby wrote:
| Learn how to work with the AI, give it the right prompts,
| phrase the requirements in a way that gets what you need, train
| it occasionally, review it's code, pick it up when it falls
| over, massage it's ego occasionally...
| dpflan wrote:
| Seems like the link to the GitHub repo just links back to the
| article...
|
| "Here follows a list of every prompt I used, and you can see the
| code that was generated in this github repo."
|
| - https://thetinycto.com/blog/writing-a-game-using-chatgpt#
|
| Am I looking in the wrong place?
| heeton wrote:
| My bad, that's fixed now.
|
| The repo is also here - https://github.com/alexslade/gpt-game
| dpflan wrote:
| Thanks! Why did you decide to omit the code generated by GPT
| in your conversation with it? The evolution of the code would
| be nice to see.
|
| Your disclaimer: "You can also skip ahead to my observations
| and next steps if you don't want to read a bunch of code."
| But there is no code to read in the article?
| heeton wrote:
| Mostly because it was fairly dense and hard to read, and I
| threw this together earlier today. If I do this again with
| some more time I'll find a nicer way to capture all the
| response and show it, I imagine others will do the same.
|
| Or ideally there'll be some nice export process out of the
| chat itself.
| dpflan wrote:
| Ah, OK. To me, it seems like it would be beneficial to
| show how messy the process actually is to reach the end
| state.
| andrewstuart wrote:
| Amara's law says "We tend to overestimate the effect of a
| technology in the short run and underestimate the effect in the
| long run."
|
| Lots of overestimated excitement about how AI will change the
| world right now, which is to say, AI ain't going to change the
| world in the next few years.
|
| But in the long term, AI will underpin everything.
|
| I wonder if, in the future, it will not really be possible to
| know what is going on in the Internet at a deep technical level -
| that it will be self managed AI all the way down.
| heydenberk wrote:
| I asked ChatGPT if it understood the rules of the board game
| Codenames; it did. I described the board and asked it to play the
| role of the Spymaster, and it provided a pretty solid clue.
| xyzal wrote:
| This is not good for my anxiety disorder. Sadly not joking.
| jagaerglad wrote:
| Same, feels like I was replaced just before I had a chance to
| start. Chess and go are games, impressive but not society
| changing problems to solve, these things are real stuff. We'll
| eventually go full circle where labor working with one's hands,
| fine motor skills and so on are the thing left for humans
| qzw wrote:
| Most fine motor skills should be well within the grasp of
| robots/AI. Just look at what robot-assisted surgery can do
| today. But I believe soft fabrics and other easily deformed
| materials are still very difficult for them. So maybe time to
| brush up our cloth handling skills. However, it's also an
| area of active research, so probably not something to bank a
| 40-year career on. I for one welcome the day we're made
| redundant by AI/robots. We can easily become interesting and
| amusing enough to be kept as pets by our AI overlords.
| wara23arish wrote:
| same im barely 3 years into my career. this is causing me a
| existential crisis whether im gonna end up jobless in a
| couple of years
| eddsh1994 wrote:
| 8 years in and same, but only in a jokey way. Someone has
| to use these tools and before it's widespread those people
| will command huge salaries (controlling 10 AI programmers
| and verifying the output). Just keep on top of the
| developments and save money as you go :) And remember the
| best spec of a problem is the program, so there's still
| skills like requirements gathering and debugging that will
| be important.
| encetamasb wrote:
| I think you should not feel any worse. This is another good
| tool, what won't take your job any soon. Just embrace it and
| find out how it can help you!
|
| In my opinion it creates great drafts what you need to validate
| and refine yourself in the end. Sometimes the code is total
| fake, but you get an idea.
|
| If you have ever used google.. that's a very similar
| experience. :)
| sdwr wrote:
| I was playing with openai code yesterday, it made a basic diablo-
| style item generator with minimal prompting.
| xrd wrote:
| This stuff feels revolutionary, and I say that as someone that
| has watched the progress even the last few months and said to
| myself that it won't radically change the software industry. I
| think I was wrong.
|
| Also, as they say, maintenance is where the true cost of software
| lies. Has to anyone asked ChatGPT to refactor existing horrible
| code? It's fascinating to think about what happens to refactoring
| existing code if the AI doesn't care if it gets laid off, and can
| refactor again (if the new code fails) within seconds rather than
| days.
|
| And, what happens when rewrite from scratch takes seconds instead
| of months. Joel's law of never rewrite from scratch might
| completely fall away.
|
| This feels really game changing. If anyone can come in and just
| pitch ideas to AI with zero barriers for cost analysis, it's
| going to open the doors for software to eat every tiny segment
| that has not already been devoured.
| conradfr wrote:
| So, take-home code tests are dead?
| czbond wrote:
| One of the most likely professions eaten by software, is
| software.
|
| You are on point. I've been quietly mentioning this to software
| engineer friends, and poo pooed. I am more of the computer
| science-y than software engineer-y persuasion - and have seen
| this as a clear risk.
|
| edit 1: originally I thought it will mainly be for new code
| bases (green field) - but with the ability for code to "git
| pull" and then "chatgpt refactor" may be a game changer.
|
| edit 2: I think this is great - it can allow engineers to work
| on a higher level. I remember in CompSci training always
| thinking "why in the heck am I typing into a computer how to do
| its job?" and "why should engineers be dealing with stupid $hit
| like NaN and pointer overflows (C++) and heap issues an CRUD
| apps. It all seems like low brain stuff"
| dweekly wrote:
| This could be a very good time to create a startup that can
| make that command line and: 1. Document its functioning
| overall ("chatgpt doc") 2. Find bugs / logical flaws
| ("chatgpt debug") 3. Refactor the code for readability
| ("chatgpt refactor") 4. Improve its compute/memory
| performance ("chatgpt speed") 5. Improve the quality of
| comments ("chatgpt comment")
|
| Or just "chatgpt fix" to do all the above ;)
| CuriouslyC wrote:
| AI will eat software engineering the same way it'll eat art -
| from the bottom, and quickly at first then very very slowly.
| Engineers will be responsible for directing, verifying and
| correcting AIs at increasingly high levels over time. Hand
| written code will be limited to optimizations and working
| around weaknesses in the model much the same as inline
| assembly is still used with compiled code.
| czbond wrote:
| Fully agree with your assessment. Bottom up is vulnerable.
|
| I can then see engineers running entire department of AI by
| themselves..... someone who is an architect level and
| understands the business and can both envision the
| services, but also fix black box systems creating content
| that no one understands under the covers.
| quonn wrote:
| I think it's too early to tell. It feels like early
| translators. It's indeed very impressive, but could be 5-10
| years from actually having something useful and it's unclear
| what the practical impact will be.
|
| But it's also true that I wouldn't know what career to
| recommend to someone now in their early 20s who has 30 years
| ahead. As I said too difficult to predict right now.
| dzink wrote:
| Someone fed it legacy buggy code and it fixed the bugs.
| satvikpendem wrote:
| > Has to anyone asked ChatGPT to refactor existing horrible
| code?
|
| Yes it works well with stuff like React class components to
| functional ones with hooks. It even tells you what to optimize
| and does it for you, if you ask it to.
| pcthrowaway wrote:
| Whoa. Do you have a good guide on how to do this?
| tarr11 wrote:
| you prompt with "rewrite this code, but use React Hooks"
| mrtksn wrote:
| Honestly I'm not that interested in the code part. It does well
| but it's not perfect, it's good for some stuff - just like with
| the copilot. For more concrete things like coding I like to
| have the control and not use a middleman.
|
| What blows my mind is that I suddenly gain extra powers that I
| previously did not posses.
|
| For example, let's say I'm developing an adventure game and I
| need to write content but writing is not my speciality. Fear
| not, I have access to Janet from the Good Place and it's called
| ChatGPT here on Earth.
|
| So I'm writing a dialog for my character who is a gentlemen in
| England that came from old money.
|
| I simply tell chatGPT: rewrite the sentence to sound more posh
| "I want to eat cookies but I am not hungry yet"
|
| chatGPT: "I wish to partake in some biscuits, but I am not yet
| famished."
|
| Okay, maybe its a bit overdone but I like it and can already
| imagine his moustache and the hat, I definitely couldn't have
| written that by myself and if "AI" think this is about right
| then it will probably sound right to many people because that
| "AI" is essentially a result of a study of other peoples work.
|
| IMHO this AI stuff enables access to mastery and experience,
| not really replacing the thoughts of real people. It's the same
| with Dall-E or Stable Diffusion, you still need to be able to
| think ideas but the ability to paint like Van Gogh comes for
| free(or something like 0.01$).
| [deleted]
| akiselev wrote:
| Imagine applying it to the tech job search: unique resumes
| and cover letters tailor made for each job application.
| mrtksn wrote:
| good idea!
| mistermegabyte wrote:
| Pretty amazing stuff. I used this prompt to have ChatGPT write me
| a coin flip game in python that flips a coin x amount of times
| and displays the result: "create a game in python to flip a coin
| x amount of times and show the results when done" It came back
| with python code that ran perfectly when saved into a .py file
| without having to make any changes.
| roywiggins wrote:
| I've had it generating working python code for entire text-
| adventure games based on unlikely novels (Thomas Hardy's "The
| Trumpet Major" eg).
|
| If you ask it to start adding in NPCs and fighting mechanics it
| will start doing that, too. I built a small "Canticle for
| Liebowitz"-themed text adventure in pieces- first asking it to
| add NPCs, then add a fighting mechanic, then add weapons to be
| wielded, then for the weapons to have damage ratings that
| matter. All I had to do was update the functions that it wanted
| to change, and add a few "global" declarations.
| bugfix-66 wrote:
| Look at how many times that program appears when you paste your
| question into Google.
|
| The language model was trained on it.
| mistermegabyte wrote:
| As someone who doesn't program/code at all, I don't care how
| it arrives at the result. It's just amazing to me that if I
| need a simple script or program, I can have an AI write
| usable code that I can use.
| booleandilemma wrote:
| Yes, this will just further the unhealthy management
| attitude that programmers are fungible and "why can't you
| make X do Y, even my phone can do that".
| czbond wrote:
| You're correct on the training - but how many things in
| engineering are re-hashing the same crud over and over?
|
| I can even see it helping with core innovations. No - it
| won't write a realtime, infrastructure intense system (eg:
| Kafka) - but it could write all the non-innovative code
| around it, for example.
| quonn wrote:
| I tried it on primary school homework. It solved math, time
| questions, math text exercises and German language challenges
| easily. Can also do high school math very well if you instruct it
| to solve it step by step.
| BiteCode_dev wrote:
| What I really want is a GPT who can set my dev env when I ask it
| to.
|
| Hey ChatGPT, you give me the definitive commands that will
| install a good version of python, create a venv, install the
| right packages and command line tools, setup the configuration
| just right and let me just code?
|
| Cause for the code, codepilot is already fantastic.
| avip wrote:
| Here are the definitive commands that will install a good
| version of Python, create a virtual environment (venv), install
| the necessary packages and command line tools, set up the
| configuration correctly, and allow you to start coding:
|
| Install a good version of Python: # Install the
| latest version of Python 3 sudo apt update
| sudo apt install python3
|
| Create a virtual environment (venv) for your project:
| # Create a virtual environment for your project python3
| -m venv my_project # Activate the virtual
| environment source my_project/bin/activate
|
| Install the necessary packages and command line tools:
| # Install the necessary packages and command line tools
| pip install --upgrade pip pip install setuptools wheel
| pip install flake8 black isort
|
| Set up the configuration for your project: #
| Set up the configuration for your project flake8
| --install-hook git black --install-hook git isort
| --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-
| as --line-width 88 --recursive --thirdparty my_project
|
| Start coding: # Start coding in your project
| cd my_project nano my_project.py
|
| This series of commands will install the latest version of
| Python 3, create a virtual environment for your project,
| install the necessary packages and command line tools, set up
| the configuration for your project, and allow you to start
| coding. I hope this helps. Let me know if you have any other
| questions.
| jerpint wrote:
| This is incredible (I'm assuming this was chatGPT output)
| ailef wrote:
| I think this fails because you need to install python3-venv
| too (on Debian systems I believe). So then you're back
| looking it up on Google.
| roywiggins wrote:
| There's good odds that if you responded "hey, I got an
| error about virtualenv being missing, what do I need to
| fix that?" it will suggest that. It's a genuine chat
| interface; if something isn't quite right, you can point
| that out and ask it to correct it, and it has good odds
| of understanding.
| [deleted]
| modeless wrote:
| Did you try asking ChatGPT? This is its response to your
| verbatim question (and if it isn't exactly what you had in mind
| you can reply and ask it to change things, like do it on
| Windows or make it a script):
|
| To install Python, you can use the following command:
| $ sudo apt-get install python3
|
| To create a virtual environment (venv) for your Python project,
| you can use the following command: $ python3
| -m venv /path/to/venv
|
| To activate the virtual environment, you can use the following
| command: $ source /path/to/venv/bin/activate
|
| To install packages within the virtual environment, you can use
| the following command: $ pip install
| <package-name>
|
| To install command line tools, you can use the following
| command: $ sudo apt-get install <tool-name>
|
| To set up the configuration for your project, you will need to
| edit the appropriate configuration files for the tools and
| libraries that you are using. The specific steps for this will
| depend on the details of your project and the tools that you
| are using.
|
| Once you have set up your environment and installed the
| necessary packages and tools, you can start coding!
| BiteCode_dev wrote:
| This has a failure mode in each single line, even if we
| ignore it will not work on any OS that is not debian-like,
| which is most of them.
|
| First line, you don't chose which Python you install, only
| the 3, so you don't know if the libs you need will be
| available, which syntax you can use and which stdlib is at
| your disposable.
|
| Then, you use venv which may not be available because the
| first line you used doesn't install all python packages and
| in some debian/ubuntu versions they don't include venv,
| setuptools or pip in the python3 package.
|
| Then you pip install packages, which may fail if this has a c
| extensions which is not a wheel (E.G: you do machine
| learning), because you didn't get the python headers in the
| previous commands.
|
| Then you install command lines with apt-get, meaning your
| tool version may not be upgraded to match the python you
| used. For pylint and mypy, this means it at beast false
| positives, at worst crashes
|
| Of course, none of that explains how to setup your IDE to use
| said virtual, setup things like databases, init the git repo
| or put good default in config files.
|
| Don't get me wrong, it's a good start, and not worse than
| most tutorials I read online written by human.
|
| I don't doubt that it will get better over time though, and I
| can't wait. Bootstrapping is a plague to teach people.
| jokethrowaway wrote:
| To be fair, python - after 2to3 and after machine learning
| scientist with no clue about programming started using it -
| is a complete dumpster fire.
|
| I gave up trying to install things locally on Mac.
| Sometimes I'm lucky with docker but that may be slow for
| trying new things out.
|
| You're better off starting from an aws AMI and following
| whatever crazy setup the project you're using recommends.
| modeless wrote:
| > if it isn't exactly what you had in mind you can reply
| and ask it to change things
|
| A lot of the things you complain about were underspecified
| in your question, it has to make some assumptions. And I'll
| bet if you ran into any of the errors that you describe you
| could get solutions by simply pasting the errors into the
| chat box. The code produced by these models is not going to
| be perfect any more than a human's would be. You'll still
| need an iterative process and some common sense. But it's
| easier and faster than doing everything yourself.
| BiteCode_dev wrote:
| I only know how to specify the questions because I know
| they are sources of problems since I can install an
| entire setup project from scratch on the top of my head.
|
| Most can't though, and they won't ask specific questions.
|
| But with time, GPT will likely be able to ask questions
| to get the context, and that will change everything.
| wstuartcl wrote:
| I mean if you ask the same question to a human your
| question is ambiguous enough that you will get the same
| type of issues.
|
| How is any being or AI meant to read your mind to know
| you don't want instructions for system X but assume the
| instructions would be good on system Y etc. I feel sorry
| for the humans you expect to query you to get what you
| really want out of you.
| moffkalast wrote:
| ChatGPT response: "Hey sorry, I may know everything but you're
| asking for the impossible."
| heeton wrote:
| With this language model around it, I imagine that's a trivial
| next step. ChatGPT was correctly self-diagnosing problems when
| I pasted the error codes back in. It justs needs a setup where
| output is looped back in, and I imagine you could start to say
| things like:
|
| Give me an environment where the test suite passes for this new
| repo I've cloned, based on all the environment config inside.
|
| - Finds versions, sets them up
|
| - Installs packages
|
| - Asks about conflicts or problems
|
| - Notes why the tests fail first time (no DB!)
|
| - Creates the DB, runs migrations
|
| - Notes why the tests fail next time (missing env variable)
|
| - Finds a similar env variable in the example file, creates and
| local env file
|
| - etc etc
|
| That's all possible now if you paste the messages into GPT
| (with some errors, which repeated attempts can resolve), it
| needs connecting up into a self-aware environment.
| thegabez wrote:
| Why would you want it to stop there?
| doliveira wrote:
| Why do we still need to do all this boilerplate? I'm not even
| singling out Python here, I actually think that Codepilot being
| so amazing is kind of sad, clearly we shouldn't be needing to
| do all these things in 2022.
| BiteCode_dev wrote:
| Because nobody wants to do the long, ingrate, tedious work of
| cleaning 30 years of legacy ecosystem.
| return_to_monke wrote:
| hey, have you ever heard about https://nixos.org ?
| xcdzvyn wrote:
| This. 10-15 lines in `default.nix` followed by `nix-shell`
| ensures you'll have the exact same fully-functional dev
| environment any time, anywhere.
| BiteCode_dev wrote:
| The nixos people are truly the Jehovah Witness of software.
| return_to_monke wrote:
| I think rust people beat us :)
| johnfn wrote:
| It's funny you ask this because I've been asking ChatGPT for
| exactly these sorts of issues. It misses sometimes, but I've
| gotten a couple of really good hits.
| ralmidani wrote:
| "I'm sorry, dev, I'm afraid I can't do that. This mission is
| too important for me to allow you to jeopardize it."
| imranq wrote:
| chatGPT is awesome, but until we can deploy our own chatGPTs
| cheaply and easily, AI will remain in the domain of large
| monopolistic corporations
| lossolo wrote:
| And then you ask it "how many sides does triangle have?" [1] and
| it answers 3, then you ask it "how to calculate length of fourth
| side of triangle?" and it answers with calculation.
|
| 1. full transcript https://news.ycombinator.com/item?id=33841261
| ogogmad wrote:
| https://news.ycombinator.com/item?id=33842590
|
| Also, there is a version of the law of sines for tetrahedra and
| higher-order simplexes, similar to the one the AI tried to use.
| It's an imaginative wrong answer.
| andrewstuart wrote:
| I've been getting it to write Choose Your Own Adventures,
| Dungeons and Dragons adventure campaign books and transcripts of
| text adventure games.
|
| The results are always interesting and creative.
| write a choose your own adventure about visiting a pyramid on
| mars As you approach the pyramid on the red planet,
| you can't help but feel a mix of excitement and trepidation. The
| ancient structure looms before you, and you can't shake the
| feeling that you're not alone. Do you:
| A) Enter the pyramid and explore its dark, dusty corridors.
| B) Stay outside and try to find another way to unlock its
| secrets. If you choose A: You step through the
| entrance of the pyramid, and the darkness engulfs you. You fumble
| for your flashlight and turn it on, illuminating the passageway
| ahead. As you make your way deeper into the pyramid, you can't
| help but feel like you're being watched. Suddenly, you hear a
| noise behind you and turn to see a group of Martian creatures
| approaching. Do you: A) Run back the
| way you came and try to escape. B) Stand your ground and
| try to fight off the creatures. If you choose A:
| You sprint back towards the entrance of the pyramid, your heart
| pounding in your chest. As you burst out into the daylight, you
| see your spaceship just a few hundred yards away. You sprint
| towards it, hoping to make it before the creatures catch up to
| you. Congratulations, you've successfully escaped
| the pyramid and the Martian creatures! If you choose
| B: You take a deep breath and prepare to fight the
| approaching creatures. You swing your backpack at them, hoping to
| knock them off balance, but they are quick and agile. They easily
| dodge your attack and surround you, hissing and snarling. Just as
| you think all hope is lost, a blinding light fills the corridor
| and the creatures scatter, shrieking in fear.
| Congratulations, you've successfully fought off the Martian
| creatures and can continue exploring the pyramid! If
| you choose B: You decide to stay outside and look for
| another way to unlock the secrets of the pyramid. You walk around
| the perimeter, examining the structure closely. As you do, you
| notice a small, hidden door set into the side of the pyramid.
| Do you: A) Try to open the door and see what's
| inside. B) Ignore the door and continue your search for
| another way in. If you choose A: You carefully
| push on the door, and to your surprise, it swings open easily.
| You step inside and find yourself in a small chamber filled with
| ancient artifacts and inscriptions. As you examine the artifacts,
| you suddenly hear a noise behind you and turn to see a group of
| Martian creatures approaching. Do you:
| A) Run back the way you came and try to escape. B) Stand
| your ground and try to fight off the creatures. If
| you choose A: You sprint back towards the hidden door, your
| heart pounding in your chest. As you burst out into the daylight,
| you see your spaceship just a few hundred yards away. You sprint
| towards it, hoping to make it before the creatures catch up to
| you. Congratulations, you've successfully escaped
| the pyramid and the Martian creatures! If you choose
| B: You take a deep breath and prepare to fight the
| approaching creatures. You swing your backpack at them, hoping to
| knock them off balance, but they are quick and agile. They easily
| dodge your attack and surround you, hissing and snarling. Just as
| you think all hope is lost, a blinding light fills the chamber
| and the creatures scatter, shrieking in fear.
| Congratulations, you've successfully fought off the Martian
| creatures and can continue exploring the hidden chamber!
___________________________________________________________________
(page generated 2022-12-03 23:00 UTC)