Getting Started with Embedded Swift Programming from ¥0

431 Views

April 14, 26

スライド概要

try! Swift Tokyo 2026の登壇資料です。

profile-image

SwiftとLEGOとBluetooth LEが好きなプログラマ

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

ダウンロード

関連スライド

各ページのテキスト
1.

Getting Started with Embedded Swift Programming from ¥0 Shinichiro Oba | @ooba / @bricklife

2.

Start Right Here, Right Now!

4.

https://wokwi.com/projects/460461089976438785

6.

https://akizukidenshi.com/catalog/g/g116132/

7.

https://akizukidenshi.com/catalog/g/g129481/ https://akizukidenshi.com/catalog/g/g129456/

8.

>99% cheaper than an iPhone!

9.

Embedded Swift on Game Consoles https://play.date/ https://en.wikipedia.org/wiki/Game_Boy_Advance

11.

https://github.com/finnvoor/PlaydateKit/tree/main/Examples/Pong https://github.com/finnvoor/PlaydateKit/tree/main/Examples/FlappySwift

12.

https://github.com/bricklife/swift-gba-sandbox/tree/main/vsync https://github.com/bricklife/swift-gba-sandbox/tree/main/slide-puzzle https://github.com/bricklife/swift-gba-sandbox/tree/main/newyear2026 https://github.com/Kyome22/gba-runcat

13.

Supported Targets % cd ~/Library/Developer/Toolchains/swift-6.3-RELEASE.xctoolchain/usr/lib/swift/embedded/Swift.swiftmodule/ % ls *.swiftmodule aarch64-none-none-elf.swiftmodule armv6-none-none-eabi.swiftmodule i686-unknown-none-elf.swiftmodule arm64-apple-ios.swiftmodule armv6m-apple-none-macho.swiftmodule riscv32-none-none-eabi.swiftmodule arm64-apple-macos.swiftmodule armv6m-none-none-eabi.swiftmodule riscv64-none-none-eabi.swiftmodule arm64-apple-none-macho.swiftmodule armv7-apple-none-macho.swiftmodule wasm32-unknown-none-wasm.swiftmodule arm64e-apple-ios.swiftmodule armv7-none-none-eabi.swiftmodule wasm64-unknown-none-wasm.swiftmodule arm64e-apple-macos.swiftmodule armv7em-apple-none-macho.swiftmodule x86_64-apple-macos.swiftmodule arm64e-apple-none-macho.swiftmodule armv7em-none-none-eabi.swiftmodule x86_64-unknown-none-elf.swiftmodule armv4t-none-none-eabi.swiftmodule armv7m-apple-none-macho.swiftmodule armv6-apple-none-macho.swiftmodule avr-none-none-elf.swiftmodule armv4t-none-none-eabi: GBA (ARM7TDMI) armv6m-none-none-eabi: Raspberry Pi Pico (RP2040) armv7em-none-none-eabi: Playdate (STM32F746) riscv32-none-none-eabi: ESP32-C6 (RISC-V RV32IMAC)

14.

Supported Targets % cd ~/Library/Developer/Toolchains/swift-6.3-RELEASE.xctoolchain/usr/lib/swift/embedded/Swift.swiftmodule/ % ls *.swiftmodule aarch64-none-none-elf.swiftmodule armv6-none-none-eabi.swiftmodule i686-unknown-none-elf.swiftmodule arm64-apple-ios.swiftmodule armv6m-apple-none-macho.swiftmodule riscv32-none-none-eabi.swiftmodule arm64-apple-macos.swiftmodule armv6m-none-none-eabi.swiftmodule riscv64-none-none-eabi.swiftmodule arm64-apple-none-macho.swiftmodule armv7-apple-none-macho.swiftmodule wasm32-unknown-none-wasm.swiftmodule arm64e-apple-ios.swiftmodule armv7-none-none-eabi.swiftmodule wasm64-unknown-none-wasm.swiftmodule arm64e-apple-macos.swiftmodule armv7em-apple-none-macho.swiftmodule x86_64-apple-macos.swiftmodule arm64e-apple-none-macho.swiftmodule armv7em-none-none-eabi.swiftmodule x86_64-unknown-none-elf.swiftmodule armv4t-none-none-eabi.swiftmodule armv7m-apple-none-macho.swiftmodule armv6-apple-none-macho.swiftmodule avr-none-none-elf.swiftmodule armv4t-none-none-eabi: GBA (ARM7TDMI) armv6m-none-none-eabi: Raspberry Pi Pico (RP2040) armv7em-none-none-eabi: Playdate (STM32F746) riscv32-none-none-eabi: ESP32-C6 (RISC-V RV32IMAC)

15.

https://docs.swift.org/embedded/documentation/embedded/introduction/

16.

// HelloEmbedded.swift print("Hello, Embedded Swift !") $ swiftc HelloEmbedded.swift -o HelloEmbedded $ ./HelloEmbedded Hello, Embedded Swift ! $ otool -L HelloEmbedded HelloEmbedded: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1000.0.0) /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 0.0.0) /usr/lib/swift/libswiftSwiftOnoneSupport.dylib (compatibility version 1.0.0, current version 0.0.0) https://docs.swift.org/embedded/documentation/embedded/macosguide

17.

// HelloEmbedded.swift print("Hello, Embedded Swift !") $ swiftc HelloEmbedded.swift -o HelloEmbedded $ ./HelloEmbedded Hello, Embedded Swift ! $ otool -L HelloEmbedded HelloEmbedded: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1000.0.0) /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 0.0.0) /usr/lib/swift/libswiftSwiftOnoneSupport.dylib (compatibility version 1.0.0, current version 0.0.0) $ swiftc HelloEmbedded.swift -o HelloEmbedded -enable-experimental-feature Embedded -wmo $ ./HelloEmbedded Hello, Embedded Swift ! https://docs.swift.org/embedded/documentation/embedded/macosguide

18.

// HelloEmbedded.swift print("Hello, Embedded Swift !") $ swiftc HelloEmbedded.swift -o HelloEmbedded $ ./HelloEmbedded Hello, Embedded Swift ! $ otool -L HelloEmbedded HelloEmbedded: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1000.0.0) /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 0.0.0) /usr/lib/swift/libswiftSwiftOnoneSupport.dylib (compatibility version 1.0.0, current version 0.0.0) $ swiftc HelloEmbedded.swift -o HelloEmbedded -enable-experimental-feature Embedded -wmo $ ./HelloEmbedded Hello, Embedded Swift ! $ swiftc HelloEmbedded.swift -o HelloEmbedded -enable-experimental-feature Embedded -wmo $ otool -L HelloEmbedded HelloEmbedded: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1000.0.0) $ swiftc HelloEmbedded.swift -o HelloEmbedded -enable-experimental-feature Embedded -wmo -Osize -Xlinker -dead_strip $ nm -um HelloEmbedded (undefined) external _putchar (from libSystem) https://docs.swift.org/embedded/documentation/embedded/macosguide

19.

Kernel / OS written with Embedded Swift https://github.com/bastie/SOS SOS is an Embedded Swift bare metal implementation on ARM64 platform. aarch64-none-none-elf https://github.com/spevans/swift-project1 A project to write a kernel in Swift that can run on x86_64 hardware. x86_64-none-unknown-elf https://github.com/MauriceElliott/MAGIos MAGIos is experimental. It is a conduit for me to learn how an OS works as well as giving me an outlet for creativity. riscv64-none-none-eabi

20.

Wasm WebAssembly

21.

https://www.swift.org/documentation/articles/wasm-getting-started.html

22.

Summary ✅ Wokwi - Microcontrollers Simulator ✅ Buy Reasonable Microcontrollers ✅ Playdate Simulator & GBA Emulators ✅ On your Mac / PC ✅ Wasm

23.

JUST DO IT.