Questions tagged [dart-native-extension]

24 questions
7
votes
1 answer

Why native wrapped functions in Dart are such heavyweight in comparison with "DEFINE NATIVE ENTRY" functions that are very lightweight?

I cannot understand: "Why this reassurance?". This is wrapper for custom native function from dart/runtime/vm/native_entry.cc: It intended for the Dart programmers that want write native extensions. void…
mezoni
  • 10,684
  • 4
  • 32
  • 54
6
votes
1 answer

Does Dart support interfacing with the native libraries?

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)?
Salil
  • 9,534
  • 9
  • 42
  • 56
5
votes
2 answers

Native extensions - C++ native libraries

The samples_extension works OK with C library linkage but what about C++ libraries? I have a class based C++ library I want to use as a native extension, so we have for example:- class Connect { open(...); .... } in C++ and I want a…
user2685314
  • 1,059
  • 6
  • 9
5
votes
1 answer

Can Dart be used as a general-purpose language?

Dart supports interfacing with the native libraries (Ref: http://www.dartlang.org/articles/native-extensions-for-standalone-dart-vm/). There are some decent libraries available for socket communication, interfacing with databases and dealing with…
Salil
  • 9,534
  • 9
  • 42
  • 56
3
votes
1 answer

Invoke constructor with named arguments via dart_api.h calls

I am trying to invoke the const Duration constructor from a Dart native extension. How would I use the Dart_New C function to invoke this constructor? I've tried just invoking it like any other Dart_New call but I get an Incorrect number of…
Austin Cummings
  • 770
  • 1
  • 8
  • 15
3
votes
1 answer

Dart: How to create stream in native extension

In my native extension I need to stream ints to my Dart console apps. Very similar in concept to stdin. How do I create a native Dart Stream object which is exposed to console app?
George Aslanis
  • 517
  • 4
  • 11
3
votes
1 answer

Is it possible to call Dart method from C++?

How to call Dart method from C++ code? I want to try use Dart as scripting language in my application.
crashtua
  • 33
  • 1
  • 3
2
votes
1 answer

Does the dart VM impose restrictions on the stack memory size of a native extension?

I'm learning to write a native extension and I noticed an odd occurrence. When I allocate a multidimensional array and access it like so: (excuse any messy C code and bad practices I might be using unless they're likely the cause of my error. My C…
kjh
  • 3,407
  • 8
  • 42
  • 79
2
votes
1 answer

Dart native extension: How to create "Push" data stream

I'll refer conceptually to "Pushed" vs "Polled" streams to help describe my question's objective which is to "*Create a Pushed data stream emulating the data flow behavior of Dart's stdin stream*" "Polled": In my previous question, Menzoni's answer…
George Aslanis
  • 517
  • 4
  • 11
2
votes
1 answer

Prevent access to certain libraries in dart

Is there a way to prevent access to certain libraries in dart? The reason why is I want to allow a scripting language in my application. It looked like dart would make that easy, by just limiting what libraries one could import and defining my own…
LordZardeck
  • 7,953
  • 19
  • 62
  • 119
2
votes
1 answer

What means exit code 139 in Dart console application?

Console program written in Dart that invoke native function exit with code 139. Dart VM does not display error messages. What happened? Where I can find documentation about exit code 139? Why not displayed stack trace of Dart VM code? P.S. I…
mezoni
  • 10,684
  • 4
  • 32
  • 54
1
vote
1 answer

How to handle integers too large for uint64_t in a synchronous Dart native extension?

When the user passes a number larger than 2^64 - 1 to a native function then the integer can't fit into a unit64_t. What is the simplest way to write a synchronous native extension that can handle integers of arbitrarily large size? Since it…
kjh
  • 3,407
  • 8
  • 42
  • 79
1
vote
2 answers

How do you link external shared libraries to a native extension?

I'm writing a pty native extension and want to link libutil so that I may use forkpty and openpty from . I'm using the two commands taken from the official guide: g++ -fPIC -lutil -I/home/crunchex/work/dart-sdk -c pty.cc -o pty.o gcc -shared…
Crunchex
  • 307
  • 2
  • 10
1
vote
1 answer

How do you convert a Dart_Handle List to a C++ array?

I'm trying to port over a node.js native abstraction to dart as a native extension. The node.js nan also happens to be using the v8 namespace, which I'm not terribly familiar with. The [incomplete] code snippet in particular that I'm having trouble…
Crunchex
  • 307
  • 2
  • 10
1
vote
0 answers

how to use dart odbc with mariadb 10.1 on linux

Has anybody managed to make use of the odbc library on linux / ubuntu 14.04 with the odbc driver for mariadb 10.1? After install from pub and running a test case, I get the error Cannot find extension library'package:odbc/odbc.dart': error: line 25…
Dr. Dama
  • 167
  • 2
  • 5
1
2