Our great sponsors
-
Nim
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Sorry to not answer the question in the title (I don't know about Swift), but here is how Nim does it (this module is implicitly imported)
`Int` is a regular struct with a single stored property of type `Builtin.Word` . But the latter is a magical compiler built-in. Source for integer types is generated from this template - https://github.com/apple/swift/blob/9da65ca0a15fdf341649c994b0a77ec3b71f2687/stdlib/public/core/IntegerTypes.swift.gyb