3 ms·
The problem is that the shell is frozen in time. have not evolved and it show. The shell is just BAD. Anti-USERS and even anti-APPS!. composing commands in she
by mamcx 7y ago
The problem is that the shell is frozen in time. have not evolved and it show.
The shell is just BAD. Anti-USERS and even anti-APPS!. composing commands in shell is just BAD. Is the worse API you can cobble in a hurry.
---
I love the interactivity of it, but frankly FoxPro DOS 2.6 have a MUCH better experience. And in fact exist many others experiences of interactivity much better (Smalltalk, JS Dev tools, Jupyter notebooks, etc).
I have dreamed about this and think will be nice a shell that:
1. Instead of just BLOB of binary-hopefully-is-text-maybe it interface with SHAPES and TYPES:
enum Data {
Stream(Data),
Lines(Scalar), //utf8, bytes, ints, bools, etc...
Table(Header, Data),
Tree(BTreeMap(Data, Data)),
Graph(Nodes< Data >)
}
This abstract interface will support most stuff we need. Then with mime-types you can request "Tree as JSON" and get that.
This is similar to HTTP headers: But instead of html and that you ask for a shape and the type of it. Of course some utilities will only support some and can reject. And at minimum can return BLOB for interoperatibility with old shell utils.
When returning you get the mimetype/shape so will know that the blob is really a JPG and use that fact for displaying purposes and type inference.
With types and shapes you will get some static type validations.
2- Rich output (images, graphs, etc).
3- Uniform help and API discoverability alike swagger.
4- More rich and uniform API for the language that glue all.
For example is nuts that each utility must reimplement sorting, filtering, etc.
Instead if the shell have filter/map/group/etc in-built commands together with shapes and types:
csv "sample.csv" filter: .. group: ..
|> map:..
|> zip "sample.zip"
ie: Is like a database interface
- ale22 7y agoYou mean using something like typescript as a shell language? That could work and it would leverage the javascript runtime and yet provide the rich type system and benefits.
- mamcx 7y agoI don't focus in the language itself but in how interface between utilities. The shell is a place for a light scripting layer and make talk apps in many langs. Instead in what the utilities talk. Like in a REST interface you declare the kind of data (table, tree, lines of text, a binary blob) and this unlock what combinatory commands are available (so for table/lines you get relational commands for example) that are global. So the utilities are mostly concerned about their input/outputs. Probably for efficience the utilities get a REQUEST call alike: GET /list: WHERE name = "hello" to have the opportunity of do the processing inside.