[docs] Clean up GSoC CppGen proposal

Move the flow chart to a more related place in the text, and remove
spurious backslashes.

Change-Id: Ifdfb15d185841da7b4b84b555f867cdc74e0d41a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479200
Auto-Submit: Liam Appelbe <liama@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Liam Appelbe
2026-02-08 22:57:01 -08:00
committed by Commit Queue
parent 2308a15e09
commit 2076ac5df0
+5 -5
View File
@@ -106,12 +106,12 @@ developers to inspect the contents of `Pointer`s safely during debugging.
C++ doesn't have a stable ABI (for example, it varies by compiler), so we can't directly interop with it. However, it would be possible to parse a C++ API, code-gen C compatible bindings for the API (using `extern "C"`), then generate Dart bindings that look like the C++ API, but actually invoke the C glue code.
The goal of this project is to add C++ as a new experimental language in FFIgen. FFIgen already uses libclang to parse C/ObjC APIs, so the parsing logic just needs to be extended to parse C++ APIs. Then the AST needs to be extended to be able to represent C++ language features. Finally, the code generator needs to be extended to support generating C code to wrap the C++ API, and Dart code to interact with the C API.
```
Input Output Output
C++ API <-> C glue code <-> Dart bindings
```
```
Input Output Output
C++ API \<-\> C glue code \<-\> Dart bindings
```
The goal of this project is to add C++ as a new experimental language in FFIgen. FFIgen already uses libclang to parse C/ObjC APIs, so the parsing logic just needs to be extended to parse C++ APIs. Then the AST needs to be extended to be able to represent C++ language features. Finally, the code generator needs to be extended to support generating C code to wrap the C++ API, and Dart code to interact with the C API.
A good proposal for this project will explore the various language features of C++, describe how that feature can be most closely represented in Dart, and what the C glue code looks like to support that feature. The more language features we can translate, the better the final product will be.