Greetings!

First off, any person who would write either a language or a shell, now or in the future, should read your page, and in fact, should read everything about your Oil shell/language...

It's a laudable effort!

This page is going to my HN favorites, for future review.

What follows next are my thoughts about selected excerpts of text on the page (please don't interpret as criticism, that's not the intent):

>"You can think of a Unix shell in two ways:

1. As a text-based user interface. You communicate with the operating system by typing commands.

2. As a language. It has variables, functions, and loops. Shell programs are text files that start with #!/bin/sh."

[...]

>"Are you reinventing Perl?

It's true that Perl is closer to shell than Python and Ruby are. For example, the perl -pie idiom can take the place of awk and sed. However, Perl isn't an acceptable shell either:

o It doesn't have true pipelines (of processes). I believe you have to "shell out" for this.

o It doesn't have a concept of file descriptor state. How do you write the equivalent of my_shell_func 2> err.txt, where my_shell_func can invoke both functions and external commands?

o Perl has a function called grep(), but the real grep is better for many problems."

PDS: This touches upon a historic problem, which is basically that either:

A) Shell designers work their way "up" to a programming language, in which case some elegant programming language features are either not thought about, or not thought deeply enough about, and thus either not implmented, or implemented poorly / "non-orthagonally", AKA a "Kludge".

Or:

B) Language designers work their way "down" to supporting shell commands / a shell subsystem -- in which case some elegant shell features are either not thought about, or not thought deeply enough about, and thus either not implmented, or implemented poorly / "non-orthagonally", AKA a "Kludge".

Also, languages are typically too heavy in what they require typed for shell-scripters, and shells are typically too light in what they allow (and error checking/debugging features) for programmers writing large programs...

If someone were to design the most ideal programming language which also can be used for shell scripting, they'd have to look at things from both perspectives, and they'd have to create a language/shell -- completely balanced "down the middle" between these two paradigms...

Perhaps the Oil shell/programming language -- is, or will become that middle line...

To that extent, I wish you a lot of luck!

If I were going to go down this path, I'd look at "first principles" (Elon Musk):

The greatest differentiator between shell commands and lines of code in most programming languages is the point you alluded to in your comparison with Perl:

"o It doesn't have true pipelines (of processes). I believe you have to "shell out" for this."

In other words, in most programming languages (unless you are using threads), you are guaranteed linear execution.

In a Unix shell -- because you can run multiple commands that may take varying amounts of time to complete, this guarantee is no longer present...

That would be the fundamental thing to keep in mind when writing this future language/shell...

(A good program to test when writing this language would be a Web-server -- where the base server is a single script, and then when it detects a connection, passes this over to either a single separate command-line invoked Unix program or script comprising multiple such Unix programs linked with pipes, but the central "server" script has to handle a whole lot of simultaneous I/O from multiple such separate programs (it centralizes database access!), and do this in a simple way that script programmers would be comfortable with, while guaranteeing the correct data flows...)

Anyway, wishing you luck in this endeavor!