How does Swift implement primitive types in its standard library?

This page summarizes the projects mentioned and recommended in the original post on /r/ProgrammingLanguages

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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).

  • 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)

  • swift

    The Swift Programming Language

  • `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

  • 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.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts