Archive for June 10, 2022

Friday, June 10, 2022

Sunsetting the Atom Text Editor

GitHub (Hacker News):

As new cloud-based tools have emerged and evolved over the years, Atom community involvement has declined significantly. As a result, we’ve decided to sunset Atom so we can focus on enhancing the developer experience in the cloud with GitHub Codespaces.

[…]

It’s worth reflecting that Atom has served as the foundation for the Electron framework, which paved the way for the creation of thousands of apps, including Microsoft Visual Studio Code, Slack, and our very own GitHub Desktop. However, reliability, security, and performance are core to GitHub, and in order to best serve the developer community, we are archiving Atom to prioritize technologies that enable the future of software development.

Nathan Sobo:

Founder of Atom here. We’re building the spiritual successor to Atom over at Zed.dev.

They call it a “a lightning-fast, collaborative code editor written in Rust.”

Previously:

FormatStyles in iOS 16 and macOS 13

Brett Ohland:

The yearly developer conference was firing on all cylinders this year, with some nice additions and one big fix on the FormatStyle front.

[…]

We now have an API for the byte count format style on top of the Measurement framework when using the UnitInformationStorage unit.

[…]

iOS 16 introduces the new Duration unit, which is purpose built to deal with very accurate time measurements. There’s two new styles to support it.

[…]

There’s a new, and surprisingly deep, format style for URLs[…]

[…]

There’s a couple of significant changes to the Verbatim style.

Previously:

Swift Regex

Meet Swift Regex:

Learn how you can process strings more effectively when you take advantage of Swift Regex. Come for concise literals but stay for Regex builders — a new, declarative approach to string processing. We’ll also explore the Unicode models in String and share how Swift Regex can make Unicode-correct processing easy.

I’m really excited about Swift Regex. It should be much more ergonomic than NSRegularExpression, which has always been awkward to use, and faster, too, since it can work directly in Swift’s native string encoding.

Also, in theory it should handle Unicode edge cases better. I’ve run into problems where NSRegularExpression returns capture ranges that are valid for NSString and String.UTF16View but which do not exactly map to valid indexes into the String itself.

I’d like to see Apple bring Swift Regex to Core Data, too. First, it would be nice to get consistent results (both matching and performance characteristics) by using the same engine throughout an app. Second, regex matching within SQLite queries is currently slow because it converts each database string from UTF-8 to UTF-16 before invoking ICU.

Swift Regex: Beyond the basics:

Go beyond the basics of string processing with Swift Regex. We’ll share an overview of Regex and how it works, explore Foundation’s rich data parsers and discover how to integrate your own, and delve into captures. We’ll also provide best practices for matching strings and wielding Regex-powered algorithms with ease.

Ron Avitzur:

Tis nifty watching Xcode refactor /(([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)|NaN/ to a Regex Builder, even if the compiler is unable to type-check this expression in reasonable time.

Steve Canon:

The converter that Xcode uses for regex -> builder is in the experimental-string-processing repo.

Previously:

Update (2022-06-16): Frank Illenberger:

I’m disappointed by the performance of the new Swift Regex. Take a look at these two versions of a CSS variable lookup. On my Intel iMac, the first one with NSRegularExpression takes 0.0002s to complete an enum over all matches on a 2000 line CSS file. The second one takes 0.25s.

Update (2022-10-11): Keith Harrison:

You can improve the type safety of captured values by adding a transform block to the capture. This allow you to transform the generic capture output to a known type. For example, to transform the captured digits to an (optional) integer[…]

And you can use TryCapture to make the regex backtrack if the Swift code returns nil.

You can use the Foundation date, number, currency and URL parses with regex builder.

Update (2022-12-02): Shane Crawford:

We’ll be digging into Regex Builder to discover its wide-reaching capabilities.

Sindre Sorhus:

The new regex stuff in Swift is truly amazing! The following would have been an unreadable mess in most other languages.

Safari 16 Announced

What’s new in Safari and WebKit (Hacker News):

Explore the latest features in Safari and WebKit and learn how you can make better and more powerful websites. We’ll take you on a tour through the latest updates to HTML, CSS enhancements, Web Inspector tooling, Web APIs, and more.

Jen Simmons (Hacker News):

Safari 16 brings support for Web Inspector Extensions, so you can enhance Safari’s built-in browser developer tools. This can be especially helpful when using powerful third-party frameworks and services — perhaps your team uses React, Angular, Vue, or Ember; or maybe a popular test suite or another developer service.

[…]

After years of collaboration by engineers working on various browsers to figure out whether or not they would even be possible, Container Queries are finally here. Similar to Media Queries, Container Queries allow you to adjust the layout or styling of a particular item on your web page based on the size of its container rather than the size of the viewport. They’ll be an invaluable tool for creating reusable components in a design system.

[…]

Web Push is coming to Safari 16 on macOS Ventura. This lets you remotely send notifications to users of your websites and web apps — and deliver those notifications even when Safari isn’t running.

[…]

Subgrid takes Grid to another level, providing an easy way to put grandchildren of a grid container on that grid. It makes it possible to line up items across complex layouts without being constrained by the HTML structure.

Previously: