@mattiem@mastodon.social
@mattiem@mastodon.social avatar

mattiem

@mattiem@mastodon.social

macOS/iOS ⌨️, outdoors 🏔, justice ⚖️, games 👾

Pretty into open source. Previously: Crashlytics, Apple

This profile is from a federated server and may be incomplete. Browse more on the original instance.

mattiem, to random
@mattiem@mastodon.social avatar

big changes today

  • Chime is now free and moving towards becoming fully open source
  • It turns out that I really like open source work, so I'm going to try to just do that*
  • unsure how long I can keep that up though, so I'm also considering contract work with Apple platforms/backends

https://github.com/ChimeHQ/Chime

mattiem, to random
@mattiem@mastodon.social avatar

I think a lot about dependencies. I'm not saying I love them. But I do absolutely love finding a library that does what I need. I also love collaboration via open, shared packages. Strikes me as optimal in so many ways.

But many don't. People just plain hate dependencies!

Got burned once? Just heard about someone else getting burned once? That's powerful. In fact, it has a name: loss aversion bias. Never thought about it this way before though.

mattiem, to random
@mattiem@mastodon.social avatar

A Swift concurrency pattern I’m seeing more and more is the “stateless actor”. This is fascinating, because it seems so counterintuitive. But I think people are reaching for this to get convenient access to background processing.

I don’t think this is “wrong”. But I think it is probably building bad habits. Local, private nonisolated methods are usually simpler and better long-term.

mattiem, to random
@mattiem@mastodon.social avatar

I’m late to the structs-of-functions party, but I really like it. If you have not experimented with using structs over protocols in your Swift code, you owe it to yourself to try. There are situations where protocols are necessary. But when they aren’t, it’s a lot more powerful.

mattiem, to random
@mattiem@mastodon.social avatar

Inspired by @Migueldeicaza , I was thinking, again, about what would be required to support a full IDE experience on an iPad. And the propects are grim.

LSP is just fundamentally incompatible with iOS. And even with spec changes (which I have roughly outlined) that could be hard justify, it would still require enormous work from each server implementation to support.

mattiem, to random
@mattiem@mastodon.social avatar

When does it make sense for a SwiftUI View to not be MainActor isolated?

mattiem, to random
@mattiem@mastodon.social avatar

I have found myself frequently swapping between TextKit 1 and 2 for debugging. It’s a huge pain. So I made a thing!

Small (but growing!) set of tools for working with TextKit that are convenient, efficient, and work for both versions.

https://github.com/ChimeHQ/Glyph

mattiem, to random
@mattiem@mastodon.social avatar

Speaking of open source drama: I was made aware recently of yet another place where code I’ve written was copy-pasted into another repo. Presumably this was to “avoid a dependency”.

For many years, I have used a permissive license. I’m going to be addressing this in 2024. I have yet to find a license that fits my needs, so I’m working on one.

https://github.com/mattmassicotte/cosl

mattiem, to random
@mattiem@mastodon.social avatar

I'm extremely interested to see how (please not "if") Apple addresses its own APIs that are incompatible with Sendability this upcoming WWDC.

Here's a great one from HealthKit: HKAsyncQuery. Async is right in the name! Yet, it is impossible to use without warnings, and who knows if it is safe or not.

mattiem, to random
@mattiem@mastodon.social avatar

Developers are way too focused on launches.

Sure, if you have a large audience, it may work. And yes, you can hit the jackpot with a famous person sharing it. (famous people, share more stuff made by unfamous people!) But, this kind of thing just reeks of survivorship bias. I bet the emotional toll of a "failed" launch has killed a huge amount of products.

Getting noticed is incredibly difficult, but a soft launch has big advantages, and I think it should be the default.

mattiem, to random
@mattiem@mastodon.social avatar

MainActor.run is almost never the right solution. You want to define your isolation statically on the type, via a global actor annotation.

Dynamic isolation is an escape hatch, and it should set off alarm bells every time.

mattiem, to random
@mattiem@mastodon.social avatar

I'm trying (and failing) to implement my own custom SwiftUI event delivery system, similar to onAppear but for a domain-specific event. I don't understand how to do bookkeeping when storing the closures....

Does anyone have any ideas on how something like this is done?

mattiem, to random
@mattiem@mastodon.social avatar

@pepicrft I meant to follow up with you about this. I really know zero about I/O concurrency and Ruby, but I have been hearing very good things about Fibers from @trevorturk and wanted to share something he pointed me to just in case:

https://brunosutic.com/blog/ruby-fiber-scheduler

mattiem, to random
@mattiem@mastodon.social avatar

Making progress in Transistor.

Kid keeps asking me to finish Jump Jump Jump in Mario Wonder and I want to throw the controller at the TV every time. But I’ve only tried maybe 10000 times so far.

Playing anything?

mattiem, to random
@mattiem@mastodon.social avatar

@donnywals hey Donny!

I just read your post here. I’m not sure using a runtime check (Thread.isMainThread) really makes sense here because isolation is determined at compile time. There is never ambiguity for correctly annotated APIs.

Though I do agree that SwiftUI marking its body as MainActor but not the entire type is a poor API that makes it specifically hard to use.

https://www.donnywals.com/how-to-determine-where-tasks-and-async-functions-run-in-swift/

mattiem, to random
@mattiem@mastodon.social avatar

News!

I’m helping @holly with an upcoming Swift concurrency migration guide for swift.org!

The goal is to provide documentation around concepts but also practical solutions to problems real apps encounter.

Ultimately this is going to be a community effort. To start, if you have ideas or problems you’ve run into please send them my way!

mattiem, to random
@mattiem@mastodon.social avatar

It happened. No only is ExtensionKit now available for iOS but there is also a Swift-Specific XPC system!

mattiem, to random
@mattiem@mastodon.social avatar

Welp, I just submitted a Swift pitch draft. I really want more flexibility for non-Sendable types, and it just feels like it should already work this way.

Internet, you may now begin telling me I am wrong.

https://forums.swift.org/t/isolation-assumptions/69514

mattiem, to random
@mattiem@mastodon.social avatar

I haven't had that much success finding others that share enthusiasm for building shared Swift text editing infrastructure. Most people just want to make an app. That's good, apps are the end-goal!

But if you happen to be interested open source Swift editor stuff, I would love to hear from you! There's a lot of cool things to work on.

mattiem, to random
@mattiem@mastodon.social avatar

@ctietze hello! Have you ever used/made/ thought about a Swift wrapper package for JavaScriptCore?

mattiem, to random
@mattiem@mastodon.social avatar

Got a response to the DTS support ticket I opened about TextKit 2 performance. Apple confirmed the bug, told me there is no workaround, and refunded the ticket. Honestly, this is incredibly useful information with a turn-around time of ~ 3 days. That's now three TSIs in a row that have been useful, in at least some way.

Use those technical support incidents!

mattiem, to random
@mattiem@mastodon.social avatar

This is very much not done yet, but I managed to put together a macOS help book Xcode template. It even sort of works! And, includes javascript to (kinda) respond to the navigation button.

Took quite a bit of reverse engineering. Still lots to do. Any good references for Xcode templates out there? Anyone that knows JavaScript? I could use help with both.

https://github.com/ChimeHQ/Welp

mattiem, to random
@mattiem@mastodon.social avatar

The CAP theorem comes up a lot in backend development. But I think many iOS developers that do any sync/CloudKit work would benefit tremendously understanding it.

It is possible you have a mental model of what “sync” is that has been proven impossible to build.

https://en.m.wikipedia.org/wiki/CAP_theorem

mattiem, to random
@mattiem@mastodon.social avatar

The traction that SPM has gotten for local project organization is astounding. It appears to be The Way now, even if though Xcode has supported static libs since forever, and they are (largely) a more-powerful construct.

What was it that got local packages to take off?

mattiem, to random
@mattiem@mastodon.social avatar

I was interested in @icanzilb's macro issues (https://mastodon.social/@icanzilb/111144895690777092), and I've been looking at it just a bit. The macro version crashes in the concurrency runtime sometimes and the manually-expanded one does not.

I'm pretty sure he's found a compiler bug with macros and concurrency. Unless anyone else has any ideas here, I think you should probably stay away from await within your macros.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • GTA5RPClips
  • DreamBathrooms
  • cubers
  • mdbf
  • everett
  • magazineikmin
  • Durango
  • Youngstown
  • rosin
  • slotface
  • modclub
  • kavyap
  • ethstaker
  • megavids
  • ngwrru68w68
  • thenastyranch
  • cisconetworking
  • khanakhh
  • osvaldo12
  • InstantRegret
  • Leos
  • tester
  • tacticalgear
  • normalnudes
  • provamag3
  • anitta
  • lostlight
  • All magazines