3 Jul 2025 |
Zhaofeng Li | the more interesting things in "cool" filesystems nowadays being cow, snapshot, checksums, etc | 01:10:10 |
Katalin 🔪 | speaking of pointer stuff, behold: QString.init(string:)
extension QString {
public init(string: String?) {
#if os(macOS)
self = QString.fromNSString(string)
#else
guard let string else {
self = QString()
return
}
self = string.withCString(encodedAs: UTF16.self) { data in
QString(
UnsafeRawPointer(data).bindMemory(to: QChar.self, capacity: string.utf16.count),
qsizetype(string.utf16.count))
}
#endif
}
}
| 01:10:16 |
Katalin 🔪 | the other way around is actually a lot more ugly | 01:11:04 |
Zhaofeng Li | QString... qt? | 01:12:17 |
Katalin 🔪 | yeah | 01:12:24 |
Randy Eckenrode | Is that using C++ interop? | 01:12:46 |
Katalin 🔪 | yeah | 01:12:54 |
Zhaofeng Li | and you know what, I also get the use-case for non-macOS... | 01:13:06 |
Katalin 🔪 | the full thing: https://paste.sr.ht/~dblsaiko/ba4810c92637b0e3a3b56076e53b292c778f28ac | 01:13:24 |
| * Zhaofeng Li went into a rabbit hole with the android client of quassel a while ago, and it had a bespoke qt binding | 01:13:54 |
Zhaofeng Li | because the whole thing is based QDataStreams | 01:14:41 |
Zhaofeng Li | * because the whole thing is based on QDataStreams | 01:14:51 |
Katalin 🔪 | that has an android port? huh | 01:17:18 |
Katalin 🔪 | the IRC client? | 01:17:24 |
Zhaofeng Li | yeah, but it was the best bouncer that I had used before I tried IRCCloud | 01:18:05 |
Katalin 🔪 | ah, makes sense | 01:18:36 |
Zhaofeng Li | because it wasn't actually a bouncer but used its own protocol so it could provide actual scrollback, notifications, etc | 01:18:48 |
Katalin 🔪 | I already have a bouncer so the whole client/server thing it has going on is just really awkward to me | 01:19:07 |
Zhaofeng Li | * because it's not actually a bouncer but uses its own protocol so it can provide actual scrollback, notifications, etc (let's not use past tense as it's probably still alive :p) | 01:19:38 |
Katalin 🔪 | In reply to @zhaofeng:zhaofeng.li QString... qt? (also, unfortunately anything QObject straight up doesn’t import. RIP) | 01:19:51 |
Katalin 🔪 | it would have been cool to at least be able to pass them around | 01:20:37 |
Katalin 🔪 | iirc it was something about its constructor or destructor | 01:20:50 |
Katalin 🔪 | oh right, yeah | 01:35:15 |
Katalin 🔪 | they’re immovable types obviously, and as such they have a deleted move constructor, I think that was it | 01:35:44 |
Katalin 🔪 | it would probably be fine if they were marked with the “import_as_ref” swift attr but obviously I can’t do that with foreign library code | 01:36:14 |
Randy Eckenrode | When did libc++ get std::span ? | 01:38:03 |
Randy Eckenrode | https://github.com/apple-oss-distributions/ICU/blob/71e88350afd8f8bcbb8a387edafd090de9ff7cca/icu/icu4c/source/i18n/dtptngen.cpp#L51-L54 | 02:22:05 |
Randy Eckenrode | ☹️ | 02:22:13 |
Randy Eckenrode | I got past that, but a test is failing because Apple did not include the test data. It should be fixable, but I need to get some sleep. I’ll work on it tomorrow. | 03:41:44 |
niklaskorz | oh no 🫠 maybe swift-foundation-icu helps? that does not include a private header there | 06:57:44 |