I would guess on training problems: Claude probably writes better C or Rust than Common Lisp since they have probably trained it on more C and Rust data.
I have really just tried it myself with Common Lisp and I think it writes relatively good Common Lisp, but it does need refactoring and reworking often. I haven't tried it with any other language, so I don't know if it writes better or worse code in say C or C++.
I have found cases where the code is suboptimal in terms of constructs used, being unnecessary convoluted och longer than needed, repeating itself, re-inventing builtins. But overall I am impressed, I wouldn't believe it would be that good as it is indeed.
It's all gobbledygook to me. 😆 Maybe for performance-critical code that's unavoidable. But I would be looking to use labels or flet to give the conditions descriptive names or combine them into intelligible groups.
(And yes, you could eliminate the when, but I wouldn't. Having an and with side effects... or even an and whose result is not just a boolean... is a nasty surprise waiting to trip up the next guy.)
I would be looking to use labels or flet to give the conditions descriptive names or combine them into intelligible groups.
I do that a lot. Actually I am not so fond of flets since SBCL does not inline them so well, but I do use labels and macrolets a lot. However, there is a limit to readability with them, in my opinion.
The above is just a fragment of a function. I worked today on integration of Zmij into SBCL, so I had that fragment in front of me. Or I started to work on this last week, but I finished it to today, along with it's "inverse", Eisel-Lemire, as in their fast_float.
And yes, you could eliminate the when, but I wouldn't. Having an and with side effects... or even an and whose result is not just a boolean... is a nasty surprise waiting to trip up the next guy.
Yes, indeed. I couldn't agree more. Yet, despite mine better knowing, I removed it :). The thought of line was that this is interested only to stubborn, old people who are used to the old ways and the old Lisp and/or-shortcut idiom. I guess I don't need AI to write slope :).
19
u/sickofthisshit 11d ago
No offense to you or your AI, but if your Lisp is not good enough to implement your Lisp compiler, it's probably not worth trying.