New issue
Advanced search Search tips

Issue 815335 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Mojo C bindings

Project Member Reported by roc...@chromium.org, Feb 23 2018

Issue description

The bindings generator should support outputting C-only bindings for Mojo IPC so that mojoms can be used from external repositories without rolling dependencies on //base or other Chrome sources.
 

Comment 1 by roc...@chromium.org, Feb 23 2018

Probably worth elaborating a bit more.

An alternative might be to have a different C++ generation mode which still outputs reasonably ergonomic C++ bindings but with no //base dependencies.

The significant base dependencies in Mojo C++ bindings today are:

  - callback
  - task scheduling
  - synchronization primitives
  - ref counting

With the exception of task scheduling code these things could trivially be (as they once were) implemented with one-off duplicates inside mojo/public/cpp, but that does not seem desirable to me.

With C bindings we abandon most of the opinionated ergonomics and instead leave consumers to work out how they want to encapsulate asynchronous behavior, scoping, type-safety, synchronization, etc. This is probably the right trade-off to make for any externally facing library we intend to support.

Comment 2 by roc...@chromium.org, Mar 12 2018

Labels: -Pri-2 Pri-3
For posterity: I still think we should probably do this someday, but given that we'll likely snapshot //base for C++ bindings, C is not a very high priority.
Owner: rockot@google.com

Sign in to add a comment