Introduction
The rapid advancement of embedded systems, especially those that are safety-critical and integral to cyber-physical systems, presents challenges and opportunities for the WebAssembly (Wasm) community. In a recent panel discussion at Linux Foundation’s WasmCon held in Salt Lake City held on November 11th and 12th, 2024, titled “Safety-Critical Meets Web-Native: WebAssembly (Wasm) Revolutionizes Embedded Systems,” subject matter experts explored how Wasm is shaping the future of embedded systems across various industries, including automotive, industrial automation, and consumer electronics. The session delved into critical areas such as resource constraints, real-time performance, safety and reliability, security, and standards-based interoperability, offering valuable insights into Wasm and revolutionizing the embedded systems landscape. The write-up categorizes the essential subjects discussed at the session with observations from the following panelists and moderator (image below):
Moderator:
Divya Mohan, Open-Source Leader (Community), SUSE
Panelists:
Stephen Berard, Chief Technology Officer, Atym
Larry Carvalho, Principal Consultant, RobustCloud
Dan Mihai Dumitriu, Director and CTO, midokura, a Sony Group company
Chris Woods, Senior Key Expert (SME), Siemens
· Language Flexibility: Traditionally, embedded software development has been confined to low-level languages like C and C++, posing a barrier to developers proficient in other languages. Chris from Siemens highlighted that Wasm allows developers to use a variety of languages, bringing new skills and problem-solving approaches to embedded devices.
· Small Runtime Footprint: Stephen from Atym pointed out that Wasm runtimes like the Wasm Micro Runtime (WAMR) are incredibly lightweight, with footprints as small as 50KB. This minimal overhead is crucial for devices that cannot support entire operating systems, virtual machines, or containers. There are other ways to reduce this event further with projects such as wasm2c.
· Code Portability and Modularity: Wasm enables the creation of portable and modular code, reducing development friction and facilitating more accessible updates and deployments in embedded systems.
Real-Time Performance in Cyber-Physical Systems Real-time performance is essential for the functionality of cyber-physical systems. The panelists discussed how Wasm addresses real-time requirements:· Predictable Performance: Chris noted that WAMR meets many real-time use cases due to its predictable and efficient performance on hardware, with minimal jitter.
· Ahead-of-Time Compilation: Dan from Sony emphasized that ahead-of-time (AOT) compilation can enhance performance, sometimes even outperforming native GCC-compiled code.
· Avoidance of Garbage Collection (GC): Wasm’s ability to ensure memory safety without relying on garbage collection is crucial for real-time systems, as GC can introduce latency and unpredictability.
Enhancing Safety and Reliability in Embedded Systems Safety and reliability are paramount in industries like automotive and industrial automation:· Safety-Critical Opportunities: Chris highlighted the potential for a “safety-certified Wasm runtime,” which could decouple software from hardware certifications, lowering development costs and enabling mixed-criticality solutions where non-safe software runs safely in a sandboxed environment.
· Standardization and Certification: Formal specifications like the Spec-Tec DSL for Wasm can aid in automated proofs and validations, streamlining the certification process for safety-critical applications.
Improving Security Posture with Wasm Security is a significant concern, especially with the increasing connectivity of devices:· Sandboxing Capabilities: Wasm’s sandboxed execution model restricts code interaction to explicitly allowed operations, enhancing security by preventing unauthorized access to system resources.
· Fine-Grained Control: Stephen mentioned that developers can limit runtime environment capabilities based on application needs, such as restricting network access if not required.
· Response to Emerging Threats: Larry emphasized the importance of security in the context of increasing cyber-attacks, particularly for electrical grids and industrial applications.
Aligning Wasm Roadmap with Embedded Systems Needs The panelists offered feedback to the Wasm community to better align its development with industry needs:· Support for Legacy Software: Chris stressed the importance of supporting legacy POSIX-compliant software to ease adoption in the embedded space.
· Lightweight Runtimes: Keeping the runtime lightweight and simplifying function calls are crucial for resource-constrained devices.
· Continued Engagement: Ongoing collaboration through groups like the Embedded Special Interest Group (SIG) can help address technical challenges and align development efforts.
Importance of Standards-Based Interoperability Standardization is vital for widespread adoption:· Creating a Thriving Ecosystem: Chris noted that standards lay the groundwork for ecosystems where partners and competitors can invest and evolve technology over decades.
· Industry Collaboration: Companies like Siemens, Atym, and Sony contribute to standardization efforts through participation in the W3C ecosystem, the Embedded SIG, and research collaborations.
· Balancing Innovation and Standards: Dan highlighted the need to balance rapid deployment with adherence to standards to ensure progress and interoperability.
Innovative Use Cases of Wasm The panelists shared how their organizations leverage Wasm:· Containerization for Embedded Devices: Stephen discussed Atym’s development of a containerization solution using Wasm to enable OCI-like application containers on embedded devices with minimal footprints.
· Signal Processing in Cyber-Physical Systems: Dan mentioned Sony’s use of Wasm for sandboxed signal processing, particularly outputs from deep neural networks.
· Addressing Technical Challenges: These implementations face challenges like integrating runtimes with host systems, creating secure APIs, and ensuring safety, which the organizations are collaboratively addressing.
Collaboration Among Industry Leaders Collaboration accelerates the advancement of Wasm in embedded systems:· Embedded SIG Participation: Companies are working together in the Embedded SIG to tackle technical problems, share efforts, and communicate effectively with the broader Wasm ecosystem.
· Open-Source Contributions: Projects like Atym’s Ocre runtime are released as open-source under the LF Edge project, inviting community contributions and fostering innovation. Project link: https://lfedge.org/projects/ocre/
Future of Wasm in Embedded Systems Looking ahead, the panelists envision:· Safety-Critical Certifications: Achieving a safety-certified Wasm runtime would be a significant milestone, enabling broader adoption in safety-critical applications.
· Attracting New Talent: Wasm’s language flexibility may attract developers who are not traditional embedded systems programmers, enriching the talent pool.
· Hardware Competition: Hardware platforms may compete aggressively to support Wasm, potentially leading to domain-specific accelerations.
Advice for Developers and Stakeholders For those considering adopting Wasm in embedded projects:· Viability and Adoption: Chris assured Wasm is a viable platform already successfully deployed on millions of devices by major companies.
· Getting Started: Developers are encouraged to download a runtime like WAMR, begin their projects, and engage with the community through forums and SIGs.
· Understanding the Ecosystem: While discussions around new features may seem complex, they are part of improving an already stable and widely adopted platform.
Conclusion The panel discussion underscored Wasm’s transformative potential in the embedded systems domain. By addressing resource constraints, enhancing real-time performance, improving safety and security, and fostering standardization, Wasm is poised to revolutionize the industrial sector with automation. Collaborative efforts among industry leaders and the Wasm community are crucial in overcoming challenges and shaping the future roadmap. Developers and stakeholders are encouraged to embrace Wasm, contribute to its evolution, and leverage its capabilities to build the next generation of embedded and cyber-physical systems. The future of embedded systems is not just about hardware innovation but also about adopting flexible, secure, and efficient software platforms like Wasm.