Does Dart support interfacing with the native libraries?
Asked Answered
D

1

6

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)?

Diffluent answered 23/5, 2013 at 2:44 Comment(3)
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"Paries
Sorry, how do I get back the old one and add an EDIT?Diffluent
I moved what I was planning to add as an EDIT, to a a new question.Diffluent
P
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.

Paries answered 23/5, 2013 at 2:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.