<story><title>Terminal escape sequences in Git commit email field</title><url>https://twitter.com/ryancdotorg/status/1375484757916672000</url></story><parent_chain><item><author>Scene_Cast2</author><text>When I type &amp;quot;ls&amp;quot;, I&amp;#x27;m getting a text-serialized list of objects.  Why can&amp;#x27;t I just get the (serializable) list directly? So that I don&amp;#x27;t have to mess with (implicitly) converting text back to objects, often involving regex and hacks.</text></item><item><author>enriquto</author><text>&amp;gt; it&amp;#x27;s a very hard problem to solve since everyone has subscribed to Unix&amp;#x27;s philosophy of &amp;quot;everything is text&amp;quot;.&lt;p&gt;Look at it the other way round.  Embrace text.  Text is not the problem, non-text is.  You&amp;#x27;ll take text from our cold, dead hands!</text></item><item><author>junon</author><text>I maintain chalk and a slew of other TTY related things.&lt;p&gt;Terminal emulators are, far and away, the most archaic computer technology we still use daily.&lt;p&gt;Believe me when I say, it&amp;#x27;s a very hard problem to solve since everyone has subscribed to Unix&amp;#x27;s philosophy of &amp;quot;everything is text&amp;quot;.&lt;p&gt;As much as I dislike Microsoft&amp;#x27;s philosophies on software, they had the right idea with Powershell. Its execution is just abysmal.&lt;p&gt;Expect this stuff to change drastically in the next 5 years.</text></item></parent_chain><comment><author>mysterymath</author><text>Because the objects are probably either relatively deeply encoded inside hundreds of plain-C stack and heap locations, or they&amp;#x27;re not even fully resident in RAM anymore by the time output occurs.&lt;p&gt;It&amp;#x27;s not that uncommon for ol&amp;#x27; C hackers to directly write those stack and heap locations out to disk and call it a &amp;quot;file format.&amp;quot; Trouble is, you&amp;#x27;re almost entirely at the whims of your platform and compiler as to what the actual layout of that is.&lt;p&gt;If you&amp;#x27;re thinking, &amp;quot;well that&amp;#x27;s dumb, why doesn&amp;#x27;t C have a standardized representation for those in-memory objects that  hides platform differences&amp;quot;, it does: printf and scanf.&lt;p&gt;Text isn&amp;#x27;t necessarily a &lt;i&gt;great&lt;/i&gt; answer to that problem, but it definitely is an answer. Others include packed structs with htonl and friends and low-overhead serialization formats like protobuf, Thrift, and Avro. Inside, say, Google, you have &amp;quot;everything is a protobuf&amp;quot; instead of &amp;quot;everything is text,&amp;quot; and it does end up working roughly as well as you might expect. That is to say, reasonably well, but with its own sets of problems that people won&amp;#x27;t ever stop complaining about.</text></comment>
<story><title>Terminal escape sequences in Git commit email field</title><url>https://twitter.com/ryancdotorg/status/1375484757916672000</url></story><parent_chain><item><author>Scene_Cast2</author><text>When I type &amp;quot;ls&amp;quot;, I&amp;#x27;m getting a text-serialized list of objects.  Why can&amp;#x27;t I just get the (serializable) list directly? So that I don&amp;#x27;t have to mess with (implicitly) converting text back to objects, often involving regex and hacks.</text></item><item><author>enriquto</author><text>&amp;gt; it&amp;#x27;s a very hard problem to solve since everyone has subscribed to Unix&amp;#x27;s philosophy of &amp;quot;everything is text&amp;quot;.&lt;p&gt;Look at it the other way round.  Embrace text.  Text is not the problem, non-text is.  You&amp;#x27;ll take text from our cold, dead hands!</text></item><item><author>junon</author><text>I maintain chalk and a slew of other TTY related things.&lt;p&gt;Terminal emulators are, far and away, the most archaic computer technology we still use daily.&lt;p&gt;Believe me when I say, it&amp;#x27;s a very hard problem to solve since everyone has subscribed to Unix&amp;#x27;s philosophy of &amp;quot;everything is text&amp;quot;.&lt;p&gt;As much as I dislike Microsoft&amp;#x27;s philosophies on software, they had the right idea with Powershell. Its execution is just abysmal.&lt;p&gt;Expect this stuff to change drastically in the next 5 years.</text></item></parent_chain><comment><author>theamk</author><text>You are not supposed to parse &amp;quot;ls&amp;quot; (unless this is &amp;quot;ls -1&amp;quot;), because that format is only for humans, and defaults change all the time.&lt;p&gt;If you are parsing &amp;quot;ls -l&amp;quot; output, you are doing something wrong.&lt;p&gt;Use your language built-in features, every language has them (for example in bash, use *-expansion and [-commands). If they don&amp;#x27;t work for some reason, there is &amp;quot;stat -c&amp;quot; and &amp;quot;find .. -printf&amp;quot;, which both produce text which is absolutely trivial to parse.</text></comment>