Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite in Swift, and then have an ObjC wrapper? #820

Open
ccgus opened this issue Mar 25, 2021 · 8 comments
Open

Rewrite in Swift, and then have an ObjC wrapper? #820

ccgus opened this issue Mar 25, 2021 · 8 comments
Milestone

Comments

@ccgus
Copy link
Owner

ccgus commented Mar 25, 2021

I wonder how hard this would be?

@ccgus ccgus added this to the 3.0 milestone Mar 25, 2021
@groue
Copy link

groue commented Mar 25, 2021

That's funny, I had to build GRDBObjc in order to provide an FMDB compatibility layer to GRDB, for apps with legacy ObjC code.

@ccgus
Copy link
Owner Author

ccgus commented Mar 25, 2021

Oh, I should check that out when I get around to it.

@groue
Copy link

groue commented Mar 25, 2021

It's no longer maintained, so I wouldn't bet on its usefulness. But I like stories of convergent evolution :-)

@robertmryan
Copy link
Collaborator

A literal Swift conversion would probably not too bad.

But the interesting question in my mind is the “queue” pattern, which currently is an inherently synchronous implementation. At the minimum, I’d vote for no synchronous API and only asynchronous renditions in FMDB 3.0. And I’d suggest Combine publishers for Swift developers. (In Combine projects, wrapping closure based API in futures feels distinctly anachronistic.)

I’d be inclined to see what comes out in WWDC 2021, too, as that might color our thoughts about about what the appropriate asynchronous patterns are going forward. I’m intrigued to hear their thoughts are, esp in light of the new async patterns in Swift 5.5.

@ccgus
Copy link
Owner Author

ccgus commented Mar 25, 2021

I'd want both async and sync operations personally. And Combine stuff would make sense too.

And waiting till the next WWDC seems fine, I'm in no rush :)

@tokyovigilante
Copy link

I wonder how hard this would be?

Not very, just time-consuming. I've been working on a roughly 1:1 port to Swift for a Linux project, where Obj-C is not available. It is very incomplete but should be easy to see where the gaps are.

I haven't looked at macOS compatibility/portability as I'm not using that platform, but the code has no additional dependencies beyond SQLite itself.

@mecoFarid
Copy link

I'd want both async and sync operations personally. And Combine stuff would make sense too.

And waiting till the next WWDC seems fine, I'm in no rush :)

We are, haha

@lzcuriosity
Copy link

lzcuriosity commented Dec 24, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants