FFI is an experimental extension that allows us to use an external library (.so or .dll), without creating an extension…