Live data from Hacker News

Using ChatGPT to make Bash palatable

brev.dev

21–30 of 148 posts

Re: Using ChatGPT to make Bash palatable

#21

ChatGPT has been amazing for all kinds of programming-adjacent things, even in my line of work where I asked it for help modifying the config file for a selfhosted gitlab instance. > But [Bash] fucking sucks. Like, it’s truly awful to write [...] As an aside, considering how basic the shell script actually was, I think this is a great example of being so intimidated by something that you don't actually try and use it…

Bash isn't that bad... except there are 20 ways to do anything and 18 of them are wrong, but only 1% of online examples will use either of the two correct approaches and simply reading docs won't always clue you in about how the technique or syntax it's describing is actually subtly wrong and you should ~never use it.

Re: Using ChatGPT to make Bash palatable

#22
post #19

This is a great example of how someone with little programming knowledge could leverage an AI into building simple scripts. Lately I've been encouraging my friends into trying just that. If the poster would want, for example, to save all current tabs when switching context (going from dev to marketing, for example), this would quickly turn into a more involved debugging/prompting question.

That would be a great follow on. I posted the repo if you want to leave any feedback or help me continue building it out: https://github.com/brevdev/dev-browser

Re: Using ChatGPT to make Bash palatable

#24
post #8

I don't understand how people can look at this and still claim that it's not doing any "actual reasoning".

I realize I don't have a good idea of what I think "actual reasoning" means. But yeah, this is pretty impressive stuff, I agree. Before ChatGPT I didn't realize the tech was available to do things like this, and I'm still pretty bewildered by how it can be possible.

Re: Using ChatGPT to make Bash palatable

#25
post #15
post #8

I don't understand how people can look at this and still claim that it's not doing any "actual reasoning".

It has trained on countless programming tutorials out there, including bash tutorials for all kinds of things. Such tutorials often includes "create file -> ls to see file -> print content of file" etc, so GPT then takes those tutorials and creates grammatical rules how those words transform into each other. But if you start going outside of the realms of online tutorials it starts to falter quickly and then just pri…

To add to this, each token is generated by going through its network once. So there's no way computationally for it to do any reasoning or follow an algorithm. That said though it's impressive how much its able to accomplish without any procedural reasoning.

Re: Using ChatGPT to make Bash palatable

#27

ChatGPT has been amazing for all kinds of programming-adjacent things, even in my line of work where I asked it for help modifying the config file for a selfhosted gitlab instance. > But [Bash] fucking sucks. Like, it’s truly awful to write [...] As an aside, considering how basic the shell script actually was, I think this is a great example of being so intimidated by something that you don't actually try and use it…

yeah absolutely. I think interacting with chrome and also parsing/iterating files were hard parts that ChatGPT breezed through.

Re: Using ChatGPT to make Bash palatable

#28
I was just commenting to a friend how annoying it is that macOS aliases can't add flags to executables like you can easily do in Windows shortcuts since, what? Windows 95?

If you want to launch Chrome with flags through your dock/UI you have to compile an AppleScript to an .app. It's crazy.

Re: Using ChatGPT to make Bash palatable

#29
post #8

I don't understand how people can look at this and still claim that it's not doing any "actual reasoning".

Chat GPT is simply amazing, it feels like Google with super powers. I think it can boost productivity by a considerable amount. It makes a perfect peer programmer, giving you sample code with first class comments explaining the generated code, sometimes with minor errors to make it compile. You can even ask it to explain some specific part of the code. It's also like having a secretary or an assistant available 24/7 with a never seen productivity. It probably feels like when first mechanical computers where built and people thinking "How can it compute the right answer so fast?".

Re: Using ChatGPT to make Bash palatable

#30
This is a relatively common use case for browsers that's usually solved by tab groups. I'm happy the author learned bash and leveraged new tools to solve the problem, but it's a little over engineered.
Post reply on HN