Paul Krill
Editor at Large

Dart language upgrade shines on Wasm, generative AI

news
Feb 16, 20242 mins
Generative AIJavaScriptMobile Development

Dart 3.3 lays the groundwork for compiling Flutter apps to WebAssembly, while new SDK integrates Gemini API for building AI features into apps.

10 targeted training bullseye
Credit: do not use

Dart 3.3, the latest update to Googleโ€™s programming language for building mobile, desktop, and web applications, has arrived, bringing experimental support for web applications compiled to WebAssembly. Google also released an SDK for building generative AI capabilities into Dart and Flutter apps.

Dart 3.3 was launched February 15. Instructions on downloading the Dart SDK can be found at dart.dev. Dart powers the Flutter framework for multi-platform UI development.

Dart 3.3 allows application and package authors to begin laying the groundwork for web applications compiled to WebAssembly. While WebAssembly support in Flutter Web remains experimental, the team is working to stabilize the implementation. To run Flutter applications on the web using WebAssembly, developers must migrate all code, from the application to dependencies, to use a new JavaScript interop mechanism in Dart and package:web. The Dart team has provided a migration guide to help developers start using WebAssembly.

Alongside Dart 3.3, Google introduced the Google AI Dart SDK, which allows developers to build generative AI features into their Dart or Flutter apps using the Gemini API. Gemini is Googleโ€™s largest and most general generative AI model, capable of processing information from both images and text. Developers can read up on using the Google AI Dart SDK via a quickstart guide.

Dart 3.3 also debuts a new model for interoperating with JavaScript libraries. (Dart once was positioned as a rival to JavaScript.) A new set of APIs for interacting with JavaScript, the dart:js_interop library, include a typed API, which defines the boundary between the two languages with static enforcement. This eliminates a class of issues before compile time, Google said. Additionally, Dart now includes a new model for representing JavaScript types in Dart using extension types.

Extension types in Dart 3.3 introduce zero-cost wrappers for types. Developers can use extension types to optimize performance-sensitive code, especially when interoperating with host platforms. Extension types provide the convenience of custom types with unique members while eliminating wrapper allocation overhead. Thus native types can be used directly without the cost of creating wrappers and the associated indirection, Google said.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorldโ€™s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorldโ€™s audience of software developers and other information technology professionals. Paul has won a โ€œBest Technology News Coverageโ€ award from IDG.

More from this author