Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Dart VM gets C/C++ extensions

Posted by Seth Ladd

We just published "Native Extensions for the Standalone Dart VM", a new article from Dart engineer William Hesse. Bill shows you how to take your existing C/C++ code and expose it to Dart libraries via the Dart virtual machine.

A preview from the article:

"You can provide two types of native extensions: asynchronous or synchronous. An asynchronous extension runs a native function on a separate thread, scheduled by the Dart VM. A synchronous extension uses the Dart virtual machine library’s C API (the Dart Embedding API) directly and runs on the same thread as the Dart isolate. An asynchronous function is called by sending a message to a Dart port, receiving the response on a reply port."

We look forward to your feedback. Please join the Dart mailing list and share your experiences and code. Thanks for using Dart!