Skip to content

Commit d137066

Browse files
committed
Add some details
1 parent cd42eb0 commit d137066

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

doc/core/moving-to-c++.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ ctiller, markdroth, vjpai
66

77
## Background and Goal
88

9-
gRPC core was originally written in C89 for several reasons (possibility of
10-
kernel integration, ease of wrapping, compiler support, etc). Over time, this
11-
was changed to C99 as all relevant compilers in active use came to support C99
12-
effectively. Now, gRPC core is C++ (although the code is still idiomatically C
13-
code) with C linkage for public functions. Throughout all of these transitions,
14-
the public header files are committed to remain in C89.
15-
16-
The goal now is to make gRPC core true idiomatic C++ compatible with
9+
gRPC core was originally written in C89 for several reasons
10+
(possibility of kernel integration, ease of wrapping, compiler
11+
support, etc). Over time, this was changed to C99 as all relevant
12+
compilers in active use came to support C99 effectively.
13+
[Now, gRPC core is C++](https://github.com/grpc/proposal/blob/master/L6-allow-c%2B%2B-in-grpc-core.md)
14+
(although the code is still idiomatically C code) with C linkage for
15+
public functions. Throughout all of these transitions, the public
16+
header files are committed to remain in C89.
17+
18+
The goal now is to make the gRPC core implementation true idiomatic
19+
C++ compatible with
1720
[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).
1821

1922
## Constraints
@@ -48,7 +51,10 @@ The goal now is to make gRPC core true idiomatic C++ compatible with
4851

4952
## Implications for C++ API and wrapped languages
5053

51-
- For C++ structs, switch to `using` when possible (e.g., Slice, ByteBuffer, ...)
54+
- For C++ structs, switch to `using` when possible (e.g., Slice,
55+
ByteBuffer, ...)
56+
- The C++ API implementation might directly start using
57+
`grpc_transport_stream_op_batch` rather than the core surface `grpc_op`.
5258
- Can we get wrapped languages to a point where we can statically link C++? This will take a year in probability but that would allow the use of `std::`
5359
- Are there other environments that don't support std library, like maybe Android NDK?
5460
- Probably, that might push things out to 18 months

tools/doxygen/Doxyfile.core

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ doc/connection-backoff-interop-test-description.md \
772772
doc/connection-backoff.md \
773773
doc/connectivity-semantics-and-api.md \
774774
doc/core/grpc-error.md \
775+
doc/core/moving-to-c++.md \
775776
doc/core/pending_api_cleanups.md \
776777
doc/cpp-style-guide.md \
777778
doc/environment_variables.md \

tools/doxygen/Doxyfile.core.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ doc/connection-backoff-interop-test-description.md \
772772
doc/connection-backoff.md \
773773
doc/connectivity-semantics-and-api.md \
774774
doc/core/grpc-error.md \
775+
doc/core/moving-to-c++.md \
775776
doc/core/pending_api_cleanups.md \
776777
doc/cpp-style-guide.md \
777778
doc/environment_variables.md \

0 commit comments

Comments
 (0)