You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/core/moving-to-c++.md
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,17 @@ ctiller, markdroth, vjpai
6
6
7
7
## Background and Goal
8
8
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
17
20
[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html).
18
21
19
22
## Constraints
@@ -48,7 +51,10 @@ The goal now is to make gRPC core true idiomatic C++ compatible with
48
51
49
52
## Implications for C++ API and wrapped languages
50
53
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`.
52
58
- 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::`
53
59
- Are there other environments that don't support std library, like maybe Android NDK?
54
60
- Probably, that might push things out to 18 months
0 commit comments