{"id":13690975,"url":"https://github.com/kxsystems/ffi","last_synced_at":"2025-07-19T06:36:19.791Z","repository":{"id":26743806,"uuid":"108527319","full_name":"KxSystems/ffi","owner":"KxSystems","description":"FFI for kdb+","archived":false,"fork":false,"pushed_at":"2025-06-04T19:33:01.000Z","size":509,"stargazers_count":31,"open_issues_count":0,"forks_count":16,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-18T14:55:59.630Z","etag":null,"topics":["ffi","interface","kdb","q"],"latest_commit_sha":null,"homepage":"https://code.kx.com/q/interfaces","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KxSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-27T09:33:44.000Z","updated_at":"2025-06-04T19:33:03.000Z","dependencies_parsed_at":"2025-04-12T21:28:22.071Z","dependency_job_id":"34237aaf-1ef2-4606-94a2-87125ac2c41a","html_url":"https://github.com/KxSystems/ffi","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/KxSystems/ffi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KxSystems","download_url":"https://codeload.github.com/KxSystems/ffi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fffi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265898321,"owners_count":23845773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffi","interface","kdb","q"],"created_at":"2024-08-02T17:00:37.906Z","updated_at":"2025-07-19T06:36:19.770Z","avatar_url":"https://github.com/KxSystems.png","language":"C","funding_links":[],"categories":[":fireworks: Fusion interfaces"],"sub_categories":[],"readme":"# FFI for kdb+\n\nFFI (foreign function interface) is a mechanism by which a program written in one programming language can call routines or make use of services written in another. Some programs may not know at the time of compilation what arguments are to be passed to a function. For instance, an interpreter may be told at run-time about the number and types of arguments used to call a given function. Libffi can be used in such programs to provide a bridge from the interpreter program to compiled code.\n\n`ffikdb` is an extension to kdb+ for loading and calling dynamic libraries using pure `q`. \n\nThe main purpose of the library is to build stable interfaces on top of external libraries, or to interact with the operating system from `q`. No compiler toolchain or writing C/C++ code is required to use this library.\n\nYou don't need to write C code, but you do need to know what you are doing. You can easily crash the kdb+ process or corrupt in-memory data structures with no hope of finding out what happened. For example, when q callback function is passed to foreign function and the q function failed, user might be able to see error message in console but as the foreign function cannot handle q error, the execution crashes and leads to entire application crash. Or if user passed valid but wrong tye characters to q callback, interna conversion failure of q cannot be handed and application crashes without any error message.\n\nNo support is offered for crashes caused by use of this library.\n\nWe are grateful to @abalkin for allowing us to adapt and expand on his original codebase. \n\n## Installation Documentation\n\n:point_right: [`Install guide`](docs/install.md)\n\n## API Documentation\n\n:point_right: [`API reference`](docs/reference.md)\n\n## Examples\n\n:point_right: [`Example guide`](docs/examples.md)\n\n## Status\n\nThe FFI interface is provided here under an Apache 2.0 license.\n\nIf you find issues with the interface or have feature requests please consider raising an issue [here](https://github.com/KxSystems/ffi/issues).\n\nIf you wish to contribute to this project please follow the contributing guide [here](https://github.com/KxSystems/ffi/blob/master/CONTRIBUTING.md).\n\n## Unsupported Functionality\n\nForeign functions taking a struct do not work properly (can cause crash). For example, a function taking `K` pointer does not work.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkxsystems%2Fffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fffi/lists"}