GSoC 2026 - Question about C++ features in FFIgen project

130 views
Skip to first unread message

Helana saif

unread,
Feb 21, 2026, 10:58:30 AMFeb 21
to dart-gsoc
Hello! I'm Helana, and I’m very interested in contributing to the FFIgen project.

I'l keep this brief: 

In the project description, it is mentioned that: "The more language features we can translate, the better the final product will be." 

From your perspective, which C++ features do you consider essential or must-have beyond the obvious basics ones? A rough priority overview of the features would be enormously helpful. 

Kind regards,
Helana

Liam Appelbe

unread,
Feb 23, 2026, 7:43:23 PMFeb 23
to dart-gsoc
Hi Helena,

Some ideas to get you started, but I've probably forgotten some C++ features:
  • Classes and methods would be the top priority. Then probably the inheritance hierarchy.
  • Make sure to consider memory management. Eg, how should we handle APIs that contain std::unique_ptr/shared_ptr? How do these interact with Dart's GC? Maybe we need special wrappers for these, using finalizers to clean up the references? What about functions/methods that pass classes by value? It will probably also be important to detect whether a class/struct is POD (plain-old-data: no custom constructor/destructor, no virtual functions, no base classes, all fields also POD).
  • Namespaces are also high priority. How can we translate those to Dart?
  • Translating C++ templates to Dart generics will be important, but difficult, since there's probably a lot of semantic differences to work around. The config format will need a way of instantiating the templates for specific concrete types, since C++ templates are not compiled into the final binary unless you ask for specific instantiation. This is probably out of scope for the GSoC project, but we can start thinking about it now.
  • Translating STL types to corresponding Dart types will also be a big but important job. Notably the collection types, and std::function. To make this a fully polished project we'll probably need a helper library like package:objective_c/package:jni that contains Darty looking wrappers around the C++ collections, but that's way out of scope for the GSoC project.
  • Operator overloads are lower priority, but nice to have and should be pretty easy once we have classes and methods.
  • C++ exceptions are very low priority, because in my experience they are rarely used in practice.
Thanks,
Liam
Reply all
Reply to author
Forward
0 new messages