Post 9mCjkvLAucpXNsGNOK by fribbledom@mastodon.social
(DIR) More posts by fribbledom@mastodon.social
(DIR) Post #9mCjRjcOGtWXWfAK0m by fribbledom@mastodon.social
2019-08-24T07:39:05Z
0 likes, 0 repeats
Here's what I'd actually want to use:- output data in a human readable form per default to stdout- have a separate data channel ('stddata') that gets used to communicate data in a structured fashion
(DIR) Post #9mCjVy9m9xu9m4ngQK by Wolf480pl@niu.moe
2019-08-24T07:39:51Z
0 likes, 0 repeats
@fribbledom you'd need to be able to display that stddata output anyway
(DIR) Post #9mCjdbdDn7VUENDNUO by alice@bidule.menf.in
2019-08-24T07:41:16.013705Z
0 likes, 0 repeats
@fribbledom stddata 😍 When are we implementing this ?
(DIR) Post #9mCjg7RwSnB1UZ8ZZA by piggo@piggo.space
2019-08-24T07:41:42.539246Z
0 likes, 0 repeats
@fribbledom there's a function that tells you if stdout is printed or piped, many programs change the output format based on that, e.g remove ansi colors and switch to line separated format
(DIR) Post #9mCjkvLAucpXNsGNOK by fribbledom@mastodon.social
2019-08-24T07:42:33Z
0 likes, 0 repeats
@piggoI know, but even that is an ugly hack that breaks often enough 😒
(DIR) Post #9mCjxzkLqGFyoWGv5c by zensaiyuki@mastodon.social
2019-08-24T07:44:55Z
0 likes, 0 repeats
@fribbledom or what if you had a shell that could just natively display data. y’know, like the chrome dev tools do.
(DIR) Post #9mCkHgQNOIm8g9JhyK by tyil@soc.fglt.nl
2019-08-24T07:48:29.268966Z
0 likes, 0 repeats
@fribbledom How about a standardized environment variable, so you can set it by default on things like Docker images, or in various contexts where you know you will want a certain kind of output. export OUTPUTFORMAT=json, and programs will talk JSON instead (though probably you’d want a better name environment variable name).
(DIR) Post #9mCkMdNU95sQg5KEaW by tyil@soc.fglt.nl
2019-08-24T07:49:24.282605Z
0 likes, 0 repeats
@zensaiyuki @fribbledom And break decades upon decades of software because you didn't find the output fancy enough? No thanks. Fish is already causing problems with devs, now unwilling to learn how to use a proper shell, we don't need more of those things.
(DIR) Post #9mCkVeHS9uCS5FnoIK by fribbledom@mastodon.social
2019-08-24T07:51:00Z
0 likes, 0 repeats
@tyilNothing's getting broken if you use a separate data channel to communicate here.@zensaiyuki
(DIR) Post #9mCkbUyBglTewca3A8 by zensaiyuki@mastodon.social
2019-08-24T07:50:30Z
0 likes, 0 repeats
@tyil @fribbledom yeah actually you just made me want to ruin your day on purpose. so yes, let’s break software.
(DIR) Post #9mCkbVD4nPO3gnXwMy by tyil@soc.fglt.nl
2019-08-24T07:52:04.631996Z
0 likes, 0 repeats
@zensaiyuki @fribbledom You're not ruining my day by having silly opinions that disregard the entirety of the software world, though.
(DIR) Post #9mCkh4tXY1LZoP4DxI by zensaiyuki@mastodon.social
2019-08-24T07:53:04Z
0 likes, 0 repeats
@fribbledom @tyil would there really be no way for coreutils to tell if its running in a proper shell? as in, one that doesn’t exist yet but would upset traditionalists? like, the shell could just pass a —pragma-21st-century flag invisibly
(DIR) Post #9mCklI4YUmEvq9ECrQ by tyil@soc.fglt.nl
2019-08-24T07:53:50.756043Z
0 likes, 0 repeats
@fribbledom @zensaiyuki If you'd implement this based on a `STDDATA` stream addition, I'd still be against it, as you're now "hiding" `STDOUT` to show `STDDATA` instead, and there's no guarantee these are the same. Chromium's dev tool show the *same* stream, but in a different way.
(DIR) Post #9mCkwTr51np7ZKGFCy by zensaiyuki@mastodon.social
2019-08-24T07:54:16Z
0 likes, 0 repeats
@tyil @fribbledom well then I guess i’ll just have to figure out where you live and shit in your cornflakes. unelss you can be about 1% less of a prat
(DIR) Post #9mCkwU3UHfkSBo49Y0 by tyil@soc.fglt.nl
2019-08-24T07:55:51.087163Z
0 likes, 0 repeats
@zensaiyuki @fribbledom Going by your responses, it feels like your day has been ruined more than mine, by a simple text post on the Internet.
(DIR) Post #9mClFCTTsBnBAL9I6y by zensaiyuki@mastodon.social
2019-08-24T07:58:11Z
0 likes, 0 repeats
@tyil @fribbledom fine, I’m making my own unix. with blackjack. and hookers.
(DIR) Post #9mClFCngf3xIB0bQbg by tyil@soc.fglt.nl
2019-08-24T07:59:14.469404Z
0 likes, 0 repeats
@zensaiyuki @fribbledom Good luck on your endeavours!
(DIR) Post #9mCmnORvxMG86cIGi8 by mjog@octodon.social
2019-08-24T08:16:34Z
0 likes, 0 repeats
@fribbledom Open a UNIX domain socket for the data channel? Or a shm segment?
(DIR) Post #9mCmw4ecvM5BJmN0Bk by fribbledom@mastodon.social
2019-08-24T08:18:10Z
0 likes, 0 repeats
@mjogI'd still want to use this to pipe things around in a shell.
(DIR) Post #9mCnSeNRduaTNRrnqy by mjog@octodon.social
2019-08-24T08:24:03Z
0 likes, 0 repeats
@fribbledom Ah yeah, overload stderr then? ;)There's also this: https://github.com/acfr/comma which is oriented to robotics, but it might be worth a look at anyway and adapting some ideas.They default to CSV for what that it's worth, and they use it to implement high-end, real-time autonomous field robotics systems, so the serialisation overhead can't be too bad.
(DIR) Post #9mCnbshlk2iWQ7m6wi by fribbledom@mastodon.social
2019-08-24T08:25:44Z
0 likes, 0 repeats
@mjog That'd be just another hack. stddata would allow us to finally separate human-readable and machine-readable outputs.Imagine we could actually change the output format of popular shell tools without breaking all kinds of scripts depending on the very form.
(DIR) Post #9mCnnLG1vLza9zGUvA by mjog@octodon.social
2019-08-24T08:27:46Z
0 likes, 0 repeats
@fribbledom Well, they have developed a set of consistent conventions, and implement libraries for these, but sure. :)Sounds like you want something like the HTTP Accept header, but for pipes.
(DIR) Post #9mCnrVu0HzGaKfx42y by fribbledom@mastodon.social
2019-08-24T08:28:34Z
0 likes, 0 repeats
@mjogMany tools actually do that and detect whether they're outputting to a terminal or a pipe.Yet another hack though 😂
(DIR) Post #9mCodM0GOecRWzgwaW by mjog@octodon.social
2019-08-24T08:37:10Z
0 likes, 0 repeats
@fribbledom Well it would solve the "not breaking existing tools" problem: Open stdin, set a list of kinds of MIME content types you want to accept using a ioctl-like call ("prefer text/json, but will also accept text/csv and text/x-traditional"). The program connected to that pipe gets a SIGCONTENT signal, allowing it to obtain the list via a similar call, then start producing that content type.
(DIR) Post #9mCpYwRfZvlz3nyEwi by derwinmcgeary@octodon.social
2019-08-24T08:47:33Z
0 likes, 0 repeats
@fribbledom this! Except now I realise I don't actually know *how* stdout works.
(DIR) Post #9mDLhr1MJRVjNOxR0C by epilanthanomai@signs.codes
2019-08-24T14:47:38Z
0 likes, 0 repeats
@fribbledom What would happen if you checked at the beginning of main() to see if fd 3 was open (from the shell or whoever exec()ed you) and if so used it as a data channel? Typically any fd >2 is closed on exec, right? I wonder if any tools just leak other fds and rely on that being ok. If not, could work.
(DIR) Post #9mDOW8m4mO1QpEuoQi by fribbledom@mastodon.social
2019-08-24T15:19:13Z
0 likes, 0 repeats
@epilanthanomaiSure, but the point is that I want the standard coreutils to offer that.
(DIR) Post #9mDPabsyaPASE0q0p6 by epilanthanomai@signs.codes
2019-08-24T15:31:17Z
0 likes, 0 repeats
@fribbledom I mean, that's fair. IME things become core utils when someone makes a tool that's useful and popular and so many people use it that the language's core team adopts it into core. Obviously languages vary on precisely how they do that, but it pretty much always starts as a solid add-on.
(DIR) Post #9mEh5hZ3PpmTC1tIEy by edheil@dice.camp
2019-08-25T06:21:19Z
0 likes, 0 repeats
@fribbledom have been reading criticisms of JSON and YAML lately and I wonder if the reason nobody does this is that all the parseable formats suck and people would rather have a non-assed non-solution than any of the half-assed ones
(DIR) Post #9mFdLXS4ZnrPnusiBs by rolandbaer@octodon.social
2019-08-25T17:14:09Z
0 likes, 0 repeats
@fribbledom Have you ever used the PowerShell from Microsoft? It's also available on Linux (although I have never tried it). The PowerShell has the concept of passing objects rather than strings.