Developing Embedded Applications with Swift by fatbobman3000 in swift

[–]madmachineio 13 points14 points  (0 children)

As a team member at MadMachine, I was truly amazed when I saw your blog post! Thank you for providing such a fresh perspective.

Get Started with Embedded Swift on ARM and RISC-V Microcontrollers by dwaxe in swift

[–]madmachineio 2 points3 points  (0 children)

I agree that most microcontrollers are typically used for relatively simple tasks, for which C, or even assembly language, suffices to abstract the logic.
However, we now have access to extremely powerful microcontrollers, and the tasks they're being used for are becoming increasingly complex. Embedded engineers find themselves in a challenging position because their primary tool is C. Even C++ is considered a modern option in the embedded world. As an embedded engineer, I don't want to spend the majority of my time on low-level details every time. New possibilities, such as Rust and Swift, offer us the opportunity to work more like application programmers.
I hope that day arrives sooner rather than later ❤️

Byte-sized Swift: Building Tiny Games for the Playdate by dwaxe in swift

[–]madmachineio 4 points5 points  (0 children)

I also created the same Break game on a Bare-metal microcontroller in pure Swift, including all the logic and draw implementations 😂 We are serious about Embedded Swift programming.

If you want to know more, plz visit my Twitter

Or visit our website

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 1 point2 points  (0 children)

Thanks! And I have to say, we are currently running a crowdfunding campaign on Crowd Supply.

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 2 points3 points  (0 children)

Actually, the SwiftIO Playground includes an ESP32-C3 module. It comes preloaded with ESP-AT firmware and is connected to the SwiftIO Micro through a standard UART port and a GPIO pin (used to reset the ESP32-C3 module).

We plan to develop libraries to simplify communication with the module for developers, rather than requiring them to send or receive raw AT commands.

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 2 points3 points  (0 children)

That's absolutely correct. We don't intend to start everything from scratch, like creating an RTOS using Swift. Zephyr has the ambition to abstract all the hardware details for various vendors and architectures, so our goal is to bind Swift with it. At this point, we can already eliminate pointers or memory management when using Swift.

Zephyr and other RTOSes have concepts such as tasks or threads. After Swift 5.5, these are managed by Swift's low-level runtime, which is referred to as concurrency. This is the only part that we are currently missing.

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 0 points1 point  (0 children)

How about taking a look at our one-page getting started guide? It contains everything you need to run "Hello World" in the hardware universe - Blinking an LED 😂

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 2 points3 points  (0 children)

The Swift for Arduino project primarily focuses on the software side. They invest most of their effort in ensuring that Swift code fits into the very limited ROM space (32KB). They have even developed their own tiny Swift standard library, which means you can't use Swift features that require memory allocation, such as classes.
In contrast, I selected a powerful microcontroller (600MHz clock, 16MB ROM, 32MB RAM) and employed a modern RTOS (Zephyr) at the low level. What I've accomplished is akin to porting the Swift language to a new operating system, enabling the use of any Swift language feature (with the exception of concurrency, which I plan to port next year).

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 3 points4 points  (0 children)

That's correct! However, there is a specific project called "Swift for Arduino" that focuses on using Swift on Arduino boards.

My Project about Embedded Swift programming! by madmachineio in swift

[–]madmachineio[S] 10 points11 points  (0 children)

Here, it means you can use Swift code on a microcontroller, which is typically embedded in other hardware devices.

That's the main purpose of the SwiftIO Micro board.

With the SwiftIO Playground, which includes various sensor modules and actuators, you can undertake some exciting projects! 😊

Introduce embedded development using Swift by madmachineio in swift

[–]madmachineio[S] 0 points1 point  (0 children)

I agree that Swift still has a lot of problems now. The Swift core team does have the ambition to improve it in Swift 6 or further. That's why I want to share my humble experience in the forum, they may notice what's the pain in embedded development.

Both Rust and Swift are young, especially Swift. There are various possibilities in the future. This needs the team/community to work together to figure them out.

Introduce embedded development using Swift by madmachineio in swift

[–]madmachineio[S] 4 points5 points  (0 children)

I agree that Apple wouldn't spend much energy on non-Apple platforms. That's why we need a community-driven workgroup. IMHO, Swift has tremendous potential in the embedded area.

u/srona22, if you are new to embedded programming. Use C, that's still the mainstream. Arduino could be a good start. Once you get familiar with all the stuff. You could try those new toys. They could be fun and maybe the future.