Skip to content

Conversation

@lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Sep 15, 2025

Based on top of #2105.

Summary

This was an experiment at getting Claude Code to port this repo to Swift. I had thought that this might be a simple, low-risk way of starting to modernise this SDK. But it turned out not to be as simple as I had hoped. A lot of the issues come from Swift being a lot stricter about nullability than Objective-C. And then Claude sometimes tries to fix this itself but without enough context to really be able to reason about what may or may not be nullable.

Current state:

  • there are Markdown documents at the root of the repository describing the task that Claude undertook as well as its progress (I think that it may have missed updating the progress document at a few moments so it might not be fully up to date)
  • the SDK itself is compiling on macOS (not iOS because Claude wasn't trying to get that to pass — so the push notification code probably has further issues)
  • there is a mishmash of various ways in which we've tried to fix nullability mismatches:
    • sometimes Claude just inserted its own default values e.g. ?? ""
    • sometimes we're using the unwrapValueWithAmbiguousObjectiveCNullability function that I told it to use
    • sometimes it's just doing force unwraps
  • the test suite is compiling but after commenting out a bunch of tests, in some cases entire test files
    • and of the tests that are compiling, lots are failing

I have a bunch of further notes about this that I wrote along the way, but which I don't think worth writing up right now:
ably-cocoa Swift migration, Sep 2025.md

Conclusion

I don't think that this approach has yet proven itself to be viable. I originally proposed it because I thought it would be quick and low-risk compared to trying a rewrite in Swift from scratch. I am not as convinced now. I think that if we were to try and get this migration approach to work we might end up sinking a load of time into it and ending up with something that we have little confidence that it works, which means it's no longer low-risk.

This was 4 days of work and I think we should probably cut our losses on this approach for now and investigate alternatives.

have made a few changes to PRD, and will be continuing with that
Claude just did this of its own volition, but it makes sense, so let's
codify.
I'll probably get it to try the file again though
This is after it seemed to get it wrong for ARTAuth
And ask it to fix the PRD
I don't know if there are other header-only files that I missed
@lawrence-forooghian lawrence-forooghian changed the base branch from main to swift-migration-experiments-groundwork September 15, 2025 20:42
@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2025-09-08-third-claude-code-attempt-at-porting-to-swift

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot temporarily deployed to staging/pull/2110/features September 15, 2025 20:43 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2110/features September 16, 2025 12:23 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 2025-09-08-third-claude-code-attempt-at-porting-to-swift branch from ec6998a to 99d7df3 Compare September 16, 2025 12:46
@lawrence-forooghian lawrence-forooghian changed the title 2025 09 08 third claude code attempt at porting to swift [WIP] Attempt at porting to Swift using Claude Code Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants