Skip to main content
SHE logo

SHE

A programming language that reads like English — and can't touch your machine unless you say so.

CI PyPI Python License Try it

Try it now · Docs · Examples · Discussions


let name = ask "What is your name?"
say "Hello, {name}!"

let numbers = [4, 8, 15, 16, 23, 42]

say numbers
  |> filter(fun(n) -> n % 2 is 0)
  |> map(fun(n) -> n / 2)
  |> sum()

That is the whole language: say what you mean, in the order you'd say it out loud.


Why another language?

Most languages ask you to choose. Readable or capable. Friendly or safe. A toy you outgrow in a week, or a professional tool with a month-long ramp.

SHE refuses the trade.

1. It reads like a sentence

No braces. No semicolons. No significant whitespace to get wrong. Blocks end with end, comparisons use is, and loops say for each item in items. A person who has never programmed can read a SHE file and mostly follow it.

type Account has owner: text, balance: number = 0
  fun deposit(self, amount)
    if amount <= 0 then throw "a deposit has to be positive"
    self.balance += amount
    return self.balance
  end
end

let account = Account("Ada")
say account.deposit(50)

But it is not verbose. There is no public static void, no ceremony, no boilerplate file you must write before the first line that does something.

2. It has no power until you grant it

This is the part that matters. A SHE program starts with nothing: it cannot read a file, open a socket, start a process, or read an environment variable.

she run report.she                       # arithmetic only — nothing else is possible
she run report.she --allow-read=./data   # now it can read that one folder
she run report.she --allow-net=api.stripe.com

Try to do something ungranted and SHE tells you exactly which flag would allow it:

PermissionError: report.she tried to read files from disk (~/.ssh/id_rsa),
                 but was not given permission
  --> report.she:14:12
     |
  14 |   let key = fs.read("~/.ssh/id_rsa")
     |             ^^^^^^^
  help: run it with `--allow-read=~/.ssh/id_rsa` to permit this,
        or `--allow-all` while you are developing.

You can hand someone a SHE script and know from the command line alone what it is able to touch. That is a property no mainstream scripting language gives you.

3. The errors teach instead of scold

Every error points at the source, says what went wrong in plain words, and suggests the fix.

NameError: `totl` has not been defined yet
  --> budget.she:7:5
     |
   7 | say totl
     |     ^^^^
  help: did you mean `total`?
TypeError: `x` was declared with `let`, so it cannot be changed
  --> counter.she:3:1
     |
   3 | x = 2
     | ^
  help: use `var x = ...` if it needs to change.

Install

pip install she-lang

Then:

she                          # interactive prompt
she run hello.she            # run a program
she new my-project           # scaffold a project
she test                     # run tests
she fmt                      # format code

Nothing to compile, no toolchain to install. If you have Python 3.9+, you have SHE.

Optional extras — SHE works fully without these:

pip install "she-lang[all]"   # adds the crypto and web modules

crypto works on any supported Python. web wraps WebWeaveX, which needs Python 3.10 or newer — on 3.9 it is skipped and the module tells you so.


A tour in sixty seconds

Values and text

let pi = 3.14159        # cannot change
var count = 0           # can change
count += 1

say "pi is about {pi}"
say "a {{literal}} brace"

Deciding

if age >= 18
  say "you can vote"
else if age >= 16
  say "nearly there"
else
  say "not yet"
end

let price = if member then 20 else 40

Repeating

for each item in shopping
  say item
end

for each n in 1..10 by 2
  say n
end

repeat
  tries += 1
until tries >= 3

Functions

fun greet(who = "world") -> "Hello, {who}!"

fun total(...numbers) -> sum(numbers)

let double = fun(n) -> n * 2

say rectangle(width: 4, height: 3)

Matching

match value
  case 0 -> "nothing"
  case 1 | 2 | 3 -> "a few"
  case n if n < 0 -> "below zero"
  case [first, ...rest] -> "a list"
  case {name: n} -> "called {n}"
  case Point(x, y) -> "at {x},{y}"
  case _ -> "something else"
end

When things go wrong

try
  risky()
catch e: MathError
  say "maths problem: {e.message}"
catch e
  say "something else: {e.kind}"
finally
  say "cleaned up"
end

Everything it has

Values numbers, text, booleans, nothing, lists, maps, ranges, functions, your own types
Text interpolation "hi {name}", triple-quoted blocks, raw r"...", full text library
Control flow if/else if/else, while, repeat until, for each, break, skip, match
Functions defaults, named arguments, rest ...args, spread, closures, lambdas, recursion
Types type X has a, b, methods, inheritance, setup and to_text hooks
Pattern matching literals, ranges, or-patterns, guards, list and map destructuring, type patterns
Errors try/catch/finally, throw, catch by kind, assert
Gradual typing let n: number, fun f(a: text): number, unions — checked at runtime, never required
Concurrency async fun, await, await a whole list of tasks
Modules import math, from math import sqrt, use "./helpers.she" as helpers
Modern sugar pipelines |>, safe navigation ?., defaults ??, method syntax on every value
Testing test "name" ... end blocks with expect, run by she test
Security capability sandbox, step and time budgets, vetted crypto primitives
Tooling REPL, formatter, test runner, project scaffolder, doc browser, language server

Full reference: ni-sh-a-char.github.io/SHE/docs.html


Batteries included

import math      # sqrt, round, clamp, prime?, mean, median, stdev, trigonometry
import json      # parse, stringify, pretty
import re        # matches?, find_all, replace, split
import time      # now, today, format, parse, sleep
import random    # whole, choice, shuffle, dice, uuid
import csv       # parse, stringify
import crypto    # hash, hmac, password_hash, token, Kaalka encryption
import fs        # read, write, list, walk           [needs --allow-read/write]
import http      # get, post, json, download          [needs --allow-net]
import os        # env, run, platform                 [needs --allow-env/run]
import web       # extract, crawl, fingerprint        [needs --allow-net]

text, list, math, json, re, time and random are always available — no import needed. Everything that can touch the outside world must be imported and granted.


Two libraries, built in

SHE ships first-class bindings for two projects, exposed as ordinary modules.

cryptoKaalka

Encryption whose key is a moment in time.

import crypto

let sealed = crypto.seal("meet at the bridge", "14:35:22")
say crypto.open(sealed, "14:35:22")

# Envelopes add sender, recipient and a checksum
let packet = crypto.envelope("the eagle has landed", "ada", "bob")
say crypto.open_envelope(packet, "bob")

seal / open armour Kaalka's output as base64 so ciphertext survives a file, a URL or a JSON field — raw Kaalka output does not.

Said plainly: Kaalka is a novel construction that has not been through public cryptanalysis. SHE ships it for time-keyed handoff, puzzles and teaching. For secrets that matter, the same module gives you crypto.hash, crypto.hmac, crypto.password_hash and crypto.token, which wrap vetted primitives. A language should be honest about which is which.

webWebWeaveX

Turn a live app, a repository or a document into a deterministic graph.

import web

let graph = web.extract("https://example.com", "web")
say "{web.nodes(graph).length} nodes, {web.edges(graph).length} edges"

# The same input always produces the same identity
say web.fingerprint(graph)

Editor support

The VS Code extension in editors/vscode gives syntax highlighting, snippets, and live diagnostics via SHE's built-in language server.

cd editors/vscode && npm install && npm run package
code --install-extension she-lang-2.0.0.vsix

Any editor that speaks LSP can use she lsp directly.


Who it is for

Never programmed before? Start with examples/01-hello.she. The errors are written for you, and nothing you run can damage anything.

A student? Every feature you will be taught — recursion, closures, pattern matching, types, concurrency — is here, without a build system in the way.

A developer? Pipelines, destructuring, gradual types, a real test runner, a formatter and an LSP. pip install, and the whole toolchain is there.

Security work? Capability sandboxing, step and time budgets for running untrusted code, hashing, HMAC, password storage and token generation in the box.

A team? Scripts whose reach is declared on the command line and enforced by the runtime. Code review of a SHE script means reading one line of flags.


Contributing

Contributions are genuinely welcome — see CONTRIBUTING.md.

git clone https://github.com/ni-sh-a-char/SHE.git
cd SHE
pip install -e ".[dev]"
pytest              # the Python test suite
she test examples   # SHE's own tests

Good first issues are labelled good first issue. Adding a standard-library function is about ten lines and a docstring.


Support the project

SHE is free, Apache-2.0, and built in the open. If it saved you time, taught you something, or you just want to see it keep going:

Buy me a coffee

Starring the repo helps more people find it, and costs nothing. ⭐


Versions

Version What it is
2.0 (main) The language documented here — rewritten from scratch
1.0 (v1.0.0 branch) The original BASIC-style interpreter, kept for history

SHE 2.0 is not compatible with 1.0. The changelog explains why, and what changed.


Licence

Apache 2.0 — see LICENCE. Use it for anything, including commercially.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

she_lang-2.0.0.tar.gz (98.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

she_lang-2.0.0-py3-none-any.whl (91.0 kB view details)

Uploaded Python 3

File details

Details for the file she_lang-2.0.0.tar.gz.

File metadata

  • Download URL: she_lang-2.0.0.tar.gz
  • Upload date:
  • Size: 98.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for she_lang-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8aea09266fb0d68589dc5cb8111d1aa6b511369004c83f2e8b22c8ba429e2392
MD5 02847b2e9651a101c3cf6c08e8138efb
BLAKE2b-256 e541717b56162f93698453bbab1cca43b05b00eeebf7f94301a7d31dca6f2397

See more details on using hashes here.

Provenance

The following attestation bundles were made for she_lang-2.0.0.tar.gz:

Publisher: release.yml on ni-sh-a-char/SHE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file she_lang-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: she_lang-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 91.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for she_lang-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf75eae01d6891a5ae5c566b266b8038bdd53415f653bf22ca30118e954a2bbc
MD5 b700e721f5f2cb3f0cfb02f78dc35aac
BLAKE2b-256 5764e5edcfa18baa030e91c59006dbacbec9aa01215412148a993c6bedc037e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for she_lang-2.0.0-py3-none-any.whl:

Publisher: release.yml on ni-sh-a-char/SHE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.1

2 files

This release

2.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page