4 ms·
I'm not sure about that, it's a temporary ban and the reasoning presented in their post is sound they are swarmmed with a massive influx of incorrect answers t
by cokeandpepsi 4y ago
I'm not sure about that, it's a temporary ban and the reasoning presented in their post is sound
they are swarmmed with a massive influx of incorrect answers to questions that 'look somewhat correct at first glance'
- ksaj 4y agoI found a great example to demonstrate. I asked how to transpile Lisp to C. It perfectly described what transpiling is, said (correctly) that not all Lisp structures will translate directly into C, so those parts of the code may be broken, then gave this method for transpiling: sbcl --script example.lsp --output example.c Now... that would be REALLY GREAT if it was true. But SBCL is not a transpiler (except for bytecode, but that's a little different), and this command will just error out. But boy, do I wish it was actually a thing! As far as AI answers go, I would give it two thumbs up. However, the information is wrong, and so I must save my thumbs for another time.
- bombcar 4y agoReminds me of a story I read where an advanced computer (we'd call it AI now) when asked a question it couldn't answer, would simulate an entire universe where the question was answered, and then determine the answer and report back. And it'd get things like the sbcl command line above, because that was the right answer in the particular universe where the question could be answered.
- ksaj 4y agoThat's straight up how Lisp macros work. It is alien technology after all.
- fragmede 4y agoWhat happens when you give it the Lisp code and ask ChatGPT to do the transpiling?
- ksaj 4y agoGood question. Let's try it. Here is some Lisp code I know cannot be duplicated as-is in C: (defun num-atoms(list) (cond ((null list) 0) ((atom list) 1) (t (+ (num-atoms (car list)) (num-atoms (cdr list)))))) And here's the C code that ChatGPT created from it. #include <stdio.h> #include <stdlib.h> typedef struct list_node { int data; struct list_node *next; } list_node; int num_atoms(list_node *list) { if (list == NULL) { return 0; } else if (list->next == NULL) { return 1; } else { return num_atoms(list->next) + num_atoms(list->next->next); } } int main() { list_node \*list = NULL; printf("%d\n", num_atoms(list)); return 0; } ChatGPT provided great writeup about what it's supposedly doing, and quite brilliantly states the following: "Note that this implementation of the num_atoms function is not equivalent to the original Lisp function, as it does not correctly handle the (atom list) case. In C, it is not possible to directly check whether a value is an atom, as atoms are not a fundamental concept in C. To properly implement the num_atoms function in C, a more detailed specification of what is meant by an "atom" would be needed." I then asked ChatGPT: "Make a function in C that duplicates (atom list) from Lisp" since that was the recommendation. I like to think it got impatient with me badgering it about this subject, because the response starts with "As mentioned earlier, atoms are not a fundamental concept in C, so it is not possible to directly implement a function that duplicates the behavior of (atom list) in Lisp." But it then followed up with C code that approximates it (by simply checking if something is a list or not), and then explains why it is still not exactly the same as Lisp's implementation, and that it won't work correctly in every case as it would under Lisp. It then ended with "The definition of an atom and the way it is identified may vary depending on the specific requirements of the problem being solved." This could be quite educational. I really expected it to "make shit up," but it was pretty spot on.
- TeMPOraL 4y agoThis, of course, highlights the problem with this, Copilot, and other attempts at using GPT-derivative to produce code. That "transpiled" C code looks almost correct, but has at least one subtle bug. It translated (+ (num-atoms (car list)) (num-atoms (cdr list))) to: return num_atoms(list->next) + num_atoms(list->next->next); but that would actually mean: (+ (num-atoms (cdr list)) (num-atoms (cddr list))) Which then highlights another problem: correct translation would not even compile, because the list_node struct itself is not equivalent to a cons cell.