Skip to content

[doc/ffi] More actively push package:ffigen? #54505

Open
@dcharkes

Description

@dcharkes

Should we consider pushing FFIgen more actively?

FFIgen completely removes the need to write bindings by hand. This makes it much easier for users to (1) satisfy all the custom static checks, and (2) get the C types right, avoiding segfaults at runtime.

First, we could add a link package:ffigen from all analyzer/CFE error messages that give type mismatch errors in the FFI.
We do already mention FFIgen in https://dart.dev/interop/c-interop#generating-ffi-bindings-with-packageffigen, and error messages link to that documentation page. But the documentation is quite far down.

Secondly, we should maybe have a dart create ffi_package or something that has a setup with FFIgen from the get go.

Thoughts? @mraleph @mkustermann @mit-mit @liamappelbe @HosseinYousefi

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-documentationPrefer using 'type-documentation' and a specific area label.library-ffi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions