Comments (7)
Ideally we could go as far as parsing json inputs that can then be fed to the ports of the graph.
from fbp.
When passing '\n' or other escaped characters they are treated as literals , this can be observed when using file writing components.
An "universal" data types proposal (instead of just using javascript types) could work accross platforms
Example:
'1' NUMBER -> IN SomeNode
'true' BOOL -> OPEN Gate
'["foo", "bar"]' STRING LIST -> IN OtherNode
'{"foo": 5, "baz": true }' OBJECT -> IN SomeThing
from fbp.
All of the previous are JavaScript expressions, couldn't just inject them directly into NoFlo using an eval() or something?
from fbp.
That can lead to abuse and bugs. But yes, JSON deserializing is what has to be done, with JSON.parse or some other safe method, eval() could mess with noflo. Although i'm not really happy in retrospective with the OBJECT type for IIPs, since it could be abused into messy graph definitions, but for testing it would be really nice.
Instead of just NUMBER, we could have FLOAT, INTEGER, DOUBLE, etc. For javascript they would all be just numbers, but for other implementations it can be different. The advantage is validating the IIP string.
from fbp.
There are easy ways to work around not using eval().
You could have something like :
el = JSON.parse("{ value: " + stringFromFbpFile + "}");
And then pass the el.value to the processes' ports.
I just find the NUMBER, LIST, OBJECT really difficult to work with.
How do you describe complex stuff like :
[true, [0, 1, 2, 3], "Plop"]
[{x: -1, y: 1}, {x: 1, y: -1}]
etc... ?
from fbp.
Wouldn't that be a smell? Configuring processes with contrived data structures doesn't seem smart to me at least.
It can work if you pass an object instead of a list of heterogeneous elements, otherwise it would look like noise in the FBP file, meaningless configuration string.
from fbp.
Heads up I've implemented this (basically just pulled in peg.js' JSON grammar) in #58.
from fbp.
Related Issues (20)
- syntax for grouping HOT 1
- fbp lowercases port names HOT 3
- default ports HOT 13
- Parse `# @runtime` foo HOT 2
- Missing JSON schema for output
- Allow to specify edge metadata HOT 3
- Support serializing JSON to .fbp HOT 2
- Regression: 3 clause connection without component instantiation HOT 1
- Add support for automatic ports HOT 9
- Deprecate EXPORT keyword
- Language agnostic test suite and grammar HOT 8
- No error on refering non-existing process in inport declaration HOT 3
- No error on connecting to non-existing processes
- Whitespace after process name generates new name
- An in-range update of grunt-noflo-browser is breaking the build 🚨 HOT 1
- No error on missing component name
- JSON to FBP problem HOT 5
- Version 10 of node.js has been released
- An in-range update of grunt is breaking the build 🚨 HOT 1
- An in-range update of coveralls is breaking the build 🚨 HOT 6
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 fbp.