V programming language FFI bridge for Deno.
v-deno provides seamless FFI integration between Deno and the V programming language. Write performance-critical code in V, call it from Deno with full type safety.
┌─────────────────┐ ┌─────────────────┐
│ Deno │ FFI │ V Library │
│ TypeScript │◄───────►│ (.so/.dll) │
└─────────────────┘ dlopen └─────────────────┘V compiles to C, producing shared libraries with C ABI. Deno’s Deno.dlopen() loads these libraries directly.
// math.v
module math
@[export: 'add']
pub fn add(a int, b int) int {
return a + b
}
@[export: 'factorial']
pub fn factorial(n int) int {
if n <= 1 { return 1 }
return n * factorial(n - 1)
}-
Type-Safe Bindings — Generate TypeScript types from V signatures
-
Callback Support — Pass Deno functions to V code
-
Memory Management — Safe handling of V strings and arrays
-
Build Integration — Compile V libraries from Deno
-
Cross-Platform — Windows, macOS, Linux support
import { VLibrary, VCallback } from "v-deno";
const lib = await VLibrary.load("./libprocessor.so", {
process_with_callback: {
parameters: ["pointer", "i32"],
result: "void"
}
});
const callback = VCallback.create((value: number) => {
console.log("V called back with:", value);
}, { parameters: ["i32"], result: "void" });
lib.process_with_callback(callback.pointer, 100);-
v0.1 — Basic FFI wrapper, type mappings
-
v0.2 — Callback support, memory utilities
-
v0.3 — Build integration (compile V from Deno)
-
v1.0 — Type generation, full V stdlib bindings
-
Fast compilation — V compiles in <1 second
-
Simple syntax — Easy to learn, C-like
-
No dependencies — Self-contained binaries
-
C interop — Native C ABI output