You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-12
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,27 @@ The fast (and dangerous π) node.js FFI library
6
6
7
7
This is an initial Proof of Concept for surfacing all the lower level bindings
8
8
necessary into JS-land so we can generate FFI wrappers from JS itself, without
9
-
any dependencies on third party non-JS libraries like libffi or libtcc.
9
+
any dependencies on third party non-JS libraries like ```libffi``` or ```libtcc```.
10
10
11
-
This should run on node.js current and LTS on Linux/x64. Additions will be made
12
-
shortly to allow building and running on macos/arm64 and Linux/arm64/raspberry pi.
11
+
This should run on [```node.js```](https://nodejs.org) current and LTS on ```Linux x64/arm64``` and ```macos arm64```.
12
+
It has been tested on ```Raspberry Pi 3B+``` which has a ```Cortex A53``` and works fine there.
13
+
It will also probably work on older versions of ```node.js``` but will need to be
14
+
rebuilt for older versions of V8 that ```node.js``` embeds. Please report on issues
15
+
you find.
13
16
14
-
It should also be possible to do the same on Windows and other platforms. It's will
15
-
*just* be a matter of implementing the assembler for the small subset of instructions
16
-
required to wrap standard C function calls and implementing the calling conventions
17
-
for the different OS's.
17
+
It currently supports (with bugs and pretty much zero safety) passing any ```integer```
18
+
types, ```strings``` and ```pointers```. float support and struct passing will be coming a
19
+
little later. There are benchmarks coming soon that will show how to do callbacks
20
+
from ```C/C++``` to ```JS``` too.
21
+
22
+
It should be pretty easy to add a lot of libraries to this using the [bindings
23
+
definitions](https://github.com/just-js/lo/tree/main/lib) that already exist for the [lo](https://github.com/just-js/lo) runtime. It should also be possible to
24
+
run this on [```Bun```](https://bun.sh) if there is some work done on Bun side to add symbols for the
25
+
V8 fastcall api's (which won't have any effect on Bun/JSC).
26
+
27
+
Windows support should not be a lot of work (famous last words!).
28
+
29
+
Right now assumption is 64-bit platforms only.
18
30
19
31
πππ Beware! πππ
20
32
There are many dragons here. This is surfacing a lot of dangerous things
@@ -29,13 +41,12 @@ we add have on the baseline implementation.
0 commit comments