FFI (Foreign Function Interface) call compilation and runtime behavior.
Raw Developer Origin & Technical Request
GitHub Issue
Jul 27, 2026
### Summary
An `--ffi` bound call is silently dropped when its result initializes a local that is never reassigned. The build succeeds with no diagnostic and the program dies at load with `Uncaught ReferenceError: is not defined`.
The trigger is **single assignment**, not the `const` keyword.
### Repro
`native.c`
```c
double sg_f64(double v) { return v * 2.0; }
```
`ffi.json`
```json
{
"ffi_format": 1,
"functions": [
{ "name": "sgF64", "symbol": "sg_f64", "params": ["f64"], "returns": "f64" }
],
"libraries": ["./libnative.a"],
"system_libraries": []
}
```
`main.ts`
```ts
declare function sgF64(v: number): number;
function main(): void {
const viaConst = sgF64(21);
console.log(`const: ${viaConst}`);
}
main();
```
```console
$ clang -O2 -c native.c -o native.o && ar rcs libnative.a native.o
$ scriptc build main.ts --ffi ffi.json -o repro
$ ./repro
Uncaught ReferenceError: sgF64 is not defined
```
Expected `const: 42`. Note nothing prints at all: the failure is at load, not at the statement.
### What works and what doesn't
```ts
let a = sgF64(21); console.log(a); // FAILS
const a = sgF64(21); console.log(a); // FAILS
let a = sgF64(21); a += 1; console.log(a); // works
console.log(sgF64(21)); // works (no binding)
function f(v: number) { return sgF64(v); } // works (no binding)
const o = { v: sgF64(5) }; console.log(o.v); // works
let s = 0; s += sgF64(7); // works
```
Making th...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from vercel-labs/scriptc.
Frequently Asked Questions
Market intelligence mapped to FFI (Foreign Function Interface) call compilation and runtime behavior..
What is the technical positioning of FFI (Foreign Function Interface) call compilation and runtime behavior.?
What are the foundational technologies related to FFI (Foreign Function Interface) call compilation and runtime behavior.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like silently dropped and main.ts by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics