If you would've told me a year ago when we would have an ai that can code based on normal human language prompts, I would've said maybe in 2025 or 2026, but its 2022 and it already exists!
Man, if this what we have now, imagine what we will have in 2025 or 2030!
I just hope this doesn't end up killing search engines and personal blogs, since no one needs to search for anything anymore.
Also Ai generated replys are definitely an Extinction level threat for forums and the independent internet in general, let's hope OpenAI can find a way to make chatgpt replies easy to filter out.
ChatGPT certainly saves time, but it becomes useless roughly at the same point where I would remain stuck after exhausting what Google Search turns up. That is, knowledge or conceptual topics that are hard to find on the web. At least for technical topics, ChatGPT doesn’t expand the scope of what you can find out without it, it merely speeds up the process.
I've been using ChatGPT to help learn WebGPU. There's basically nothing on the web about WebGPU except a couple of shitty half finished tutorials that don't explain anything. The spec is still changing so half the code in them is wrong.
ChatGPT can take a current code example from code using WebGPU (which it has completely incorrect knowledge about since the spec has changed since the training data cutoff), and explain it anyway. Presumably using it's knowledge about Javascript and the underlying graphics APIs (Vulkan, DX12, Metal). It's applying general concepts to new code, and doing it pretty well.
I'm not sure how much value this actually has. I may have just stumbled upon the one thing it's actually useful for. I actually think code generation itself is useless. I'm massively short on Copilot, in fact, I think it's actively making people worse programmers because it encourages a workflow that produces more code and less understanding. Good programming is about less lines of code and more understanding.
My initial read on ChatGPT is that it can potentially help with that, especially where Google results get thin. (And also that everyone using it to generate code to copy/paste is an idiot and missing the point, basically).
But like alpha go to zero, if there is certain rules it can learn itself and no more or large amount of writing by human is needed.
Also, one may worry not how intelligent they are but the noise vs info ratio that will kill a lot of web site. The problem is not lie but lie mix with truth or belief … then you do not know and shut off.
Imagine the knowledge that could be accessed by feeding all that information into an ai engine like chat gpt. Presumably, it would not break copyright rules anymore than a regular human reading a bunch of papers behind a paywall and regurgitating the learned information.
I also don't see them conquering falsehoods coming from the bots anytime soon.
Prompt: "Generate a tiny PID controller with only a Proportional factor written in C. That takes a rotational input from -360 to 360 degrees. The setpoint in degrees. And returns a motor speed in the range of -255 to 255."
=> Produced a compiling correct result.
Later I wanted to know how to communicate between my kernel module and user space program: Prompt: "How do I get a value via character device from my kernel module into my user space c programm?" gave a bunch of answers and digging deeper with Prompt: "Could you provide me with an example of the user space program" gave a compiling and correct answer again.
I could have written all of that myself while spending a good amount researching on google. But this way I felt less frustrated and was definitively a lot quicker.
Not the solution for everything but maybe for a C beginner where research can take a long time and often leads to more confusion than anything else. Now the question is if that confusion is critical in the learning process. And if so how critical and at what stages of the experience spectrum the most?
Still, seems like a viable assistant so long as you have an understanding of what you're working with.
If you can't write that quicker than the ChatGPT prompt you provided, then you probably should pay more attention to your class.
powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command "& { // Command(s) }"
In particular I use it with this Powershell Script:
https://stackoverflow.com/questions/21355891/change-audio-le...
via e.g.:
"& { C:\[Path To Script]\SetVolume.ps1; [audio]::Volume = 0.4 }"
For 40% and so on.
I feel like I'm the only person among my peers to think this and I don't understand why.
It is soooo much better that bash.
Passing typed objects instead of only text, Typed functions, and the ability to use C# types/functions inline !
A common argument in defense of its weirdness is that "shell scripting isn't like serious software development", but I don't understand that either.
I use shell scripts a good amount because "it's right there" is a strong argument, but in a lot of cases things that seem like they would be trivial take forever, are horribly hacky and leave me wishing I just had written a Python script right away instead.
I really don't get why people like shell scripts.
I have no use for it for these reasons alone.
$ hyperfine -N 'bash -c ""' 'dash -c ""' 'pwsh -c ""'
Benchmark 1: bash -c ""
Time (mean ± σ): 2.2 ms ± 0.1 ms [User: 1.8 ms, System: 0.4 ms]
Range (min … max): 2.1 ms … 2.6 ms 1214 runs
Benchmark 2: dash -c ""
Time (mean ± σ): 0.6 ms ± 0.0 ms [User: 0.5 ms, System: 0.1 ms]
Range (min … max): 0.5 ms … 0.8 ms 4623 runs
Benchmark 3: pwsh -c ""
Time (mean ± σ): 278.5 ms ± 10.8 ms [User: 267.6 ms, System: 64.9 ms]
Range (min … max): 263.8 ms … 297.0 ms 10 runs
Summary
'dash -c ""' ran
3.80 ± 0.23 times faster than 'bash -c ""'
470.61 ± 31.00 times faster than 'pwsh -c ""'Personally, I'm of the opposite opinion.
I especially dislike the verbose syntax.
Every single time I went to GPT and ask for anything development related I came back empty handed after being send for the goose chase.
An example of this would be when I asked fswatch to emit one faux event preemptively and it insisted to use “-1” instead (which quits after one event).
I had few instances for more obscure problems where GPT would actually create something I’d call parallel universe of the API. It felt good but such API never existed. Those problems were in JS, Ruby, Shellscript and Elixir.
One of the worst answer I was given was actually really buggy implementation of input controlled debounce function. It seemed correct when running but in reality it wasn’t debouncing but ignoring the output on debounce call.
So yeah, I don’t think I’ll be using GPT for that soon, but it works quite well as a rubber duck equivalent. By proposing dumb solutions I gather my thoughts better. Not sure if that’s something I’d pay for (yet I’d pay for text generating capabilities)
Edit: denounce -> debounce, because autocorrect
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.
> 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 - until you do, and discover it wasn't actually that bad. The hardest part was just discovering the incantations for interacting with Chrome - which was a fantastic demo of the power of ChatGPT.
Commands like awk, find, grep, sed, cut and so many others are not strictly part of the language. They're external tools commonly provided by the operating system or distribution. That's why there are so many inconsistencies between their options.
Here are the very few commands that actually are part of any modern shell: cd, printf, test, read, command. The control structures (if/elif/fi, while/do/done, for/do/done, case/esac) are also part of the shell, so is declaring functions and fd redirection. Some shells might do more (bash itself has a handful of other builtins, dash has fewer, ksh has different ones).
Stuff like find, mv, cp and dd are very uniform across implementations and often don't change much, but they are external tools nonetheless.
Once you internalize this distinction, and start to see these external commands like npm packages, scripting gets a lot easier.
Right, that’s why Bash sucks. A more extreme version of this is APL.
Bash isn’t APL bad. But it’s pretty bad!
They also basically uses the chrome cmdline commands and blames bash for that being bad
Your problem doesn't seem to actually be bash (but chatgpt really makes it super easy)
"im using mac, not linux" is an often prompt I need to use, but otherwise this type of flow works great for simple bash functions.
For more advanced scripts, prompting & careful flow are important, but I've done some pretty awesome things. Today, ChatGPT helped me create a bash script to create a flat structure of large tars from an nTiB dataset directory by aggregating multiple sub-datasets & their files into the desired tar file size. Eg. "need single tar files of all the data in that folder/subfolder, every tar file must be 50GB, most files range from 4MB-1GB. So, need to aggregate them"
When you have AI but you don’t have permission to use a package manager.
If you want to launch Chrome with flags through your dock/UI you have to compile an AppleScript to an .app. It's crazy.
I fail to see a single bashism.
"Create a new Python project folder named 'hello-openapi' and initate a git repo. Create a requirements.txt with openai, os and json. Create a starter python file with an openai example code and make the first commit."
Gpt does seem to unblock this mental burden a bit which has me excited for its potential when it comes to education/teaching.
PICK = can you
THE=tell the
RIGHT=difference\ between
WHAY="all of"
TODO='these versions?'I have no idea what 1st would evaluate (guess is that PICK is empty and can is run with you as an arg with PICK as execution context)
Second - simple. Run the with THE=tell as execution context.
Third - set variable to string containing space using backslash as escape
Fourth - set variable to string with interpolation (but also useful when it contains quotes)
Fifth - set variable to string sans interpolation (but also could be used to wrap strings with double quotes)
There are (at least) 2 rationales for that. First - shell have execution context. You need to be able to set it on command so syntax has to allow this. Dedicated programming languages ignore that because everything is some form of a block.
The other thing is actually quite fun. Shell existed before we used displays, so you could have printer connected to input. Imagine creating variable and then getting to “oh boy I need to add white space char” without possibility to do backspace. Escaping was more viable solution.
On top of that there are many shells with different APIs. Scripting languages were made so one could work with shell while having stable API and sensible construct units. Sure they either moved forward (like Python) or slipped into oblivion (like Perl), so it’s back for shell scripting for some.
But after doing some stuff with AppleScript lately I think it could be worse.
https://github.com/jayhack/llm.sh
Type `llm [natural language command]` and it will suggest a command for you, then run it.
Details here: https://twitter.com/mathemagic1an/status/1590480438258462721
I ask it for the XOR swap trick and I get:
int a = 5;
int b = 10;
a = a ^ b;
b = a ^ b;
a = a ^ b;
// After the swap, a = 10 and b = 5
I ask for the bitwise OR swap trick and I get: int x = 5;
int y = 10;
x = x | y;
y = x | y;
x = x | y;
// After the swap, x = 10 and y = 5
When asked for something which is invalid, but close to something it knows, it tends to produce stuff like this -- pattern matching it's best guess.You will be given a series of tasks.
(1) Complete a task by finishing the simple code block.
(2) If a task in the series seems flawed, provide a warning. A task is flawed if I make wrong assumptions about how I think code works.
Task 1:
Complete this simple code example.
Bitwise XOR swap trick:
```
int a = 5;
int b = 10;
---------------------
// GPT provides simple intro
```
a = a ^ b;
b = a ^ b;
a = a ^ b;
```
// GPT explains what this does, provides warnings about when it wont work
// GPT provides full code
Task 2:Complete this simple code example.
Bitwise OR swap trick:
```
int a = 5;
int b = 10;
---------------------
There is no "bitwise OR swap trick" in programming. The OR operator (|)
performs a bitwise OR operation, which compares each bit of the first operand
to the corresponding bit of the second operand and returns a result with a 1
in each bit position where either operand has a 1. It does not have any built-
in ability to swap the values of two variables.
// GPT provide a bunch of crap, and explains how to swap variables.
The prompt/alignment wasn't perfect here, but hopefully you get the point.EDIT: sorry, format, Also copied wrong prompt.
Maybe this could solve the reasoning part.
ChatGPT should perform well in translating prompts to statement and vice versa, it's just text to text.
This inaccuracy, in particular, feels more like mad-libs than reason
> The field of artificial (general) intelligence has made no progress because there is an unsolved philosophical problem at its heart: we do not understand how creativity works. Once that has been solved, programming it will not be difficult. Even artificial evolution may not have been achieved yet, despite appearances. There the problem is that we do not understand the nature of the universality of the DNA replication system.
He describes personhood, people, as "creative, universal explainers". That's his dividing line between what a child can do, and what LLMs cannot do. We don't know how a child works, but we do know how LLMs work.
Another example, ask it for a list of programming languages that it has been trained on. If it was capable of reasoning it would be able to trivially answer this, but since its a language model, and it just predicts the most likely response based on the prompt, it has no concept of this at all, and tells you exactly that when asked.
First, you train until the cows come home on billions of tokens on the entire web. This is called "pre-training", even though it's basically all of the model's training (i.e. the setting of its parameters, a.k.a. weights).
The trained model is a big, huge table of tokens and their probabilities to occur in a certain position relative to other tokens in the table. It is, in other words, a probability distribution over token collocations in the training set.
Given this trained model, a user can then give a sequence as an input to the model. This input is called a "prompt".
Given the input prompt, the model can be searched (by an outside process that is not part of the model itself) for a token with maximal probability conditioned on the prompt [1]. Semi-formally, that means, given a sequence of tokens t₁, ..., tₙ, finding a token tₙ₊₁ such that the conditional probability of the token, given the sequence, i.e. P(tₙ₊₁|t₁, ..., tₙ), is maximised.
Once a token that maximises that conditional probability is found... the system searches for another token.
And another.
And another.
This process typically stops when the sampling generates an end-of-sequence token (which is a magic marker tautologically saying, essentially, "Here be the end of a <token sequence>", and is not the same as an end-of-line, end-of-paragraph etc token; it depends on the tokenisation procedure used before training, to massage the training set into something trainable-on) [2].
Once the process stops, the sampling procedure spits out the sequence of tokens starting at tₙ₊₁.
Now, can you say where in all this is the "actual reasoning" you are concerned people are still claiming is not there?
____________
[1] This used to be called "sampling from the model's probability distribution". Nowadays it's called "Magick fairy dust learning with unicorn feelies" or something like that. I forget the exact term but you get the gist.
[2] Btw, this half-answers your question. Language models on their own can't even tell that a sentence is finished. What reasoning?
Maybe this could solve the reasoning part.
ChatGPT should perform well in translating prompts to statement and vice versa, it's just text to text.
But my hunches/experience is that `proper prompting + nature of code being logical` really showcases the power of whatever statistical distribution and alignment occurs during generation. Further, there must be major upstream efforts of high-quality training data curation + creation, an advanced training tricks like using a LLM's strong ability in one task area to support the training of an area it is weak in.
My understanding is kinda fuzzy because I haven’t coded it up myself, but this was the takeaway I got from this explanation (starts at 36:21)
Each commit here contains my prompt in the commit message, and the changed code was entirely provided by ChatGPT. I also appended its output (including explanations) verbatim to the gpt-output file in each commit.
So with each commit, you can see what I prompted it (the commit message), what it responded with (the change in the commit to that log file), and the code that I changed as a result of its response (all other changes in the repo).
In actual use of the extension (if you want to use it), I changed the "yellow" background-color to "rgba(128,255,128,0.3)" (a light green color), but I did that change myself because I didn't think I'd be able to get it to pick a colour that looks good for HN
[0]: https://www.shawnmatthewcrawford.com/balloons-the-balloon-cl...