<story><title>Four features that justify a new Unix shell</title><url>http://www.oilshell.org/blog/2020/10/osh-features.html</url></story><parent_chain><item><author>chubot</author><text>I should turn this into a FAQ, but PowerShell is natural on Windows, where the OS provides objects (either via the .NET VM, or COM and .DLLs, etc.)&lt;p&gt;A Unix shell like bash or Oil is natural on Unix, where the OS uses text files.  And in distributed systems where data is JSON, YAML, XML, protobuf, msgpack, etc. not objects.&lt;p&gt;So basically shell is a &amp;quot;situated&amp;quot; language, and the easy of accomplishing any given task depends a lot on the environment.&lt;p&gt;Windows is more tightly coupled and trying to provide something nice for you.  Unix is messier but doesn&amp;#x27;t limit you, and it&amp;#x27;s what basically all big systems are made of these days.  A major strength of shell is to glue things together that nobody thought should be glued together.&lt;p&gt;---&lt;p&gt;Good example here from Paul Bucheit: &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.oilshell.org&amp;#x2F;blog&amp;#x2F;2020&amp;#x2F;01&amp;#x2F;simplest-explanation.html#productive-programmers-secretly-use-shell&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.oilshell.org&amp;#x2F;blog&amp;#x2F;2020&amp;#x2F;01&amp;#x2F;simplest-explanation.ht...&lt;/a&gt;&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;paulbuchheit.blogspot.com&amp;#x2F;2009&amp;#x2F;01&amp;#x2F;communicating-with-code.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;paulbuchheit.blogspot.com&amp;#x2F;2009&amp;#x2F;01&amp;#x2F;communicating-with-...&lt;/a&gt;&lt;p&gt;&lt;i&gt;However, we needed a way for Gmail to make money, and Sanjeev Singh kept talking about using relevant ads, even though it was obviously a &amp;quot;bad idea&amp;quot;. I remained skeptical, but thought that it might be a fun experiment, so I connected to that ads database (I assure you, random engineers can no longer do this!), copied out all of the ads+keywords, and did a little bit of sorting and filtering with some UNIX SHELL COMMANDS&lt;/i&gt;&lt;p&gt;&lt;i&gt;I then hacked up the &amp;quot;adult content&amp;quot; classifier that Matt Cutts and I had written for safe-search, linked that into the Gmail prototype, and then loaded the ads data into the classifier. My change to the classifier (which completely broke its original functionality, but this was a separate code branch) changed it from classifying pages as &amp;quot;adult&amp;quot;, to classifying them according to which ad was most relevant. The resulting ad was then displayed in a little box on our Gmail prototype ui. The code was rather ugly and hackish, but more importantly, it only took a few hours to write!&lt;/i&gt;&lt;p&gt;----&lt;p&gt;Also, use whatever&amp;#x27;s best for you, but Unix people tend to hate PowerShell:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;medium.com&amp;#x2F;@octskyward&amp;#x2F;the-woes-of-powershell-8737e5346b1&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;medium.com&amp;#x2F;@octskyward&amp;#x2F;the-woes-of-powershell-8737e5...&lt;/a&gt;&lt;p&gt;&lt;i&gt;PowerShell feels like it was built by people who had heard about command lines a long time ago and tried to recreate one based on stories passed down through generations of their ancestors&lt;/i&gt;&lt;p&gt;The fact that they cargo-culted operators like -eq, -le, -lt, while not maintaining compatibility is just silly to me.  In Oil it&amp;#x27;s &amp;quot;x == y&amp;quot; for string equality.</text></item><item><author>solarkraft</author><text>OSH is probably a good incremental improvement over bash, but I also enjoy using the significantly more tradition-breaking Powershell with its object oriented nature.&lt;p&gt;It feels a lot more like programming and actually gives you useful suggestions right inside the terminal!&lt;p&gt;On Linux the auto completion behavior is luckily less obnoxious than on Windows and it doesn&amp;#x27;t have the multi second startup delay either.</text></item></parent_chain><comment><author>com2kid</author><text>&amp;gt; I connected to that ads database (I assure you, random engineers can no longer do this!), copied out all of the ads+keywords, and did a little bit of sorting and filtering with some UNIX SHELL COMMANDS&lt;p&gt;One of PowerShell&amp;#x27;s nifty tricks includes being able to walk a SQL DB like its a file system, see &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.microsoft.com&amp;#x2F;en-us&amp;#x2F;sql&amp;#x2F;powershell&amp;#x2F;navigate-sql-server-powershell-paths?view=sql-server-ver15&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.microsoft.com&amp;#x2F;en-us&amp;#x2F;sql&amp;#x2F;powershell&amp;#x2F;navigate-sql...&lt;/a&gt;&lt;p&gt;PowerShell is &lt;i&gt;insanely&lt;/i&gt; flexible.</text></comment>
<story><title>Four features that justify a new Unix shell</title><url>http://www.oilshell.org/blog/2020/10/osh-features.html</url></story><parent_chain><item><author>chubot</author><text>I should turn this into a FAQ, but PowerShell is natural on Windows, where the OS provides objects (either via the .NET VM, or COM and .DLLs, etc.)&lt;p&gt;A Unix shell like bash or Oil is natural on Unix, where the OS uses text files.  And in distributed systems where data is JSON, YAML, XML, protobuf, msgpack, etc. not objects.&lt;p&gt;So basically shell is a &amp;quot;situated&amp;quot; language, and the easy of accomplishing any given task depends a lot on the environment.&lt;p&gt;Windows is more tightly coupled and trying to provide something nice for you.  Unix is messier but doesn&amp;#x27;t limit you, and it&amp;#x27;s what basically all big systems are made of these days.  A major strength of shell is to glue things together that nobody thought should be glued together.&lt;p&gt;---&lt;p&gt;Good example here from Paul Bucheit: &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.oilshell.org&amp;#x2F;blog&amp;#x2F;2020&amp;#x2F;01&amp;#x2F;simplest-explanation.html#productive-programmers-secretly-use-shell&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.oilshell.org&amp;#x2F;blog&amp;#x2F;2020&amp;#x2F;01&amp;#x2F;simplest-explanation.ht...&lt;/a&gt;&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;paulbuchheit.blogspot.com&amp;#x2F;2009&amp;#x2F;01&amp;#x2F;communicating-with-code.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;paulbuchheit.blogspot.com&amp;#x2F;2009&amp;#x2F;01&amp;#x2F;communicating-with-...&lt;/a&gt;&lt;p&gt;&lt;i&gt;However, we needed a way for Gmail to make money, and Sanjeev Singh kept talking about using relevant ads, even though it was obviously a &amp;quot;bad idea&amp;quot;. I remained skeptical, but thought that it might be a fun experiment, so I connected to that ads database (I assure you, random engineers can no longer do this!), copied out all of the ads+keywords, and did a little bit of sorting and filtering with some UNIX SHELL COMMANDS&lt;/i&gt;&lt;p&gt;&lt;i&gt;I then hacked up the &amp;quot;adult content&amp;quot; classifier that Matt Cutts and I had written for safe-search, linked that into the Gmail prototype, and then loaded the ads data into the classifier. My change to the classifier (which completely broke its original functionality, but this was a separate code branch) changed it from classifying pages as &amp;quot;adult&amp;quot;, to classifying them according to which ad was most relevant. The resulting ad was then displayed in a little box on our Gmail prototype ui. The code was rather ugly and hackish, but more importantly, it only took a few hours to write!&lt;/i&gt;&lt;p&gt;----&lt;p&gt;Also, use whatever&amp;#x27;s best for you, but Unix people tend to hate PowerShell:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;medium.com&amp;#x2F;@octskyward&amp;#x2F;the-woes-of-powershell-8737e5346b1&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;medium.com&amp;#x2F;@octskyward&amp;#x2F;the-woes-of-powershell-8737e5...&lt;/a&gt;&lt;p&gt;&lt;i&gt;PowerShell feels like it was built by people who had heard about command lines a long time ago and tried to recreate one based on stories passed down through generations of their ancestors&lt;/i&gt;&lt;p&gt;The fact that they cargo-culted operators like -eq, -le, -lt, while not maintaining compatibility is just silly to me.  In Oil it&amp;#x27;s &amp;quot;x == y&amp;quot; for string equality.</text></item><item><author>solarkraft</author><text>OSH is probably a good incremental improvement over bash, but I also enjoy using the significantly more tradition-breaking Powershell with its object oriented nature.&lt;p&gt;It feels a lot more like programming and actually gives you useful suggestions right inside the terminal!&lt;p&gt;On Linux the auto completion behavior is luckily less obnoxious than on Windows and it doesn&amp;#x27;t have the multi second startup delay either.</text></item></parent_chain><comment><author>Denvercoder9</author><text>There&amp;#x27;s nothing inherent about an object-based design that limits what you can glue together. Yes, it might require a bit more effort to transform object formats, but today&amp;#x27;s untyped shell also creates problems that don&amp;#x27;t exist in a typed environment.</text></comment>