TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Amazon States Language – A JSON-based language to describe state machines

290 点作者 another超过 8 年前

23 条评论

termie超过 8 年前
&quot;The Step Functions free tier includes 4,000 free state transitions per month.&quot; .. &quot;$0.025 per 1,000 state transitions thereafter&quot;<p>So Amazon has created a new calling convention, where conditional logic now also requires a context switch and JSON serialization. Then they charge you for the call .. $tdcall?<p>This will certainly have some useful applications, maybe someone will build an inexpensive data processing pipeline on top of it. Having seen many visual workflow tools through the years, most are simplifying complex underlying process, but these step functions and state transitions are modeling basic internal control flow with complex abstractions and little benefit other than retries with backoff.<p>The pure functional immutable nature of the data flow is ideally nice but tainted by the JSON. The parallelism is interesting, but it seems bolted on instead of a more powerful central part of the design.
评论 #13095845 未加载
DigitalJack超过 8 年前
Why do something like this in JSON? I don&#x27;t work in javascript, but surely it would have been far simpler to use. Restrict it to a subset if you have to, but this is absurd:<p><pre><code> &quot;ChoiceStateX&quot;: { &quot;Type&quot; : &quot;Choice&quot;, &quot;Choices&quot;: [ { &quot;Not&quot;: { &quot;Variable&quot;: &quot;$.type&quot;, &quot;StringEquals&quot;: &quot;Private&quot; }, &quot;Next&quot;: &quot;Public&quot; }, { &quot;And&quot;: [ { &quot;Variable&quot;: &quot;$.value&quot;, &quot;NumericGreaterThanEquals&quot;: 20 }, { &quot;Variable&quot;: &quot;$.value&quot;, &quot;NumericLessThan&quot;: 30 } ], &quot;Next&quot;: &quot;ValueInTwenties&quot; } ], &quot;Default&quot;: &quot;DefaultState&quot; }</code></pre>
评论 #13095953 未加载
评论 #13095669 未加载
评论 #13095049 未加载
ChrisRus超过 8 年前
I have been working on a moon-shot project for more than a decade that seeks to model distributed systems as if they were digital logic circuits. One of the natural areas of interest is of course FSM&#x27;s - in particular declarative specifications of FSM&#x27;s. I continue to believe (although it&#x27;s a wildly unpopular notion among some of my machine learning friends) that this obsession with the mechanics of declaring design intent with models and then synthesizing runtime code will fundamentally transform software engineering over time. But, declarative FSM&#x27;s aren&#x27;t enough to make it practical IMHO.<p>I wrote a short essay about this work in which I argue that the software engineering community needs to embrace the design methodologies and rigour of hardware designers: <a href="https:&#x2F;&#x2F;medium.com&#x2F;@alpinelakes&#x2F;on-monday-i-learned-i-got-accepted-to-the-founder-institute-991cdd88275e#.20kj8ipp5" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@alpinelakes&#x2F;on-monday-i-learned-i-got-ac...</a><p>See also: <a href="http:&#x2F;&#x2F;blog.encapsule.org&#x2F;early-encapsule-project-history&#x2F;2004-encapsule-prototype-screen-shots&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.encapsule.org&#x2F;early-encapsule-project-history&#x2F;20...</a> (old code but same ideas as what I&#x27;m building now in Node.js&#x2F;HTML5 @Encapsule).<p>Several things I believe are actually essential to make use of any of these ideas at scale:<p>- There needs to be an ad-hoc extensible standard for notating serialized data with markers, tags, semantics, metadata (whatever you care to call it). It is not practical to do unsupervised feature extraction on internal message streams. And, it&#x27;s _insanity_ to write&#x2F;test&#x2F;maintain custom validation&#x2F;normalization logic.<p>- Given the above, FSM declarations must be encoded with labels (as above) so that generic code can easily affect interop.<p>- Small FSM&#x27;s are reasonably easy to comprehend. But, very few systems can be modeled with simple FSM&#x27;s. Rather, real systems can be modeled as complex directed graphs where edges represent the flow of observable state from one FSM to another (vertices represent individual FSM).<p>- Given that real systems can be modeled using non-trivial graph models of FSM (as above), building reusable components by splicing and dicing the graph up is logically possible. But, this is not something that mortals can do by hand. Considerable tooling is required to make it practical to design systems like this.<p>If you&#x27;re interested in these topics, and want to help, look me up @Encapsule.
评论 #13094710 未加载
评论 #13094720 未加载
评论 #13094719 未加载
评论 #13094721 未加载
lacampbell超过 8 年前
A new market to disrupt - undergraduate computer science projects as a service.<p>Wait until you guys check out my hashtable implementation <i>in the cloud</i>.
评论 #13094431 未加载
评论 #13094950 未加载
评论 #13101686 未加载
michaelsbradley超过 8 年前
See also SCXML and SCION:<p><a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;scxml&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;scxml&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;jbeard4&#x2F;SCION" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jbeard4&#x2F;SCION</a><p>And for background, see the pioneering work of Dr. David Harel:<p><i>A list of all of his papers</i><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers.html" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers.html</a><p><i>A few on Statecharts</i><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;SCANNED.PAPERS&#x2F;SemanticsofStatecharts.pdf" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;SCANNED.PAPERS&#x2F;Seman...</a><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;reactive_systems.html" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;reactive_systems.htm...</a><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;RhapsodySemantics.pdf" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;RhapsodySeman...</a><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;Statecharts.History.CACM.pdf" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;Statecharts.H...</a><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;Statecharts.History.pdf" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;Statecharts.H...</a><p><i>Prof. Harel the dreamer...</i><p><a href="http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;LiberatingProgramming.pdf" rel="nofollow">http:&#x2F;&#x2F;www.wisdom.weizmann.ac.il&#x2F;~harel&#x2F;papers&#x2F;LiberatingPro...</a>
lobster_johnson超过 8 年前
Interesting that they&#x27;re using JSONPath, which isn&#x27;t even specified formally anywhere. The only other major implementor that I know about is Kubernetes, which has some odd extensions for templating. (JSONPath itself, of course, isn&#x27;t very well designed in the first place.)<p>We&#x27;re working on a new variant of JSONPath that we&#x27;re hoping to publish as a formal, comprehensive specification. It&#x27;s essentially a superset of JSONPath with some syntax warts fixed (like the need to start with $). I wrote a little about it on HN a week ago [1].<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13032391" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13032391</a>
评论 #13094105 未加载
评论 #13094405 未加载
评论 #13093953 未加载
Marazan超过 8 年前
Remember when we used XML, and then people started making DSLs in XML and XML was the worst and too &#x27;heavy&#x27; and having to write schemas was enterprise and awful and we are totes using lightweight schema free sexy JSON now?<p>I wonder what the new thing to replace enterprise JSON will be.
评论 #13095244 未加载
评论 #13095435 未加载
tonylucas超过 8 年前
This is interesting, has a lot of similarities (not surprisingly) with how the state machine we build workflows on our bot platform, although of course ours is specifically fixed around chat&#x2F;messages as a key interaction point.<p>Major differences that I can see are we enable multiple functions to be sent per state, and that the output data from any state is referenceable by any other state, not just passing it down in turn through the states.<p>We support fallback states but in a different way, and don&#x27;t support the retry concept directly within the state language itself, has to be built as a set of states to perform a loop to attempt a retry.<p>We don&#x27;t support parallel stages, but do support branches, and remerging of those branches.<p>Probably the final difference I can see, is one of our options when running a function allows you to actually append additional states to the machine during the runtime process.
Swizec超过 8 年前
I did it better 5 years ago. <a href="https:&#x2F;&#x2F;swizec.com&#x2F;blog&#x2F;a-turing-machine-in-133-bytes-of-javascript&#x2F;swizec&#x2F;3069" rel="nofollow">https:&#x2F;&#x2F;swizec.com&#x2F;blog&#x2F;a-turing-machine-in-133-bytes-of-jav...</a><p>133 byte interpreter in JavaScript. Input is JSON specifying state name, write, move direction, and next state. Turing machines, basically.<p>Mine was for fun, but why is Amazon doing this?
评论 #13093521 未加载
评论 #13094962 未加载
nighthawk454超过 8 年前
Some more info on Tim Bray&#x27;s site: <a href="https:&#x2F;&#x2F;www.tbray.org&#x2F;ongoing&#x2F;When&#x2F;201x&#x2F;2016&#x2F;12&#x2F;01&#x2F;J2119-Validator" rel="nofollow">https:&#x2F;&#x2F;www.tbray.org&#x2F;ongoing&#x2F;When&#x2F;201x&#x2F;2016&#x2F;12&#x2F;01&#x2F;J2119-Val...</a>
timbray超过 8 年前
Glad to hear that so many people already did this (only better), years ago. Nice to have company.<p>The only thing new or interesting about States is it has a product behind it that implements it at scale, available now; give it a try.<p>I think it&#x27;s quite likely that this syntax is state-machine assembler, and smart people will find nicer expressions of this and compile them down.<p>In particular, some people prefer dependency graphs to explicit state machines for this sort of thing.
trickyager超过 8 年前
Amazon has also created a ruby gem to lint JSON state machines. <a href="https:&#x2F;&#x2F;github.com&#x2F;awslabs&#x2F;statelint" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;awslabs&#x2F;statelint</a>
TeMPOraL超过 8 年前
Wait, did they just made a Lisp in JSON?
评论 #13094005 未加载
评论 #13095115 未加载
评论 #13094792 未加载
hacker_9超过 8 年前
<i>&quot;This document describes a JSON-based language used to describe state machines declaratively. The state machines thus defined may be executed by software. In this document, the software is referred to as “the interpreter”.&quot;</i><p>Oh no.
评论 #13093554 未加载
评论 #13093562 未加载
评论 #13093435 未加载
评论 #13093525 未加载
评论 #13093951 未加载
评论 #13093492 未加载
devj超过 8 年前
Wondering why they aren&#x27;t using their own data format(Amazon Ion - <a href="https:&#x2F;&#x2F;amznlabs.github.io&#x2F;ion-docs&#x2F;spec.html" rel="nofollow">https:&#x2F;&#x2F;amznlabs.github.io&#x2F;ion-docs&#x2F;spec.html</a>) instead of JSON.
评论 #13095712 未加载
flaviuspopan超过 8 年前
This strikes me as the underlying spec for the new Batch service mentioned at re:invent.
评论 #13093416 未加载
neurostimulant超过 8 年前
This could be useful. Currently there is no easy way to add delay when invoking lambdas from an event. Perhaps this could be used to create a delayed execution triggers (e.g. Invoking a lambda 10 minutes after a dynamodb entries updated).
avodonosov超过 8 年前
JSON? Somebody forbade s-expressions?
评论 #13095162 未加载
rhizome超过 8 年前
JATEOAS
评论 #13093546 未加载
swehner超过 8 年前
Doesn&#x27;t look too pretty, ugly in parts. Something strange about it. The ARN business looks very suspicious.<p>Maybe this is supposed to be pre-alpha?<p>Consistent with the Tim Bray blog article saying the validator&#x27;s &quot;implementation is kind of gross.&quot;<p>But then again: stay out of trouble, avoid Amazon.
shoefly超过 8 年前
Looks like any other brittle FSM. It&#x27;s missing an important layer of logic. And yeah, I&#x27;m bias because I&#x27;m finishing up an FSM that crushes that brittleness.
评论 #13094499 未加载
elcct超过 8 年前
Language? That&#x27;s bold
bbcbasic超过 8 年前
Bah! Why JSON not XML?
评论 #13094432 未加载
评论 #13094426 未加载