Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ API #71

Closed
davidzchen opened this issue Sep 16, 2015 · 1 comment
Closed

C++ API #71

davidzchen opened this issue Sep 16, 2015 · 1 comment
Assignees

Comments

@davidzchen
Copy link
Contributor

While Jsonnet is written in C++, the core API it exposes is a C API. It would be nice to have a proper C++ API as well.

@davidzchen
Copy link
Contributor Author

I opened this because it would give me a better idea of what the Java API should look like (see #64).

A few ideas I had in mind for the C++ API are:

  • Simpler interface for returning output strings for _multi APIs, such as std::vector<std::string>.
  • Using std::function for the import callback
  • Using std::string instead of char*

Here is what I have so far: https://github.com/davidzchen/jsonnet/blob/cpp/cpp/jsonnet.h

Currently, this is just a wrapper around the libjsonnet C API. In the future, it might be nice to refactor some of the implementation details in libjsonnet.c for evaluating Jsonnet files/snippets and move them into the core C++ implementation.

@davidzchen davidzchen self-assigned this Oct 15, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 20, 2015
* Refactor common implementation details from libjsonnet.cpp into vm.
* Both C and C++ implementations are now thin wrappers on top of the
  low-level Vm API.
* Rearrange dependencies in BUILD file.

Fixes google#71
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 20, 2015
* Refactor common implementation details from libjsonnet.cpp into vm.
* Both C and C++ implementations are now thin wrappers on top of the
  low-level Vm API.
* Clean up library targets in BUILD file.
* Add simple tests for C++ wrappers.

Fixes google#71
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 20, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 20, 2015
@davidzchen davidzchen mentioned this issue Oct 20, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 21, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Oct 23, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Nov 17, 2015
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Feb 12, 2016
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Mar 14, 2016
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Mar 15, 2016
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Mar 15, 2016
This change also adds an external dependency for gmock to the Bazel
build, which is used by the C++ library's unit test.

Issue google#71
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Mar 15, 2016
This change also adds an external dependency for gmock to the Bazel
build, which is used by the C++ library's unit test.

Issue google#71
davidzchen added a commit to davidzchen/jsonnet that referenced this issue Mar 15, 2016
This change also adds an external dependency for gmock to the Bazel
build, which is used by the C++ library's unit test.

Issue google#71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants