Skip to content

Instantly share code, notes, and snippets.

View twof's full-sized avatar
🐦
Having an animated discussion with the Swift compiler

Alex Reilly twof

🐦
Having an animated discussion with the Swift compiler
View GitHub Profile

Decision Document and FAQ

SN is a strange solution if we were starting from scratch, but given the requirements, it makes sense.

Requirements

  1. We cannot make breaking changes to GraphQL
    1. Developers must be able to evolve their services without doing full rewrites
  2. We must continue to support both advanced clients (Relay, Apollo, etc) and simple clients (curl, etc)
  3. Some GraphQL clients use caches
    1. Data produced by GraphQL services has to be trustworthy, so apps can trust the data in their caches
  4. In addition to existing GraphQL services, we must also cater to future GraphQL services
#c#c#c#a#b#a#c#a#b#a#f#f#f#
li
#c#c#c#a#b#a#c#a#b#a#f#f#f#
mci
#c#c#c#a#b#a#c#a#b#a#f#f#f#
lmcir
#c#c#c#a#b#a#c#a#b#a#f#f#f#
l mci r
#c#c#c#a#b#a#c#a#b#a#f#f#f#
lm c ir
func manachersAlgorithmLeetcode(_ s: String) -> String {
let sPrime = ["#"] + s.map { String($0) }.joined(separator: "#").map { String($0) } + ["#"]
let n = sPrime.count
var palindromeRadii = Array(repeating: 0, count: n)
var center = 0
var rightBound = 0
var maxLength = 0
var maxIndex = 0
for i in 1..<n {
import SwiftUI
import ComposableArchitecture
@Reducer
struct Scroll {
@ObservableState
struct State {
var scrollPosition: Double
var trackerId: String?
}

Everything that happens in tick_ship

  • Check if there is a crash message
    • If there is
      • Show debug text on screen
      • Play ship explosion animation
  • The gas usage count is reset
  • Previously the WASM instance had a portion of it's memory sectioned off to store ship state
  • // TODO: I'm not super clear on what select_submemory does, but I assume that means we're operating on the ship's state from here on out
  • generate_system_state is called. state is passed to the function and updated by the function.
  • Write state to the ship's system state slice of memory

Curl GraphQL

Search used: curl "\"query\": \"{" OR "\"query\": \"query" language:Shell

Results: 342

Learnings

There are a few common use cases you'll see in the examples that do no parsing

A significant amount of press (a selection that is by no means exhaustive has been linked below) has been given to companies and organizations that are doing 4 day/8 hour work weeks without a change in compensation. Organizations that adopted a 4 day work week experienced

  • Sustained or improved productivity.
  • Worker happiness increased dramatically.
  • Stress, burnout and turnover decreased.
  • Companies had an easier time attracting and retaining talent.
  • Customer outcomes improved.
  • Number of sick days declined.
  • Carbon footprints could be reduced significantly.
// Query
{
user {
cat? {
name!
age
}
}
}
extension Binding: Sequence where Value == Array<Track> {
public typealias Iterator = IndexingIterator<Array<Binding<Track>>>
public __consuming func makeIterator() -> IndexingIterator<Array<Binding<Track>>> {
return IndexingIterator(_elements: (0..<wrappedValue.count).map { projectedValue[$0] })
}
}
extension Binding: Collection where Value == Array<Track> {
public typealias Element = Binding<Track>
extension Binding where Value == Array<Track> {
var boundItems: Array<Binding<Track>> {
return (0..<wrappedValue.count).map { projectedValue[$0] }
}
}