As the server-side part becomes more complex, developers will need to leverage the existing software. So, does Dart support interfacing with the native libraries (C libraries, in particular)?
Asked
Active
Viewed 2,938 times
6
-
You just completely changed your question. It was originally about "whether or not it is possible to interface", after I added my answer you change it to "it's possible to interface, is it worth learning" – Benjamin Gruenbaum May 23 '13 at 02:49
-
Sorry, how do I get back the old one and add an EDIT? – Salil May 23 '13 at 02:49
-
I moved what I was planning to add as an EDIT, to a a new question. – Salil May 23 '13 at 03:05
1 Answers
6
Yes, it is quite possible, here is the official guide.
Dart programs running on the standalone Dart VM (command-line apps) can call C or C++ functions in a shared library, by means of native extensions. This article shows how to write and build such native extensions on Windows, Mac OS X, and Linux.
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.

Community
- 1
- 1

Benjamin Gruenbaum
- 270,886
- 87
- 504
- 504