Proposed by: Tanishq Singla
FFI: Powers of other programming languages in your hands
I'll be presenting a short talk introducing the concepts of FFI
My talk would cover the following topics and provides basic demos to get started with FFI, not in detail since the talk could take a very long time.
1. FFI: Powers of other programming languages in Javascript
Foreign Function Interface abbreviated as FFI is a mechanism that allows your program to open shared libraries and use the functions.
To nodejs developers this may sound like a new concept because node.js failed to provide a good support to allow developers tot use shared libraries. However with the introduction of Bun.js a new javascript runtime this changes, and we have far better support to use these libraries.
Many programming languages can be compiled to shared libraries and FFI enables us to load those shared libraries in our javascript code.
2. What are shared libraries?
Shared libraries also commonly known as Dynamic Link Libraries (DLLs) are libraries which can be loaded dynamically in your code. Shared libraries are not a new concept and many applications distribute their libraries into shared libraries.
Shared libraries helps you
- Keep a low memory footprint
- Prevent executables to have a large file size
- Optimize load times
3. Simple demos
These demos includes
- Hello World program
- Examples showing some caveats due to data type restrictions
- A simple parser to parse metadata of a markdown file to return JSON data.
Source code/Reference: https://bun.sh/docs/api/ffi
Talk duration: