Recent Posts
Archives

Archive for the ‘en-US’ Category

PostHeaderIcon Building Intelligent Data Products at Scale

Introduction

Thomas Vachon shares insights into scaling data-driven products, blending machine learning, engineering, and user-centric design to create impactful and intelligent applications.

Key Ingredients for Success

Building intelligent products requires aligning data pipelines, model training, deployment infrastructure, and feedback loops. Vachon stresses the importance of cross-functional collaboration between data scientists, software engineers, and product teams.

Real-World Lessons

From architectural best practices to team organization strategies, Vachon illustrates how to navigate the complexity of scaling data initiatives sustainably.

Conclusion

Intelligent data products demand not only technical excellence but also thoughtful design, scalability planning, and user empathy from day one.

PostHeaderIcon Boosting AI Reliability: Uncertainty Quantification with MAPIE

Watch the video

Introduction

Thierry Cordier and Valentin Laurent introduce MAPIE, a Python library within scikit-learn-contrib, designed for uncertainty quantification in machine learning models.

MAPIE on GitHub

Managing Uncertainty in Machine Learning

In AI applications — from autonomous vehicles to medical diagnostics — understanding prediction uncertainty is crucial. MAPIE uses conformal prediction methods to generate prediction intervals with controlled confidence, ensuring safer and more interpretable AI systems.

Key Features

MAPIE supports regression, classification, time series forecasting, and complex tasks like multi-label classification and semantic segmentation. It integrates seamlessly with scikit-learn, TensorFlow, PyTorch, and custom models.

Real-World Use Cases

By generating calibrated prediction intervals, MAPIE enables selective classification, robust decision-making under uncertainty, and provides statistical guarantees critical for safety-critical AI systems.

Conclusion

MAPIE empowers data scientists to quantify uncertainty elegantly, bridging the gap between predictive power and real-world reliability.

PostHeaderIcon [GoogleIO2024] Google Keynote: Breakthroughs in AI and Multimodal Capabilities at Google I/O 2024

The Google Keynote at I/O 2024 painted a vivid picture of an AI-driven future, where multimodality, extended context, and intelligent agents converge to enhance human potential. Led by Sundar Pichai and a cadre of Google leaders, the address reflected on a decade of AI investments, unveiling advancements that span research, products, and infrastructure. This session not only celebrated milestones like Gemini’s launch but also outlined a path toward infinite context, promising universal accessibility and profound societal benefits.

Pioneering Multimodality and Long Context in Gemini Models

Central to the discourse was Gemini’s evolution as a natively multimodal foundation model, capable of reasoning across text, images, video, and code. Sundar recapped its state-of-the-art performance and introduced enhancements, including Gemini 1.5 Pro’s one-million-token context window, now upgraded for better translation, coding, and reasoning. Available globally to developers and consumers via Gemini Advanced, this capability processes vast inputs—equivalent to hours of audio or video—unlocking applications like querying personal photo libraries or analyzing code repositories.

Demis Hassabis elaborated on Gemini 1.5 Flash, a nimble variant for low-latency tasks, emphasizing Google’s infrastructure like TPUs for efficient scaling. Developer testimonials illustrated its versatility: from chart interpretations to debugging complex libraries. The expansion to two-million tokens in private preview signals progress toward handling limitless information, fostering creative uses in education and productivity.

Transforming Search and Everyday Interactions

AI’s integration into core products was vividly demonstrated, starting with Search’s AI Overviews, rolling out to U.S. users for complex queries and multimodal inputs. In Google Photos, Gemini enables natural-language searches, such as retrieving license plates or tracking skill progressions like swimming, by contextualizing images and attachments. This multimodality extends to Workspace, where Gemini summarizes emails, extracts meeting highlights, and drafts responses, all while maintaining user control.

Josh Woodward showcased NotebookLM’s Audio Overviews, converting educational materials into personalized discussions, adapting examples like basketball for physics concepts. These features exemplify how Gemini bridges inputs and outputs, making knowledge more engaging and accessible across formats.

Envisioning AI Agents for Complex Problem-Solving

A forward-looking segment explored AI agents—systems exhibiting reasoning, planning, and memory—to handle multi-step tasks. Examples included automating returns by scanning emails or assisting relocations by synthesizing web information. Privacy and supervision were stressed, ensuring users remain in command. Project Astra, an early prototype, advances conversational agents with faster processing and natural intonations, as seen in real-time demos identifying objects, explaining code, or recognizing locations.

In robotics and scientific domains, agents like those in DeepMind navigate environments or predict molecular interactions via AlphaFold 3, accelerating research in biology and materials science.

Empowering Developers and Ensuring Responsible AI

Josh detailed developer tools, including Gemini 1.5 Pro and Flash in AI Studio, with features like video frame extraction and context caching for cost savings. Pricing was announced affordably, and Gemma’s open models were expanded with PaliGemma and the upcoming Gemma 2, optimized for diverse hardware. Stories from India highlighted Navarasa’s adaptation for Indic languages, promoting inclusivity.

James Manyika addressed ethical considerations, outlining red-teaming, AI-assisted testing, and collaborations for model safety. SynthID’s extension to text and video combats misinformation, with open-sourcing planned. LearnLM, a fine-tuned Gemini for education, introduces tools like Learning Coach and interactive YouTube quizzes, partnering with institutions to personalize learning.

Android’s AI-Centric Evolution and Broader Ecosystem

Sameer Samat and Dave Burke focused on Android, embedding Gemini for contextual assistance like Circle to Search and on-device fraud detection. Gemini Nano enhances accessibility via TalkBack and enables screen-aware suggestions, all prioritizing privacy. Android 15 teases further integrations, positioning it as the premier AI mobile OS.

The keynote wrapped with commitments to ecosystems, from accelerators aiding startups like Eugene AI to the Google Developer Program’s benefits, fostering global collaboration.

Links:

PostHeaderIcon [PyData Paris 2024] Exploring Quarto Dashboard for Impactful and Visual Communication

Exploring Quarto Dashboard for Impactful and Visual Communication

Watch the video

Introduction

Christophe Dervieux introduces us to Quarto Dashboard, a powerful open-source scientific and technical publishing system. Designed to create impactful visual communication directly from Jupyter Notebooks, Quarto enables the seamless creation of interactive charts, dashboards, and dynamic narratives.

Building Visual Communication with Quarto

Quarto extends standard markdown with advanced features tailored for scientific writing. It offers support for multiple computation engines, allowing narratives and executable code to merge into various outputs: PDF, HTML pages, websites, books, and especially dashboards. The dashboard format enhances data communication by organizing visual metrics in an efficient and impactful layout.

Using Quarto, rendering a Jupyter notebook becomes simple: with just a command-line instruction (quarto render), users can output polished, shareable dashboards. Additional extensions, such as those available in VS Code, JupyterLab, and Positron IDEs, streamline this experience further.

Dashboard Features and Design

Dashboards in Quarto organize content using components like cards, rows, columns, sidebars, and tabs. Each element structures visual outputs like plots, tables, and value boxes, allowing maximum clarity. Customization is straightforward, leveraging YAML configuration and Bootstrap-based theming. Users can create multi-page navigation, interactivity through JavaScript libraries, and adapt layouts for specific audiences.

Recent updates even enable branding dashboards easily with SCSS themes, making Quarto ideal for both scientific and corporate environments.

Conclusion

Quarto revolutionizes technical communication by enabling scientists and analysts to produce professional-grade dashboards and publications effortlessly. Christophe’s session at PyData Paris 2023 showcased the simplicity, power, and flexibility Quarto brings to modern data storytelling.

PostHeaderIcon [NDCOslo2024] Domain-Driven Design in Practice: How to Draw Your Domain Boundaries IRL – Vilde Opsal

In the dynamic crucible of organizational transformation, where business and technology converge, Vilde Opsal, an architect at FINN.no, narrates a saga of redrawing domain boundaries amidst a Nordic merger. As FINN.no and Schibsted Nordic Marketplaces shifted from horizontal silos to vertical units, Vilde orchestrated a domain-driven design (DDD) odyssey, harmonizing legacy maps with new strategies. Her case study, vibrant with real-world trials, illuminates how to craft domain boundaries that evolve with stakeholders, blending art, agility, and audience empathy.

Vilde frames her talk as a TV show, casting herself as the architect alongside product leads, developers, and a “big boss.” FINN.no’s reorganization—merging four marketplaces into a Nordic entity—demanded a new domain map to support independent verticals. Her mission: align historical domains, new teams, and strategic shifts, ensuring boundaries serve both immediate needs and long-term visions.

Crafting the Canvas: Principles of Domain-Driven Design

DDD, Vilde asserts, is an art, not a science. She begins with core tenets: domains as cohesive problem spaces, bounded contexts as clear partitions. At FINN.no, legacy boundaries—tied to functional areas like payments or listings—clashed with vertical ambitions. Her approach: engage stakeholders collaboratively, mapping domains via workshops that blend business goals with technical realities.

Vilde’s toolkit includes event storming, visualizing user journeys to delineate domains. For instance, real estate verticals prioritized distinct user journeys, while cars focused on transactional flows. This divergence necessitated tailored boundaries, ensuring each vertical’s autonomy while maintaining shared services like authentication.

Adapting to Audiences: Evolving Boundaries Over Time

Boundaries evolve, Vilde notes, as teams and goals shift. Early in the merger, real estate teams preserved legacy setups, minimizing disruption, while car verticals embraced user-centric journeys. She experimented with visualizations—temperature gauges, tables—to communicate progress, finding simplicity trumped flair. A table, mapping current versus aspirational states, resonated most, aligning diverse stakeholders.

Her insight: meet audiences where they are. Developers craved technical granularity; executives sought strategic clarity. By tailoring visualizations—diagrams for tech, narratives for business—Vilde bridged divides, ensuring domain maps clicked and stuck.

Balancing Pragmatism and Vision: Iterative Refinement

Pragmatism guided FINN.no’s journey. One vertical, pressed for time, made local decisions, deferring holistic reviews. Another, post-transformation, leaned on jobs-to-be-done, aligning domains to user needs. Vilde’s lesson: flexibility fosters progress. Iterative refinements, validated through experiments, ensured boundaries adapted to new stakeholders, like Nordic partners.

Her capstone: DDD thrives on dialogue. By fostering continuous feedback—workshops, retrospectives—teams co-create boundaries, balancing agility with coherence.

Embracing the Art: Making Domains Click

Vilde’s finale underscores DDD’s artistry: no universal blueprint exists. Success lies in experimentation, stakeholder alignment, and persistent iteration. Her challenge: craft domains that resonate, guiding teams from chaos to clarity with empathy and precision.

Links:

PostHeaderIcon [DotJs2024] API Design is UI Design

In the intricate tapestry of software craftsmanship, the boundaries between visual interfaces and programmatic ones blur, revealing a unified discipline rooted in empathy and usability. Lea Verou, a luminary in web standards and W3C TAG member, delivered a revelatory session at dotJS 2024, asserting that API design mirrors UI design in every facet—from intuitiveness to error resilience. With a PhD from MIT focused on developer experience and stewardship of dozens of open-source projects, Verou dissected the pitfalls of APIs that frustrate and the principles that enchant, urging creators to treat code as an interface wielded by fellow humans.

Verou opened with a visceral anecdote: the SVG DOM’s labyrinthine quest to extract a circle’s radius, yielding not a crisp number but an SVGAnimatedLength riddled with baseVal, animVal, and unit-conversion methods—annoying even sans animations. This exemplar encapsulated her thesis: APIs, be they functions, classes, components, or native browser APIs, are user interfaces where developers are the users, and interactions manifest as keystrokes. Echoing Alan Kay’s maxim—”simple things should be easy, complex things possible”—she mapped it to a complexity plane: low-effort dots for trivial tasks, viable paths for sophistication. Usability tenets, from Google Calendar’s drag-and-drop simplicity to advanced recurrence rules, permeate both realms; DX is merely UX recast for code scribes.

Central to Verou’s discourse was user-centricity: APIs thrive when attuned to genuine needs, not theoretical purity. High-level use cases—like assembling IKEA furniture with a screwdriver—inform broad abstractions, while low-level ones—like screwing a wall anchor—demand primitives. She critiqued legacy DOM traversals burdened by redundant parent references, supplanted by modern APIs favoring single-truth sources. Components exemplify elegance: encapsulating dialog boilerplate into reusable units slashes cognitive load. Iterating isn’t prohibitive; ship high-level facades covering 80% of scenarios, layering primitives as demands surface—or vice versa, observing usage to scaffold abstractions. The Intl.DateTimeFormat API’s evolution—from vague toLocaleString to nuanced options yielding structured outputs—exemplifies this progressive disclosure, smoothing from casual to granular control.

Verou championed empirical validation: user testing, sans visuals, via representative tasks and think-aloud protocols. Five participants unearth 85% of issues; two halve them. Zoom suffices—no labs required. Dogfooding complements: prototype demos, draft docs, author tests pre-implementation, refining iteratively. Empathy crowns all: intuit users’ pains, infer principles organically. Tailwind’s rise signals CSS’s accessibility gaps; blame the medium, not the maker, and mend it. Verou’s clarion call: infuse humanity into APIs, easing burdens and amplifying creativity across the dev spectrum.

Usability Principles Across Interfaces

Verou wove Kay’s dictum into a visual quadrant, plotting task complexity against UI/API effort, advocating coverage of simple-easy and complex-possible quadrants. User needs—pain points, scenarios—drive this: distinguish macro goals from micro actions, ensuring APIs mirror real workflows. SVG’s unit obsessions ignored 90% of queries; streamlined getters would suffice. Progressive layers, as in date formatting’s escalating options, democratize power without overwhelming novices.

Empirical Refinement and Empathy

Testing APIs demands observation: task users, query struggles non-leadingly, affirm it’s the design under scrutiny. Verou debunked myths—engineers aren’t users; widespread misuse indicts the API. Dogfood rigorously: sketch code flows pre-build, iterate via docs and tests. Ultimate imperative: cultivate care—empathize with wielders’ contexts, yielding designs that intuit, adapt, and inspire.

Links:

PostHeaderIcon [PHPForumParis2023] Making API Platform Compatible with Laravel – Antoine Bluchet

Antoine Bluchet, Technical Director at Les-Tilleuls.coop and release manager for API Platform, presented a compelling session at Forum PHP 2023 on integrating API Platform with Laravel. Under the pseudonym “soyuka,” Antoine shared how his team at Les-Tilleuls.coop bridged two major PHP frameworks to bring API Platform’s robust features to Laravel’s vast user base. His talk detailed the technical and collaborative efforts behind this integration, offering insights into creating interoperable, standards-driven PHP solutions.

The Vision for Cross-Framework Compatibility

Antoine opened by outlining API Platform’s mission to deliver standardized, feature-rich API development tools to a broad audience. Initially a Symfony bundle, API Platform leverages Symfony components, which Laravel also uses, making integration feasible. Antoine explained how his team aimed to make API Platform’s advanced features—like automatic API generation and OpenAPI support—accessible to Laravel developers, one of the largest PHP communities. This vision, he noted, aligns with Les-Tilleuls.coop’s cooperative ethos of collective decision-making and shared innovation.

Technical Challenges and Solutions

Delving into the implementation, Antoine described the technical hurdles of aligning API Platform’s architecture with Laravel’s. His team spent years refining the integration, using Architecture Decision Records (ADRs) to document their process. By reusing Symfony components already present in Laravel, they ensured compatibility without compromising functionality. Antoine’s examples demonstrated how Laravel developers can now leverage API Platform’s tools to build scalable APIs, highlighting practical steps like configuring middleware and adapting request handling.

Collaborative Innovation and Future Prospects

Antoine concluded by reflecting on the collaborative effort behind the project, involving multiple core team members at Les-Tilleuls.coop. He hinted at future explorations, such as adapting API Platform for other languages like Java, to further democratize its capabilities. His talk inspired PHP developers to embrace cross-framework collaboration, leveraging shared components to enhance their projects’ scalability and maintainability.

Links:

PostHeaderIcon [KotlinConf2024] Kotlin 2.0 and Beyond: Evolving Language Features

Michail Zarečenskij, Kotlin’s lead language designer, captivated KotlinConf2024 with a deep dive into Kotlin 2.0’s advancements and future features. The K2 compiler, central to Kotlin 2.0, introduces a frontend intermediate representation (FEIR) and a new control flow engine, enhancing code consistency and smart casts. Michail outlined upcoming features like guarded conditions, context parameters, and union types for errors, addressing modern development challenges. Through code examples and audience Q&A, he showcased Kotlin’s evolution, ensuring it remains concise, safe, and expressive for millions of developers.

Kotlin’s Evolutionary Journey

Since its 1.0 release eight years ago, Kotlin has grown significantly, adding features like coroutines, functional interfaces, and multiplatform support post-launch. Michail highlighted gradual introductions, such as trailing commas and exhaustive when statements, alongside bug fixes for smart casts and type inference. Beyond language, Kotlin targets JVM, Native, and Web, with scripting, Android, and server-side capabilities. Supported by IntelliJ and Fleet plugins, Compose compiler plugins, and libraries like Serialization, Kotlin’s ecosystem thrives on community-driven open-source contributions, setting the stage for K2’s transformative impact.

The K2 Compiler: A Robust Foundation

The K2 compiler, powering Kotlin 2.0, addresses limitations of the original compiler, which struggled with unexpected features like multiplatform requirements. Michail explained K2’s redesigned architecture, enabling faster language evolution and multiplatform plugin support. Unlike the tightly coupled original, K2 separates compiler and IDE logic, simplifying maintenance. With over 80 features, including build tool enhancements, K2 prioritizes performance, cutting compilation times, and correctness, fixing longstanding issues. Tested on 10M lines of code, K2 ensures stability, making it a cornerstone for future language advancements.

Frontend Intermediate Representation: Consistent Code

K2’s frontend intermediate representation (FEIR) transforms complex language constructs into simpler forms earlier in compilation, ensuring consistent analysis. Michail demonstrated with a mutable list increment example, where K2 resolves operator and conversion issues that tripped the old compiler. By desugaring expressions, FEIR handles nullable operators and delegate properties robustly, supporting intricate combinations of operators and extensions. This consistency empowers developers to compose features confidently, reducing errors in scenarios like nullable assignments or generic type operations, strengthening Kotlin’s expressiveness.

Control Flow Engine: Smarter Analysis

The new control flow engine in K2 enhances code execution analysis, detecting unreachable code and potential bugs. Michail showcased improved smart casts, such as local variables contributing to type safety. For example, extracting a nullability check to a variable now supports smart casts, unlike the old compiler. Inline functions gain implicit “call-in-place” contracts, enabling smart casts in lambdas. Logical operator smart casts, like merging types after an “or” check, further refine type inference, making Kotlin’s type system more intuitive and reducing manual casts.

Enhanced Smart Casts in Kotlin 2.0

Smart casts, a Kotlin hallmark, see significant upgrades in 2.0. Michail presented examples where K2 applies smart casts across nullability checks, type checks, and inline function lambdas. For instance, checking a variable’s type and nullability now triggers dual smart casts in appropriate blocks. Logical “or” operations infer supertypes, enabling method calls without explicit casting. These enhancements reduce cognitive load, letting developers focus on logic rather than type management. Compatibility with existing smart casts and contracts ensures a seamless transition, boosting code safety.

Guarded Conditions: Concise Control Flow

Set for beta in Kotlin 2.1, guarded conditions in when expressions eliminate restrictive single-check limitations. Michail illustrated with a UI-rendering example, where repeated variable checks cluttered code. Guarded conditions allow additional “if” clauses in when branches, reducing repetition and nesting. Context-sensitive resolution, planned for Kotlin 2.2, further simplifies sealed type handling by omitting base class names when types are known. These features streamline control flow, enhancing readability and maintainability, especially in complex UI or data-processing logic.

Context Parameters: Flexible APIs

Context parameters, moving to beta in Kotlin 2.2, enhance API design by allowing multiple receivers. Michail demonstrated with an autoclose scope, where context parameters enable extension functions within specific scopes, improving IDE autocompletion. This addresses limitations in single-receiver functions, making APIs more extensible and discoverable. By moving receivers to a context section, developers gain flexibility in defining operations, aligning with Kotlin’s focus on expressive, type-safe APIs. The feature’s popularity in experimental form underscores its potential to reshape library design.

Union Types for Errors: Robust Error Handling

Michail previewed union types for errors, targeting error and exception handling without general union types due to type checker complexity. In a sequence search example, union types distinguish “not found” from “null” results, eliminating extra variables and unchecked casts. Planned for future releases, this feature introduces a dedicated error type category with a “throw” method, compatible with exceptions. Smart casts automatically apply, streamlining error handling. Q&A clarified that multicatch support, akin to Java, is a goal, enhancing Kotlin’s robustness in production code.

Links:

PostHeaderIcon [DevoxxUK2024] Devoxx UK Introduces: Aspiring Speakers 2024, Short Talks

The Aspiring Speakers 2024 session at DevoxxUK2024, organized in collaboration with the London Java Community, showcased five emerging talents sharing fresh perspectives on technology and leadership. Rajani Rao explores serverless architectures, Yemurai Rabvukwa bridges chemistry and cybersecurity, Farhath Razzaque delves into AI-driven productivity, Manogna Machiraju tackles imposter syndrome in leadership, and Leena Mooneeram offers strategies for platform team synergy. Each 10-minute talk delivers actionable insights, reflecting the diversity and innovation within the tech community. This session highlights the power of new voices in shaping the future of software development.

Serverless Revolution with Rajani Rao

Rajani Rao, a principal technologist at Viva and founder of the Women Coding Community, presents a compelling case for serverless computing. Using a restaurant analogy—contrasting home cooking (traditional computing) with dining out (serverless)—Rajani illustrates how serverless eliminates infrastructure management, enhances scalability, and optimizes costs. She shares a real-world example of porting a REST API from Windows EC2 instances to AWS Lambda, handling 6 billion monthly requests. This shift, completed in a day, resolved issues like CPU overload and patching failures, freeing the team from maintenance burdens. The result was not only operational efficiency but also a monetized service, boosting revenue and team morale. Rajani advocates starting small with serverless to unlock creativity and improve developer well-being.

Chemistry Meets Cybersecurity with Yemurai Rabvukwa

Yemurai Rabvukwa, a cybersecurity engineer and TikTok content creator under STEM Bab, draws parallels between chemistry and cybersecurity. Her squiggly career path—from studying chemistry in China to pivoting to tech during a COVID-disrupted study abroad—highlights transferable skills like analytical thinking and problem-solving. Yemurai identifies three intersections: pharmaceuticals, healthcare, and energy. In pharmaceuticals, both fields use a prevent-detect-respond framework to safeguard systems and ensure quality. The 2017 WannaCry attack on the NHS underscores a multidisciplinary approach in healthcare, involving stakeholders to restore services. In energy, geopolitical risks and ransomware target renewable sectors, emphasizing cybersecurity’s critical role. Yemurai’s journey inspires leveraging diverse backgrounds to tackle complex tech challenges.

AI-Powered Productivity with Farhath Razzaque

Farhath Razzaque, a freelance full-stack engineer and AI enthusiast, explores how generative AI can transform developer productivity. Quoting DeepMind’s Demis Hassabis, Farhath emphasizes AI’s potential to accelerate innovation. He outlines five levels of AI adoption: zero-shot prompting for quick error resolution, AI apps like Cursor IDE for streamlined coding, prompt engineering for precise outputs, agentic workflows for collaborative AI agents, and custom solutions using frameworks like LangChain. Farhath highlights open-source tools like NoAI Browser and MakeReal, which rival commercial offerings at lower costs. By automating repetitive tasks and leveraging domain expertise, developers can achieve 10x productivity gains, preparing for an AI-driven future.

Overcoming Imposter Syndrome with Manogna Machiraju

Manogna Machiraju, head of engineering at Domestic & General, shares a candid exploration of imposter syndrome in leadership roles. Drawing from her 2017 promotion to engineering manager, Manogna recounts overworking to prove her worth, only to face project failure and team burnout. This prompted reflection on her role’s expectations, realizing she wasn’t meant to code but to enable her team. She advocates building clarity before acting, appreciating team efforts, and embracing tolerable imperfection. Manogna also addresses the challenge of not being the expert in senior roles, encouraging curiosity and authenticity over faking expertise. Her principle—leaning into discomfort with determination—offers a roadmap for navigating leadership doubts.

Platform Happiness with Leena Mooneeram

Leena Mooneeram, a platform engineer at Chainalysis, presents a developer’s guide to platform happiness, emphasizing mutual engagement between engineers and platform teams. Viewing platforms as products, Leena suggests three actions: be an early adopter to shape tools and build relationships, contribute by fixing documentation or small bugs, and question considerately with context and urgency details. These steps enhance platform robustness and reduce friction. For instance, early adopters provide critical feedback, while contributions like PRs for typos streamline workflows. Leena’s mutual engagement model fosters collaboration, ensuring platforms empower engineers to build software joyfully and efficiently.

Links:

PostHeaderIcon [OxidizeConf2024] Writing Rust Bindings for ThreadX

Crafting Safe Interfaces for Embedded Systems

In the domain of embedded systems, where reliability and efficiency are paramount, Rust has emerged as a powerful tool for building robust software. At OxidizeConf2024, Sojan James from Acsia Technologies delivered an engaging presentation on creating Rust bindings for ThreadX, a compact real-time operating system (RTOS) tailored for microcontrollers. With nearly two decades of experience in C programming and a passion for Rust since 2018, Sojan shared his journey of developing bindings that bridge ThreadX’s C-based architecture with Rust’s safety guarantees, offering practical strategies for embedded developers.

ThreadX, known for its lightweight footprint and static memory allocation, is widely used in automotive digital cockpits and other resource-constrained environments. Sojan’s goal was to create a safe Rust API over ThreadX’s C interfaces, enabling developers to leverage Rust’s type safety and ownership model. His approach involved generating unsafe bindings, wrapping them in a safe abstraction layer, and building sample applications on an STM32 microcontroller. This process, completed primarily during a week-long Christmas project, demonstrates Rust’s potential to enhance embedded development with minimal overhead.

Strategies for Binding Development

Sojan outlined a systematic approach to developing Rust bindings for ThreadX. The first step was creating unsafe bindings to interface with ThreadX’s C API, using Rust’s foreign function interface (FFI) to call C functions directly. This required careful handling of callbacks and memory management, as ThreadX’s static allocation model aligns well with Rust’s borrow checker. Sojan emphasized the importance of reviewing the generated bindings to identify areas where Rust’s ownership semantics could expose architectural inconsistencies, though he noted ThreadX’s maturity minimized such issues.

To create a safe API, Sojan wrapped the unsafe bindings in Rust structs and enums, introducing a typed channel interface for message passing. For example, he demonstrated a queue of type Event, an enum ensuring type safety at compile time. This approach prevents common errors, such as mixing incompatible data types, enhancing reliability in safety-critical applications like automotive systems. A demo on an STM32 showcased two tasks communicating via a 64-byte queue within a 2KB block pool, highlighting the practical application of these bindings in real-world scenarios.

Future Directions and Community Engagement

While Sojan’s bindings are functional, challenges remain, particularly with ThreadX’s timer callbacks, which lack a context pointer, complicating Rust’s safe abstraction. He plans to address this by exploring alternative callback mechanisms or additional abstractions. The bindings, hosted on GitHub, are open for community contributions, reflecting Sojan’s commitment to collaborative development. At Acsia, Rust is being integrated into automotive platforms, including an R&D project, signaling its growing adoption in the industry.

Sojan’s work underscores Rust’s potential to modernize embedded development, offering memory safety without sacrificing performance. By sharing his code and inviting contributions, he fosters a community-driven approach to refining these bindings. As Rust gains traction in automotive and other embedded domains, Sojan’s strategies provide a blueprint for developers seeking to integrate modern programming paradigms with established RTOS platforms, paving the way for safer, more efficient systems.

Links: