@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

TIL: you can use the tabs cli tool to configure the width of tab characters for your terminal session!

Really great for controlling the formatting of compiler error output.

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,
@mattiem@mastodon.social avatar

@dimsumthinking Nothing at all! And I think selectively removing isolation is, in general, way better than selectively adding it.

mattiem,
@mattiem@mastodon.social avatar

@krzyzanowskim @dgregor79 @dimsumthinking actually no! The compiler will still stop you from touching state that is protected with another actor. It's kind of like a safer version of the familiar global-queue-then-main-queue pattern.

mattiem,
@mattiem@mastodon.social avatar

@krzyzanowskim @dgregor79 @dimsumthinking yeah this is tricky, and hard to get used to. It turns off any isolation that the enclosing type might apply.

Does this help at all?

mattiem,
@mattiem@mastodon.social avatar

@cocoaphony huh. I'm glad you let me know this. But, I'm not super-surprised, as moving stuff from sync->async can be a non-starter even if it's better conceptually.

mattiem,
@mattiem@mastodon.social avatar

@cocoaphony I like to say "your isolation is dictated by your synchronous accesses". In this case, you are saying "my views background color lives on an actor" and Swift concurrency is telling you "no it doesn't". So I'd push you to really justify why that value is in an actor, because like you say, it had profound implications for your UI.

ctietze, to random
@ctietze@mastodon.social avatar

I don't want to start a political discussion.

I wonder, "philosophically" more or less, though, what kind of incentives are missing for so many people.

Context: There are very loud (maybe majority, maybe minority) voices that want to ban a party that is considered "right wing" in the traditional sense.

Problem: If you ban the existence of a group that many people associate with, what outlet will they look for, next?

Is there an attractive alternative so they can participate somewhere else?

mattiem,
@mattiem@mastodon.social avatar

@ctietze I do not know the context so I’m just talking in the abstract.

Should a democracy ban a party whose platform is (for example) dictatorship? I think the answer fundamentally has to be yes. The legal framework in place that keeps a democracy has to be strong enough to prevent its own destruction. But I think one-off bans of a party will never succeed and it should be more structural.

mattiem,
@mattiem@mastodon.social avatar

@ctietze If you really do have a free system where laws and ideas can change and evolve over time (minus the ability to remove that free system), I think the 10% should be free to attempt to convience others via expression ("speech"). And if they fail to do so, it is entirely possible their ideas just aren't suitable for the society.

davidbures, to swift
@davidbures@mstdn.social avatar

Update on Cork Shortcuts support:

I have added a shortcut for refreshing packages. Next step, I'll see if I can add a separate button to Cork itself for only refreshing packages without updating them!

(also, does anyone know why Shortcuts is showing the key for each LocalizedStringResource instead of the actual string? 🤔 see pic #2 for code)

Image of code

mattiem,
@mattiem@mastodon.social avatar

@davidbures I’ve been playing around with AppIntents too!

I’m not super familiar with how LocalizedStringResource works but i don't think is AppIntents specific…

mattiem,
@mattiem@mastodon.social avatar

@davidbures Actually yes! I did have really bad problems with this. You’re going to hate this, but try rebooting…

mattiem,
@mattiem@mastodon.social avatar

@davidbures Have you implemented this in an extension?

mattiem,
@mattiem@mastodon.social avatar

@davidbures Shoot I 0/2 so far. Are you certain those string literals are used to look up localized values?

mattiem,
@mattiem@mastodon.social avatar

@davidbures I’d try it outside of the AppIntent context to try to eliminate some variables. I’ve never used that type anywhere else.

aleck, to random
@aleck@mastodon.social avatar

After a day with 13in MacBook Air M2, I’m really amazed just how light and silent this thing is. Last MacBook I had was 2016 MBP that feels way more heavy than it really is.
This will be really nice travel companion for next decade.

image/jpeg

mattiem,
@mattiem@mastodon.social avatar

@aleck Air is such a fantastic computer!

davidbures, (edited ) to random
@davidbures@mstdn.social avatar

I'm once again reminded why I stopped engaging with the GitHub community.

Me: "I propose idea A"
Maintainer: "Idea A is not acceptable. It will be B"
Me: "I accept it can't be idea A and idea B is closer to what we need, but I think alternative C or D would satisfy both our requirements. B is not a good idea. Could you at least consider it, or give me reasons why idea C or D are still not acceptable?"
Main.: "I'm the maintainer. It will be B. If you don't agree, don't contribute" (PR rejected)

mattiem,
@mattiem@mastodon.social avatar

@davidbures I have also had trouble contributing to homebrew

finestructure, to swift
@finestructure@mastodon.social avatar

“With the increased limit of the acceptance queue, and a patched version of wrk, we can now conclude that swift is a good competitor speed-wise as a web application server.

Memory wise it blows all the other technologies away, using only 2.5% of the amount of memory that the java implementation needs, and 10% of node-js.”

https://tech.phlux.us/Juice-Sucking-Servers-Part-Trois/

mattiem,
@mattiem@mastodon.social avatar

@finestructure I’m not sure it’s actually truly fair to compare to Java memory usage. But still, this is good stuff!

mattiem,
@mattiem@mastodon.social avatar

@finestructure Don’t get me wrong - Java VM tuning is an enormous pain point. You basically cannot run JVM stuff without becoming an expert. But there is some optimized setting and that could, conceivably compete quite well with Swift’s memory usage when handling a similar load. So think this could be hard to compare. But it’s still great and I vastly prefer it!

jsq, to random
@jsq@mastodon.social avatar

Is it possible to set xcodebuild settings inside a Package.swift somehow?

This builds my package successfully:

xcodebuild build -scheme MyScheme SWIFT_STRICT_CONCURRENCY=complete

But if I open Package.swift in Xcode, it fails to build because “complete" is not the default.

(This is because MainActor.assumeIsolated was introduced in iOS 17, but backported to iOS 13)

mattiem,
@mattiem@mastodon.social avatar

@jsq I know of no way to do that.

But you can configure packages with swift settings. Check this out: https://github.com/mattmassicotte/PackageTemplate/blob/main/Package.swift

mattiem,
@mattiem@mastodon.social avatar

@jsq Ok so that won’t work for you?

JTostitos, to swift
@JTostitos@techhub.social avatar

Swift/SwiftUI Question: App Store Connect API provides a gzip when the response is successful for a particular endpoint I am accessing.

How do I take this gzip and save the contents of it to a files app / sandbox directory / swift data, so that I can read it and view the contents? From what I understand, gzip is similar to a zip file?

So far my attempts to save it to files to read the contents have failed. It says “Inappropriate file type or format”.

#swift #swiftlang #swiftui

mattiem,
@mattiem@mastodon.social avatar

@JTostitos When you say “it says”, what is “it”? You should definitely be able to do this.

mattiem,
@mattiem@mastodon.social avatar

@JTostitos Oh no my mistake I think you had everything in there.

Gzip is not the same thing as zip. But what you might be able to do is download, decompress (gunzip) and save the resulting data as public.text into Files.

mattiem,
@mattiem@mastodon.social avatar

@JTostitos You would definitely uncompress it. But after that, it is whatever type it is. If the data actually is CSV then yes.

jsq, to random
@jsq@mastodon.social avatar

Here’s my workaround for a non-sendable closures.

Is this a good idea, or a great idea?

image/png

mattiem,
@mattiem@mastodon.social avatar

@jsq Oh yes I would be happy to discuss an official endorsement! I think you’ll find rates very reasonable given the globally-recognized stature of brand.

mattiem,
@mattiem@mastodon.social avatar

@jsq “Uncheck yourself before you wreck yourself”

  • 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