Commit e9eec312

e9eec312f2abMerged

Richard Ramsden <[email protected]> · 6 months ago · 2 files · +1 added · ~1 modified

Description

docs: add FFI specification + README pointer

Full DSL reference, type table, pointer/GC semantics, link-flag plumbing, and limitations under docs/FFI.md. README.md gains a short FFI paragraph in the Supported Ruby Features section that points readers at the spec and the example demos.

Details

Commit
e9eec312f2ab
Parent
84f4d089668c

README.mdmodifiedView file

@@ -209,6 +209,15 @@
209209 **I/O**: `puts`, `print`, `printf`, `p`, `gets`, `ARGV`, `ENV[]`,
210210 `File.read/write/open` (with blocks), `system()`, backtick.
211211
212+**FFI**: Direct C calls without an extension compiler. Declarations
213+(`ffi_func`, `ffi_lib`, `ffi_const`, `ffi_buffer`, `ffi_read_*`) live
214+inside a `module` body; the codegen emits externs and the `spinel`
215+wrapper picks up `-l` flags from marker comments. Scalars, strings,
216+opaque `:ptr`, integer constants, raw byte buffers, and struct-field
217+reads are covered. See [docs/FFI.md](docs/FFI.md) for the full spec
218+and [examples/ffi/](examples/ffi/) for runnable demos against libc/
219+libm and sqlite3.
220+
212221 ## Optimizations
213222
214223 Whole-program type inference drives several compile-time optimizations: