Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Swift feature map

Inspiration from The Swift Programming Language. Romit aims for practical coverage with shorter surface syntax; proposal unless marked shipped. Batches follow the roadmap.

Swift areaSwift (summary)Romit (proposal)RationaleStatusBatch
Basicslet / var, +=set x to 5, x = 5, x += 1, increase x by 2, decimals (7 / 2 is 3.5)Plain assignment; compiler infers flowshipped1–2
Operators+ - * / %, ==…symbols and plus, is at least, …Same meaning; words optionalshipped1
Functionsfunc f(_ a: Int) -> Intsum: a, b / fn sum a, b body giveColon header + indentation; fn/function aliasesshipped1
Callsf(1, 2)f 1, 2 (no parens)Space/comma arg listsshipped1
Default paramsname: String = "x"fn greet name is "world"Default after isshipped1
Control flowif / elseif / otherwise if / otherwise blocksIndentation blocks, no bracesshipped1
Loopsfor-in, while, break, continuefor each i in 1 to 5, for each x in xs, while, repeat N times, stop, skipPlain wordsshipped1–2
OptionalsT?, if let(planned) optional wordsShorter chaining laterplanned3
Strings"\(x)""Hi {name}", + / plus, say "Hi " nameInterpolation inside text only; code stays brace-freeshipped2
CollectionsArray, Set, Dictlist 1, 2, 3, add x to xs, for each x in xs, count of xs; records in UI apps (with title "a", done false)No bracketspartial2
Structs / classesstruct, class(planned) type blocksValue types firstplanned4
Enumsenum associated valuesspec enum + script enums laterSpec layer todaypartial3
Error handlingthrow / try(planned) reject / recoverAlign with spec rejectplanned4
Generics<T>(planned) type parameters on fnNo angle bracketsplanned5
Protocolsprotocol(planned) shape / requirementsWord-based constraintsplanned5
Extensionsextension(planned) extendSame semantics, shorterplanned5
Access controlpublic / private(planned) shared / fileShorter labelsplanned6
Concurrencyasync/await(planned) later / waitBatch after core runtimeplanned6
Pattern matchingswitch / caseif / otherwise + future matchBatch 1 if/otherwisepartial1
Property wrappers@Wrapper(planned)Not in scope yetplanned7
Macros#macro(planned)Not in scope yetplanned7

For SwiftUI (views, layout, state, navigation, modifiers), see SwiftUI → Romit.

Batch 2

Shipped: text interpolation ("Hi {name}"), + joins text, decimals and true division, # / note comments, += / -= / increase / decrease, lists with add / remove / for each … in and built-ins (count, sum, sort, join, …), stop / skip, and Romit apps (use ui + app / screen).

Batch 1

Shipped in the compiler and docs: script functions (sum:, fn, function), give, comma/space parameters and call arguments, control-flow statements, operator aliases (+ / plus, is at least / >=, % / remainder), validation codes through E119 / P028, playground and beginner examples.

Deferred to later batches: entities and collections in the script interpreter, optionals, native compilation, full generic and protocol syntax.