6 ms·
Why do something like this in JSON? I don't work in javascript, but surely it would have been far simpler to use. Restrict it to a subset if you have to, but
by DigitalJack 10y ago
Why do something like this in JSON? I don'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:
"ChoiceStateX": {
"Type" : "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private"
},
"Next": "Public"
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20
},
{
"Variable": "$.value",
"NumericLessThan": 30
}
],
"Next": "ValueInTwenties"
}
],
"Default": "DefaultState"
}
- junke 10y agoBecause Javascript doesn't have macros.
- junke 10y agoIf you squint your eyes, it really looks like a cond: (cond ((not (eq (type $) :private)) :public) ((<= 20 (value $) 29) :value-in-twenties) (t :default-state))
- mSparks 10y agocompetely agree. its one thing to serialise your states to json. quite another to try and recreate javascript or any other low permission language in it. I know _why_ they did it, and i bet a fair few pure managerial types fall for the bait and commission a project or thousand on it, locking themselves in to amazons absurd pricing model for production systems. But everyones got to make a buck eh.
- lokedhs 10y agoDo you remember when XML was all the rage, and we had silly implementations of pretty much everything using XML? For no good reason other than the fact that it was XML. Then everybody moved to JSON because it was simpler. Well, it seems history is being repeated. Just because something exists that a lot of people use doesn't mean you need to build everything on top of it.
- mSparks 10y agoYeah, we still have a few critical components that serialise to xml rather than json, although they have mostly been replaced. What's new this time is the pricing model. It used to be we could run what we wanted on our own hardware on our own time. SaaS is new, mostly impossible to pirate (hacking AWS keys aside), and priced to make your eyes water.
- murukesh_s 10y agoIt looks like they want to make a User interface on top of it. It is very difficult to make a user interface that reads and writes from a regular programming language as there are multiple ways to write the same expression (with space, without space, with new line etc).
- mSparks 10y ago18 years late. https://en.m.wikipedia.org/wiki/Dia_(software) https://en.m.wikipedia.org/wiki/Dia_(software)
- murukesh_s 10y agoNot at all related. Amazon step functions are executable state machines, while Dia is just a general-purpose diagramming tool.
- mSparks 10y agodia creates xml almost identical in nature to this json spec. and if you need json, plenty of xml to json convertors knocking around.
- murukesh_s 10y agoLooks like it's already there - https://aws.amazon.com/step-functions/ https://aws.amazon.com/step-functions/ This is the underlying spec of Amazon step functions.