Fix build with AS_NO_COMPILER#80
Conversation
hasCachedKnownTypes is declared inside the #ifndef AS_NO_COMPILER block in as_builder.h but was initialized unconditionally in the asCBuilder constructor, causing a compile error (C2065 on MSVC) when building with AS_NO_COMPILER defined. Guard the initialization like the one in asCBuilder::Reset(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
And so we have our first generative AI PR. I really hope this is something we can reject in Angelscript. 😔 (It's worth noting: if this gets merged, the repository will be tainted with a "Claude has contributed to this" forever; I don't think that's reversible. The change is simple enough; if this is an acceptable change, it should be committed manually, as a new commit, without this PR.) |
That's up to Andreas of course, but for what it's worth my opinion is that we shouldn't reject something just because it's AI. Whether we like it or not the monster has been unleashed and so we need to learn to treat it as a tool that can be used or misused like any other. The question is whether what it has generated has value. If it doesn't work at all, reject. If it does but is not architecturally advisable then it needs review. If the whole thing is sound then there's little sense in rejecting it solely on principle and forcing someone to rewrite and resubmit the PR by hand simply because we don't want AI contributions. On the other hand, I do agree that it may well be time to put out an AI policy saying exactly what is or isn't allowed. AI has opened up programming to a lot of people who don't have a clue what they're doing, and while I believe we should be welcoming and patient with beginners I also think that, at least right now, it is far too easy to break something unintentionally if you don't understand what changes the AI has made. I have seen surprisingly good output by AI. I have also seen ridiculously poor output. So both need to be taken seriously. Just my thoughts. At the end of the day Andreas has the final say either way. |
|
@codecat I never blindly merge a PR without doing my own review and tests on it. I do commit the PRs as I think it is a nice way of giving credit to the author, but most of the time I do my own refactoring of the submitted code as a second commit to suite my own taste. If you hadn't mentioned it I most likely wouldn't even have given it must thought that this PR was generated by Claude Code. I agree with @day-garwood though. AI is here to stay. We need to learn to live with it and cannot just blindly reject anything that is AI generated. As long as the generated code is properly reviewed and tested I see no harm in it being AI generated. |
|
As a decade+ long Angelscript user, supporter, and contributor, it's disappointing to hear that for many different reasons. My vote (which I know does not hold much weight, it's your project after all) is to fully reject generative AI, and I would like to see a contributor policy mirroring this. I don't particularly enjoy holding long discussions about this stuff anymore for the sake of my mental health, so I'm not gonna go in-depth myself, but I urge you to read into some of the ethical, moral, and environmental problems of LLMs (see link above) and understand where people like me are coming from. |
|
I'll do that. Thanks for sharing the link. |
Since the introduction of the known-types cache, building with
AS_NO_COMPILERdefined fails:hasCachedKnownTypesis declared inside the#ifndef AS_NO_COMPILERblock in as_builder.h, but theasCBuilderconstructor initializes it unconditionally. This guards the initialization the same way as the one inasCBuilder::Reset().Verified that the library builds cleanly with
AS_NO_COMPILERon MSVC 19.44 after this change, and that bytecode loaded into the resulting runtime executes correctly.🤖 Generated with Claude Code