Comments (2)
Hi Greg,
Awesome! JSON literals are a hacky way to implement dictionary/map-like objects. The syntax is something like:
x = @{"a": [1,2,3], "b": 2};
y = @[1,2,3];
where the stuff that comes after @ can't contain any PlanOut variables. Honestly, the JSON literal parser is pretty wonky, and we have been hoping that somebody with more experience writing parsers could implement a sane implementation of dictionaries, that would completely replace JSON literals, so that one could write things like:
weights1 = [1, 2, 1];
weights2 = [2,1,1];
y = {"US": weights1, "ES": weights2};
Is this something you would know how to do? If so, that would be great! Also, if you were to re-write the parser in PEG, would it be compatible with PEG.js?
Also, you may be interested in checking out the PlanOut editor (in planout/planout-editor/) -- I think it might motivate why we favor having a JS-based compiler :)
from planout.
Hi Greg,
Awesome! JSON literals are a hacky way to implement dictionary/map-like objects. The syntax is something like:x = @{"a": [1,2,3], "b": 2}; y = @[1,2,3];
where the stuff that comes after @ can't contain any PlanOut variables. Honestly, the JSON literal parser is pretty wonky, and we have been hoping that somebody with more experience writing parsers could implement a sane implementation of dictionaries, that would completely replace JSON literals, so that one could write things like:
I could try to give it a shot in implementing a dict object, I might give that a shot once the grammar is done.
Is this something you would know how to do? If so, that would be great!
I could do it in a PEG, I generally hate writing classical grammars :P
Also, if you were to re-write the parser in PEG, would it be compatible with PEG.js?
I dont know if PEG.js takes grako EBNF format, but I dont think it would be hard to transliterate. Scanning quickly through the PEG.js documentation the one thing that might be troublesome is the lack of a cut operator.Also, you may be interested in checking out the PlanOut editor (in planout/planout-editor/) -- I think it might motivate why we favor having a JS-based compiler :)
I have played with it a lot, its really neat. The rationale for me, for the python compiler is to have a compiler that can run inside a test-server that is responsible for farming out test jsons to systems that ask for them.
I opened a pull request #29 for where I am up to.
from planout.
Related Issues (20)
- Alpha ruby implementation HOT 4
- Inconsistencies for dictionaries
- Pausing an experiment HOT 1
- Log analysis
- Logging solutions for larger experiments?
- If PlanOut is deterministic, why I see different result from the tech talk video
- Namspaces
- error on running node planout.js with demo .planout file.
- Extending the Interpreter to Use Sqrt and Exp Operator. HOT 1
- Python 3.6 support HOT 1
- Update link to Golang interpreter under alpha submodule HOT 3
- Link to typescript version
- Add Swift implementation to alpha.
- There is a vulnerability in Flask 0.10.0 ,upgrade recommended
- There is a vulnerability in Werkzeug 0.9.6,upgrade recommended
- Issue with Webpack v5 HOT 1
- Code mentioned in installation instruction is of older Python version.
- Experiment Ramp Up
- Running experiments with different units of analysis in a common namespace. HOT 1
- Ruby implementation maintenance
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 planout.