Link Search Menu Expand Document

Introduction

Swift and Rust are modern programming languages that are designed to be type-safe, performant, and portable.
And yet the two are rarely compared or even mentioned in the same context.

This page aims to provide a comparison of different modern language features between Swift and Rust.

GitHub repoCONTRIBUTING

Features

Generics - static types

Generics are types (classes, values, functions) that have type parameters. [read more]

Swift Rust

supported


Details: docs.swift.org

supported


Details: doc.rust-lang.org

Generics - dynamic types

Generics can refer to dynamic types with constraints, with type safety guarantees provided by the runtime. [read more]

Swift Rust

pending


supported


Constant evaluation

Constant evaluation allows the compiler to calculate the value of constants during compilation. [read more]

Swift Rust

pending


Details: SE-0359

supported


Details: doc.rust-lang.org