What I see is a crappy ad-hoc scripting language. I feel bad saying so, but I can only view this project as a bad solution to whatever problem you have.
You could have chosen to send actual code, be it JavaScript, Python, Java or even Linux binaries, executed with limited privileges. How would that look like? AWS Lambda.
Sending code in some existing general purpose or scripting language makes it either difficult/inefficient to parse, or insecure (if, e.g. JavaScript or bash eval is used), or both. Limited privileges only partially protect the host and usually leave some vulnerabilities...
JSONScript is both very easy and efficient to parse (a JSON-Schema is used to evaluate the script) and it is secure because it executes the script in a "sandbox" having access only to those system resources that the host environment explicitly exposed to the interpreter.
My two main use cases are 1) scripted processing on top of existing API (implemented) and 2) proxy allowing scripted processing across multiple APIs in the same location (soon).
Nice work on building an interpreter, but I'd throw the entire SOA book at you for deploying this in a production environment. I haven't even addressed stability, latency and load of programmable Web interfaces, or security.
I would like to see some use case thoughts about where this would work better than other alternatives.
Joking aside, why do you think it is any more untestable than any other batch endpoint out there? The concerns you are listing are all valid and can be addressed.
This is more untestable because the service that provides the scripting interface needs to have a test bed that is similar to the test bed of an entire language itself. Are there corner cases? Can a client cause a script to loop indefinitely? Is there a test case for every known combination a client would attempt? If so, why not just support each use case explicitly?
There are 1000 reasons why being additionally clever causes more headaches than its worth. I'm not too upset about it - because I'm confident those that don't heed this warning will learn the lesson the hard way.
Syntax is a matter of opinion, JSONScript seems more concise than REL in the link.
Both approaches are similarly flawed, but XML would actually work much better for what you're trying to do with JSON - and much more readable.
This isn't a script at all but a way to call an RPC method. And over a non duplex connection at that.
I often use something very similar with a few additions to support callbacks. Add an ID field so that responses can be matched and you suddenly support calls being made over a duplex connection such as Websocket or TCP connection;
Shorthand and longhand formats complicate things so stick with one type. The whole $ prefixed params are also un-needed, especially if your'e expecting them and have the important values under your own expected keys anyway.
But then after all this you start turning into json-rpc.
JSON-RPC allows simple batching but it doesn't allow any server side logic between calls. Individual calls to external instructions in JSONScript are indeed similar.
The full syntax can be used if you need to evaluate some of the fields, it's also easier to parse. Short syntax is implemented as a macro - it's expanded to full syntax before evolution. Given that it in most cases short syntax is better I was going to hide full syntax a bit...
http://thedailywtf.com/articles/Classic-WTF-We-Use-BobX
The scariest part is that epoberezkin has mentioned using this new innovative language at his job. I hope someone stops him.
It's very late here and I'm tired so I can't come up with anything especially constructive but something doesn't feel right about this.
I guess I would like to see the code as plain text. Packaging all the data to send as JSON is OK, and the code could be text in a single JSON data element.
Post a story to Hacker News once you get some experience using JSONScript with some feedback on how you went and how the idea evolves.
I've implemented something similar with my own projects in the past and I think others have and ultimately will as well. "What problem causes us all to ultimately implement something like JSONScript or JSON RPC?"
I think there's two problems and I think JSONScript went a bit too far/got too specific as to how to solve them:
1) How to specify (multiple) destinations when delivering API requests and their order of execution.
2) How to execute actions safely despite potentially dangerous payloads.
I suggest removing the "path" part as it can easily be included in the top level of the object (e.g. {"someapp: destination": "payload here"}. I also suggest removing the "get" and "put" nomenclature. That's so old fashioned and synchronous :) . Shouldn't such things be determined by the destination functions?