1,883 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
102
views
How to import a Haskell function in Python
I cannot fix this error. build.sh is trying to create a shared library but it fails:
~/Desktop/deepseek$ ./build.sh
Building Haskell shared library...
Loaded package environment from /home/success/....
Tooling
0
votes
0
replies
43
views
Create a runtime location for a dynamic library using the nim FFI
Is it possible to define the dynamic library location for an FFI at runtime?
I have successfully generated an FFI for SFCGAL using toast in the nim programming context, but struggled a bit with the ...
Advice
1
vote
1
replies
131
views
Is it possible to embed a Ruby interpreter in a Flutter app?
I see that it is supposed to be possible to embed a Python interpreter in a Flutter app, so can I assume it should therefore also be possible to do this with a Ruby interpreter? (I would be happy ...
4
votes
1
answer
158
views
How to pass array from Rust to FFI and free the memory properly
I want to pass byte array to FFI in Rust.
The allocation and deallocation should all be done in Rust.
Here is my implementation.
#[unsafe(no_mangle)]
pub extern "C" fn get_data(ptr: *mut *...
3
votes
1
answer
223
views
Java FFM - Unexpected behavior with "pointers" [duplicate]
To try out the Java 25 FFM API, I wanted to call C++ code through a C wrapper.
To do that, I created a small C++ class and a C wrapper following an example from here.
Printer.h
#pragma once
#include &...
0
votes
0
answers
39
views
When do i have to use guile dynamic wind functions in a C written library
I wanted to write a library in C to then link into Guile and in it i have to deal with strings. In the Guile manual the scm_to_locale_string() function has the following documentation:
Returns a C ...
0
votes
1
answer
55
views
Convert Vect AnyPtr to C Array (AnyPtr) in Idris 2
I am writing bindings for the Z3 solver library for Idris, but have gotten stuck because I can't seem to find a way to pass a Vect AnyPtr to a Z3 function (in this case, Z3_mk_and with signature ...
0
votes
1
answer
38
views
How to get printer names using koffi and WinApi function EnumPrintersW?
How to read printerStruct.pPrinterName using koffi?
const koffi = require('koffi');
const winspool = koffi.load('winspool.drv');
const kernel32 = koffi.load('kernel32.dll');
const PRINTER_ENUM_LOCAL ...
0
votes
0
answers
123
views
How to make the app State with C++ and Flutter (FFI)
I'm trying to learn c++ by making an app using C++ for the backend (I want to have all the data and logic here), Flutter for the frontend (UI conneted to C++ backend via FFI (so I can call C++ ...
2
votes
0
answers
80
views
How to version FFI crates if source does not use semantic versioning?
Lets say there is a libfoo C library with matching headers. Documentation of bindgen suggests libfoo-sys crate should build dynamically on the client side, using their installed header versions. The ...
0
votes
0
answers
107
views
JNI is not working correctly in flutter:ffi
I'm trying to call the function through the environment variable env, namely env->FindClass("android/os/BatteryManager"), but eventually the error
F/libc (27883): Fatal signal 11 (...
0
votes
0
answers
47
views
Question about how ffi-napi's async() works
I have a DLL that I built from C code. The DLL continuously runs a while loop that calls a JavaScript callback function every 3 seconds using sleep().
In my Electron project, I’m using the ffi-napi ...
-3
votes
1
answer
173
views
Is it sound to use a slice of numpy::PyReadonlyArray inside pyo3::allow_threads()?
My goal is to implement an efficient (and safe) way to wrap a Rust function, using numpy::PyReadonlyArray, with zero-copy and GIL release during computation.
My question is general, but here is a ...
0
votes
1
answer
137
views
Rust Linker is not finding included FFI library during cucumber test compile
So we have a cucumber test crate that tests an FFI crate.
We include the FFI library in the cargo.toml file with :
ffi_lib = { path = "../base/ffi_lib" }
Then its linked into the code via:
#...
2
votes
1
answer
228
views
Failing to link static libraries during Rust unit testing [closed]
I have been working on this simple example. This entire project is being compiled on a (Linux AArch64) Raspberry Pi 3B.
Say I have a simple assembly function (that does SIMD addition on AArch64) ...