Comments (3)
Other examples for c$
that result in the same .out
and .set
behavior:
$eval('a')
b.%.a
($ ~> | $ | { 'a': a } |).a
function ($it) { $it.a }($)
($it := $; $it.a)
b[0 + 0]
b.( function() { $[0] }() )
$sift(function ($_, $key) { $key = 'a' }).a
*[0]
from stated.
Hi spencer - Stated does not try (at present) to do semantic analysis of functions. Rather than trying to hook in, I feel the best thing to do is just this:
{
"a": "❌",
"b": [
"/${a}"
],
"c$": "(a;$lookup('a'))"
}
In other words, just manually add the dependency to c$. There will alway be a class of dynamic expressions. We find these to be rare. So rare in practice that they have not occurred in any real uses cases so far. But we have anticipated and the solution is pretty straightforward manual dependency setting like I showed above. Thanks!
from stated.
(Copied here from webex for completeness)
When a developer doesn't control all the code (e.g. imports), it may be difficult to reason about when a dependency needs manual declaration.
It's also not just functions that break analysis. Computed array indices (
b[0 + 0]
) and parent traversal (b.%.a
) also currently evade analysis. (But, I would say functions are even more basic than these, since they are needed to deduplicate code.)To clarify, my concern is about correctness, not feature richness. I think it's fine to say "we don't support X and Y". But presently, the issue is it's impossible to tell when an undetected dependency is a bug or "working as expected". I expect there to be a flood of questions as usage scales up. And if stated is to be a foundation of other user facing APIs, the problem is those APIs will receive floods of questions as well.
I'm concerned as a maintainer of those user facing APIs, that I will be pressured to adopt stated at the cost of increasing my own maintenance burden, if these correctness issues are not addressed.
from stated.
Related Issues (5)
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 stated.