1. 21
  1.  

  2. 3

    Thanks for your great work on Oil!

    On a somewhat unrelated note, I really like the simplicity of Oil’s website. Is the source code used for generating it open source?

    1. 3

      Glad it’s appreciated!

      I haven’t released the site’s code… it’s a pretty messy mix of shell, Python, Make, markdown, and some of my own tools for generating shell snippets and syntax highlighting (with pygments). And of course there HTML, CSS, and JS which I cobbled together over the years. Copied and pasted from different projects.

      Ironically it’s a testament to both the power of the Unix philosophy and the messiness. On the one hand, I think it produces a pretty good result with a low amount of development effort. On the other hand, I don’t think anybody could maintain it besides me :-/

      Hopefully I’ll be able to port most of it to Oil at some point far in the future :) Combining shell, Make, and Python into the same language would be really useful, but it’s of course a lot of work. If nothing else it’s a good use case for taking the Unix philosophy pretty far.

      1. 1

        Haha that’s interesting :) And I agree with you on the power and messiness of the Unix philosphy.

        Thanks for the explanations, and I look forward to whatever may come of it later in the future!

        1. 1

          Disagree with the messiness being because of the unix philosophy…

          You can hack things together in any language. The difference with unix is you end up with ad hoc scripts. It’s possible to make sure your scripts are useful as standalone items and document them.

          1. 2

            That’s a fair argument I suppose, but to be honest, personally I haven’t found myself reusing my scripts a ton over the years. Sure, there’s definitely been some cases, but I’ve found that usually my use cases tend to not generalize too well and thus I don’t end up reusing all that much. So, for me, the drawbacks of using typical scripting languages (weird semantics, lack of proper types and a type system) usually outweigh the benefits in the context of the Unix philosophy.

            That’s with usual scripting languages though. One thing I’ve been trying recently and has turned out to be interesting is using Haskell for scripting as well, and not just for larger programs. It seems to give me a nice balance between composability from the Unix philosophy and maintenance of my sanity by having Haskell’s awesome type system at hand. I’m thinking of forcing myself to exclusively use Haskell along with Turtle as my scripting language for a while and see how far I can push it and how it compares to “traditional” scripting languages.

            1. 2

              To be clearer, my point is somewhat orthogonal to making standalone scripts and documenting them.

              It’s more about “language cacophony”. Shell and Python work pretty well together, but shell and make don’t. They awkwardly encroach on each others’ territory, both semantically and syntactically. But I can’t just choose one or the other – I need Make for incremental builds of my blog.

              The soup of document formats has a lot of downsides too. But I think it’s the best tool for the job or I wouldn’t use this.

              Also, I think reuse is somewhat overrated, although reuse in Unix is different than say reuse in Python or Java.

              I quoted Knuth on the subject in this post: http://www.oilshell.org/blog/2016/12/27.html

              I would also say that attempting to “reuse” makefiles is mostly folly. Even shell has limited opportunities for use. The way I “reuse code in shell” is to write a standalone Python script that can be called from multiple scripts.