Not one but two cool pure #swift bare metal examples were recently posted to the forums.

First for the Raspberry Pi Pico... "Zero lines of C. Not even the vector table, boot2, or startup code. The only non-Swift file is the linker script."

https://forums.swift.org/t/bare-metal-raspberry-pi-pico-examples-written-entirely-in-swift-no-c-code-at-all/85454

Bare-metal Raspberry Pi Pico examples written entirely in Swift, no C code at all

I'd like to share pico-bare-swift, a collection of bare-metal Raspberry Pi Pico (RP2040) examples written entirely in Embedded Swift, with zero lines of C. Not even the vector table, boot2, or startup code. The only non-Swift file is the linker script. What made this possible Placing data in specific linker sections. ARM Cortex-M requires the vector table and boot2 to be placed at specific addresses via linker sections. This used to require GCC's __attribute__((section(...))), but @section (SE-...

Swift Forums

And then a few days later, one for the M5Stack NanoC6

"This project runs pure Swift on the ESP32-C6 (RISC-V) — from the 2nd-stage bootloader to the application — with zero lines of C or assembly." Boots directly into @main.

https://forums.swift.org/t/bare-metal-swift-on-m5stack-nanoc6-no-c-no-assembly-no-esp-idf/85711

Bare-Metal Swift on M5Stack NanoC6: No C, No Assembly, No ESP-IDF

Inspired by @kishikawakatsumi 's Raspberry Pi Pico examples, I wanted to try the same approach on a different architecture. This project runs pure Swift on the ESP32-C6 (RISC-V) — from the 2nd-stage bootloader to the application — with zero lines of C or assembly. Target hardware: M5Stack NanoC6 (ESP32-C6, RISC-V, 320KB SRAM) What's in it Pure Swift 2nd-stage bootloader — disables watchdogs, reads SPI flash via direct register manipulation, configures Flash MMU, loads segments, and jumps t...

Swift Forums
@airspeedswift Super cool. Is there any write up somewhere that breaks down the relative size costs for Swift for uses like this compared with C? I’d expect some overhead for the standard library’s extra capabilities and things like witness tables.
@alexr most witness table usage disappears. Embedded swift monomorphizes all generics (regular swift only does that as an optimization). A big reason for that is to enable dead stripping out the library parts you don't use. You can still use classes, existentials, and CoW types, which requires things like refcounting and dynamic dispatch, but if you don't use those features the difference from C can be fairly minimal (mostly amounts to bounds checking when that can't be eliminated).