CommunityNews
The Swift Array Design
Goals
- Performance equivalent to C arrays for subscript get/set of non-class element types is the most important performance goal.
- It should be possible to receive an
NSArrayfrom Cocoa, represent it as anArray<AnyObject>, and pass it right back to Cocoa as anNSArrayin O(1) and with no memory allocations.- Arrays should be usable as stacks, so we want amortized O(1) append and O(1) popBack. Together with goal #1, this implies a
std::vector-like layout, with a reserved tail memory capacity that can exceed the number of actual stored elements.To achieve goals 1 and 2 together, we use static knowledge of the element type: when it is statically known that the element type is not a class, code and checks accounting for the possibility of wrapping an
NSArrayare eliminated. AnArrayof Swift value types always uses the most efficient possible representation, identical to that ofContiguousArray…
https://github.com/apple/swift/blob/main/docs/Arrays.rst
This thread was posted by one of our members via one of our news source trackers.
Popular Macos topics
If you’ve been looking for a guide on how to a clean macOS install then you’re in luck! I used to do them religiously every major release...
New
Really, really add /usr/local/bin to the PATH variable on macOS.
In newer macOS custom executables belong in a directory which is not in...
New
We’ll guide you through the process of using Homebrew package manager to install security tools on macOS to exploit vulnerabilities found...
New
Implementing Matrix Multiplication with WebGPU in Safari
This is a quick overview of how to write a matrix multiplication for Safari leve...
New
1 Background
1.1 Swift TLDR
1.2 What Is ABI Stability and Dynamic Linking
1.3 Swift’s Stable ABI
1.4 Resilience and Library Evolution
...
New
Apple has acquired about 100 companies over the last six years, the company’s chief executive Tim Cook has revealed.
That works out at a...
New
Apple announced that it would be moving from Intel processors to Arm-based Apple Silicon CPUs for Macs at WWDC 2020. The Apple Silicon-ba...
New
First Look: macOS Monterey Public Beta.
If there’s a theme of Apple’s operating-system releases in 2021, it’s platform unification. This...
New
From the outset, Mac OS X and macOS have been designed around a relatively small kernel which is given additional capabilities by kernel ...
New
This sample code project demonstrates how to install and run macOS virtual machines on Apple Silicon using the Virtualization framework. ...
New
Other popular topics
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face:
https://on...
New
The V Programming Language
Simple language for building maintainable programs
V is already mentioned couple of times in the forum, but I...
New
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New
Author Spotlight:
VM Brasseur
@vmbrasseur
We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
Author Spotlight:
Peter Ullrich
@PJUllrich
Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
Get the comprehensive, insider information you need for Rails 8 with the new edition of this award-winning classic.
Sam Ruby @rubys
...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /rails
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /html
- /opensuse
- /centos
- /php
- /deepseek
- /zig
- /scala
- /lisp
- /textmate
- /sublime-text
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /deno
- /revery
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /c
- /slackware







