Comments (6)
It is preferable to have only one implementation being maintained. The current version should be good enough to use instead of the C++ version for the vast majority of people. There are some remaining questions about performance, it is possible these are innate to Go, but maybe also we can streamline the Go implementation to narrow the gap. Also, we could invest in more high level optimizations (like Jsonnet code transformations) that would close the gap in different areas.
Another question is how to convert it to Javascript. I experimented with gopherjs which seemed to work ok but I didn't try to stress it. I'm not sure it can handle deeply recursive Jsonnet programs. The bar is low though, because the existing empscripten Javascript build is not very good either.
I agree that the Go version should be preferable, but it may be a while before we can deprecate the C++ version.
from go-jsonnet.
May I ask what "Jsonnet code transformations" is ?
from go-jsonnet.
Things like hoisting locals out of loops / objects if possible. Maybe constant propagation, that kind of thing.
edit: also inlining
from go-jsonnet.
Does anyone have numbers for the current performance delta? What would be the preconditions for fully switching development to Go? I would much prefer to contribute to a single implementation than two, and would prefer it to be Go.
Of course, one issue might be Python integration.
from go-jsonnet.
Some things we should do before considering go version official off the top of my head.
-
We need a common, unified test suite of e2e tests. Currently it's possible to run Go version on C++ tests, but not the other way around. Ideally it would be just one unified suite (in a separate repo?).
-
Include some benchmarks in this test suite.
-
Make performance a bit better. The performance is varying a lot and my hypotheses about why were proven wrong multiple times by the experiments. For example this program:
std.foldl(function(x, y) x + y, std.range(1, 100000), 0)
is 4x faster in C++ jsonnet. But to seriously work on performance we need a standard set of benchmarks.
That said, there's some low hanging fruit that can be worked on right away. For example builtin implementations for functions in stdlib.
-
Compatible C bindings - libjsonnet. This lets us keep bindings to other languages. Python bindings will not be a problem, as a matter of fact, Python is used to test the partial implementation of C bindings that we currently have (
compat_test/compat_test.py
). -
Some cleanup - making sure the right things are exported etc.
from go-jsonnet.
I think the question was answered and we can close this. We are still going in this direction (e.g. recently we reached full compatibility with C api).
from go-jsonnet.
Related Issues (20)
- inconsistent/invalid parsing behavior on block strings HOT 12
- Unable to find valid certification path to requested target while running bazel test
- Is `v0.20.0` the latest release? HOT 2
- add unit tests for `add_plus_object.go , enforce_comment_style.go and enforce_max_blanck_lines.go` HOT 1
- jsonnet-lint missing std.all and std.any
- jsonnet-lint missing std.reverse
- jsonnet-lint missing std.objectKeysValues HOT 1
- parseYaml panics when passed empty string
- gazelle naming convention changes
- Decimal number displayed differently
- Need help building the c-bindings
- jsonnetfmt cli tool could support a canonical mode
- [Question] Parser package, children function
- std.splitLimitR is missing from go-jsonnet
- Support for stdlib context (cancellation / timeouts)
- Concurrency safe `FileImporter` HOT 6
- Interest for import toml ?
- Buggy field visibility handling in`objectHas` in Go impl
- escapeStringXml vs escapeStringXML
- `--jpath` does not support multiple search paths HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-jsonnet.