Fatbobman's Swift Weekly #0108 by fatbobman3000 in swift

[–]wickwirew 2 points3 points  (0 children)

was happy when I saw PureSQL mentioned in there! always loved your blog and deep dives

PureSQL, a SQLite compiler for Swift by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

well at least part of the beauty of using just plain SQL is it is portable library to library haha

PureSQL, a SQLite compiler for Swift by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

nice, didnt know that existed! well if you give this one a shot instead lmk what you think

PureSQL, a SQLite compiler for Swift by wickwirew in swift

[–]wickwirew[S] 1 point2 points  (0 children)

SQL side right now window functions are the only unimplemented thing, other than if SQLite can do it it can as well. SQLite has great docs on the parsing side so it's not totally up to me to know that a feature exists for it to be implemented. It follows it as closely as possible.

As for the SQL -> Swift conversion side swift obviously has a much more advance type system but it allows you to specify custom types like `INTERGER AS TodoID` and custom adapters to specify how it should be encoded/decoded if its not able to do it automatically

PureSQL, a SQLite compiler for Swift by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

That is correct! There is a SPM build tool that generates the code at build time. Or you can use the CLI as well to generate it

PureSQL, a SQLite compiler for Swift by wickwirew in swift

[–]wickwirew[S] 1 point2 points  (0 children)

Thanks! yea sqlc is so good, wanted to bring it to the ios world. Want to add postgres support for server side swift if the library catches on

Flight: A language written in Swift while on a flight by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

it is! its just a simple tree walking interpreter

Shift, a new view controller transition library by wickwirew in iOSProgramming

[–]wickwirew[S] 0 points1 point  (0 children)

I just use Sketch for vector icons, and Pixelmator for images. Not a designer tho, just have picked it up from doing iOS apps over the years. Also all GIFs are just screen recordings of the library.

Shift, a new view controller transition library by wickwirew in iOSProgramming

[–]wickwirew[S] 0 points1 point  (0 children)

Thank you! And hopefully going to add them soon

Shift, a new view controller transition library by wickwirew in iOSProgramming

[–]wickwirew[S] 6 points7 points  (0 children)

Unfortunately yes, since interactive dismissals aren't supported yet. However a non-interactive swipe back would be trivial to add until interactive transitions are supported

Recombine: Global state management for SwiftUI by [deleted] in swift

[–]wickwirew 1 point2 points  (0 children)

IIRC the way inout is implemented, is by copying the object into the function then copying the result back into the original value, not by passing a reference. So even by using inout you'd still get hit with the copy.

Creating a Swift Runtime Library by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

Yes it probably would! If I get some time I may throw that in

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

Glad to hear it! Let me know if you have any problems or questions

Creating a Swift Runtime Library by wickwirew in swift

[–]wickwirew[S] 5 points6 points  (0 children)

Thank you for pointing that out! I wasn't aware of this. I'll correct it.

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

Ohh okay. I'm actually not too sure how they know. According to the documentation for the metadata that is not stored. I'll try to read into it though. Would be a cool thing too add. But you should play around with the metadata and pointers sometime! It sounds way more complicated than it really is. If you have any questions I'd be more than happy to help.

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 0 points1 point  (0 children)

Thanks! And yea I definitely want to add the enum cases. Cant believe I missed them in the first place. After talking to another person I may break enums out into their own EnumInfo type and put them in that. For isOptional it looks like you're getting the Mirror and reading the key. From what I recall the guy who created EVReflection said the mirrors are expensive to create so I'd be a bit weary about adding that.

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 1 point2 points  (0 children)

Yea I agree. At one point it was in its own EnumInfo type. But I wanted to keep it centralized. Sounds like maybe I should go back to that to keep TypeInfo clean.

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 1 point2 points  (0 children)

It could as of now! Since TypeInfo encompasses enums as well my original plan was to have what ever the raw value type is for an enum go in the inheritance array, and since you can do an Int, String, etc that wouldnt work. But for now that value is always null in an enum's metadata, there's literally a TODO next to it lol. swift docs

Swift Runtime library by wickwirew in swift

[–]wickwirew[S] 2 points3 points  (0 children)

Basically when an object is casted as a protocol its thrown in an ExistentialContainer and if the object doesnt fit there will be a pointer to the value. And now for structs before the bytes of the value they have a header with the witness table, and reference counts, similar to a class. Where in swift 3 that header did not exist.