Curtis Yarvin
2016-07-24 22:32:09 UTC
I don't know enough about the usage of background colors. I would ask: do
any IRC clients, etc, use these? Are they universally supported by modern
ANSI terminal sequence recognizers?
The four-letter-word game isn't any fun unless you actually have to stick
to Scrabble words. I would suggest: ++tint, ++deco, ++styx.
I am happy to dispute your feeling that colored output should be available
at a lower level. I think it's really only for interactive use. The use
of a ++tank (or hopefully soon ++tanq) is that it gives the programmer very
little leeway to style the output; in fact, ++tanq is even more easy to
build and restrictive for a reason. Eg, a Hoon AST (twig) is a tree and
++tank builds trees, but a ++tank is not a pretty-printer for Hoon.
There are two kinds of text output: interactive and diagnostic.
Interactive output goes to the console as a sole-effect. Anything a
generator produces is diagnostic output -- or at least, that's how we think
about it now. The primary demand of diagnostic output is that it never
breaks, ever. Nothing is more infuriating than a crash in rendering your
diagnostics. So it has to be incredibly easy to generate, simple and
stupid, which ++tank is and ++tanq is even more. I wouldn't want to go in
the opposite direction.
You could certainly imagine, however, a mark transformation that
transformed your data structure either to a tank, or to a styled text
document, or perhaps to HTML. On the web you'd see HTML, in a terminal
styled text. So I'm not saying that styled text output from generators is
impossible; I would do the interactive use case first.
As for the actual molds, your design is perfectly serviceable. But most
styled text is likely to be just text. So going from "foobar" as ++tape,
to "[[~ ~ "foobar"] ~]" as ++styl, is a little annoying. What about:
++ tint ?($~ $r $g $b $c $m $y $k $w)
++ deco ?($~ $bl $br $un)
++ styx (list $@(@t (pair (pair deco tint) styx)))
What did we do here? We disambiguate an unstyled atomic text block against
a styled subtree. So "foobar" is also a ++styx. We pair the color and
decoration, because they may be built as an integrated style. We allow
text atoms of any length, so ['foobar' ~] is a ++styx as well. Then the
new sole-effect page is {$sty p/styx}. You could even make the deco and
tint units, creating snazzy cascading styles (~ inherits the parent's
style).
Also, at least as important as colored output is a colored *prompt*. This
would certainly help with the constant prompt confusion we suffer from...
fortunately this is also a sole protocol.
Helpful? Thoughts?
any IRC clients, etc, use these? Are they universally supported by modern
ANSI terminal sequence recognizers?
The four-letter-word game isn't any fun unless you actually have to stick
to Scrabble words. I would suggest: ++tint, ++deco, ++styx.
I am happy to dispute your feeling that colored output should be available
at a lower level. I think it's really only for interactive use. The use
of a ++tank (or hopefully soon ++tanq) is that it gives the programmer very
little leeway to style the output; in fact, ++tanq is even more easy to
build and restrictive for a reason. Eg, a Hoon AST (twig) is a tree and
++tank builds trees, but a ++tank is not a pretty-printer for Hoon.
There are two kinds of text output: interactive and diagnostic.
Interactive output goes to the console as a sole-effect. Anything a
generator produces is diagnostic output -- or at least, that's how we think
about it now. The primary demand of diagnostic output is that it never
breaks, ever. Nothing is more infuriating than a crash in rendering your
diagnostics. So it has to be incredibly easy to generate, simple and
stupid, which ++tank is and ++tanq is even more. I wouldn't want to go in
the opposite direction.
You could certainly imagine, however, a mark transformation that
transformed your data structure either to a tank, or to a styled text
document, or perhaps to HTML. On the web you'd see HTML, in a terminal
styled text. So I'm not saying that styled text output from generators is
impossible; I would do the interactive use case first.
As for the actual molds, your design is perfectly serviceable. But most
styled text is likely to be just text. So going from "foobar" as ++tape,
to "[[~ ~ "foobar"] ~]" as ++styl, is a little annoying. What about:
++ tint ?($~ $r $g $b $c $m $y $k $w)
++ deco ?($~ $bl $br $un)
++ styx (list $@(@t (pair (pair deco tint) styx)))
What did we do here? We disambiguate an unstyled atomic text block against
a styled subtree. So "foobar" is also a ++styx. We pair the color and
decoration, because they may be built as an integrated style. We allow
text atoms of any length, so ['foobar' ~] is a ++styx as well. Then the
new sole-effect page is {$sty p/styx}. You could even make the deco and
tint units, creating snazzy cascading styles (~ inherits the parent's
style).
Also, at least as important as colored output is a colored *prompt*. This
would certainly help with the constant prompt confusion we suffer from...
fortunately this is also a sole protocol.
Helpful? Thoughts?
continuing the conversation from #203
<https://github.com/urbit/arvo/pull/203> ...
++ kulr ?($~ $r $g $b $c $m $y $k $w) :: color or default
++ decr ?($~ $bl $br $un) :: decor or default
++ styl (trel kulr decr tape) :: inline text
These seem to fall naturally out of basic terminal color/style support
(and the relevant ANSI codes...). A color is one of R/G/B, C/M/Y/K, white,
or null. A text decoration is blink, bright, underscore, or null. And a
piece of styled, inline text is a triple of color, decoration, and the text
itself. A line of output is therefore (list styl).
*(I'm making the assumption that background colors, hidden text, reversed
text, etc. are out of scope.)*
Wrapping this up as a ++sole-effect is pretty straightforward; something
like: {$klr p/(list styl)}. However, I can't shake the feeling that
colored output should be available at a lower level ...
The obvious use-cases are generators and unlinked apps that produce output
in response to pokes (as :hood does with |sync, |merge, etc.). I know the
long-term plan is for syslog-style output to be sent to a :talk channel,
but, even then, ++sole-effect doesn't quite feel natural...
If this were to be added to ++tank, I'd propose something like {$vein
p/styl}, and maybe even {$leaf p/?(tape (list {$vein styl}))}. I'm not
sure how it could fit with ++tanq.
Thoughts?
â
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/urbit/arvo/issues/212>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALyAZpe1LcaZKv-lq_rRbkJhbTgq4EQks5qYsZ9gaJpZM4JTe9e>
.
<https://github.com/urbit/arvo/pull/203> ...
++ kulr ?($~ $r $g $b $c $m $y $k $w) :: color or default
++ decr ?($~ $bl $br $un) :: decor or default
++ styl (trel kulr decr tape) :: inline text
These seem to fall naturally out of basic terminal color/style support
(and the relevant ANSI codes...). A color is one of R/G/B, C/M/Y/K, white,
or null. A text decoration is blink, bright, underscore, or null. And a
piece of styled, inline text is a triple of color, decoration, and the text
itself. A line of output is therefore (list styl).
*(I'm making the assumption that background colors, hidden text, reversed
text, etc. are out of scope.)*
Wrapping this up as a ++sole-effect is pretty straightforward; something
like: {$klr p/(list styl)}. However, I can't shake the feeling that
colored output should be available at a lower level ...
The obvious use-cases are generators and unlinked apps that produce output
in response to pokes (as :hood does with |sync, |merge, etc.). I know the
long-term plan is for syslog-style output to be sent to a :talk channel,
but, even then, ++sole-effect doesn't quite feel natural...
If this were to be added to ++tank, I'd propose something like {$vein
p/styl}, and maybe even {$leaf p/?(tape (list {$vein styl}))}. I'm not
sure how it could fit with ++tanq.
Thoughts?
â
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/urbit/arvo/issues/212>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALyAZpe1LcaZKv-lq_rRbkJhbTgq4EQks5qYsZ9gaJpZM4JTe9e>
.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.