Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.

The Oil Language from 10,000 Feet

This document describes the Oil language. It also discusses future work. Related Documents:

Table of Contents
Oil Retains These Shell Concepts
Syntactic Concepts
The Word Language Is Enhanced
Special Variables
The Command Language
New Keywords: var, const, setvar
Shell-Like Builtins
Docstrings and Multiline Commands
The Expression Language is Python-Like
Builtin Functions
Runtime Semantics
Data Structures
Process Model
Simple Word Evaluation With shopt -s simple_word_eval
Scope and Namespaces
Deferred Features
Appendix: Why an Upgrade?

Oil Retains These Shell Concepts

Oil retains them all. A big difference is that keywords rather than builtins are used for assignment.

Syntactic Concepts

See Syntactic Concepts in Oil

The Word Language Is Enhanced

See Oil Word Language.

Deferred: Static Printf, Formatters

echo ${myfloat %.3f}

Formatters (like template languages)

echo ${myfloat|json}

Special Variables

Special Variables

The Command Language

New Keywords: var, const, setvar

var x = 1

auto for autovivification:

auto dict['key'] += 1

maybe const. I want that to be compile-time though.

return has to be a keyword and not a builtin because it can take arbitrary data types, e.g.

return {name: 'bob', age: 15}

See Oil Keywords.

Shell-Like Builtins

See Oil Builtins.

Docstrings and Multiline Commands

Note: not implemented.

##

%%%

The Expression Language is Python-Like

The Expression Language Is Mostly Python

See Oil Expressions.

Builtin Functions

Python and shell both borrow from C. Oil borrows from Python and C.

Runtime Semantics

Data Structures

Data Types Are Mostly Python?

Process Model

Simple Word Evaluation With shopt -s simple_word_eval

Mentioned in the last post. This is big!

Scope and Namespaces

The use builtin will provide scope.

Deferred Features

Appendix: Why an Upgrade?

Hejlsberg quote?


Generated on Thu Mar 18 16:08:14 PDT 2021