Reads like a sentence.
-- Declare a variable.
let name be "Period".
show name.
Keywords like let, be, and show make intent obvious at a glance.
An English programming language designed to read like an article. Every statement ends with a period, giving your code a calm, literary rhythm.
Period blends the precision of programming with the flow of natural language.
Statements read like sentences. Keywords such as let, be, and show make intent obvious.
Errors report the exact line and column range. The parser recovers to report multiple issues at once.
Implemented in Python and packaged into a single executable with Nuitka for quick run cycles.
Import built-in modules such as math, string, random, time, json, and os. Local modules and relative imports are supported too.
Variables, conditionals, loops, recursive functions, lists, dictionaries, and classes provide full computing power.
Summing 1..N with a while loop. Lower is better.
Benchmarked with benchmark_long.py. Period compiles the loop to a cached DLL and runs it in-process, so both 1M and 5M iterations beat the equivalent C program compiled with TCC.
A warm greeting in three lines. Every statement ends with a period.
-- Greet the world.
let greeting be "Hello, World!".
show greeting.
-- Declare a variable.
let name be "Period".
show name.
Keywords like let, be, and show make intent obvious at a glance.
hello.period:2:11: error: Expected '.' at end of statement.
2 | show name
| ^
The parser recovers from errors and reports every issue with exact line and column ranges.
Syntax highlighting, hover hints, auto-completion, formatting, go-to-definition, and live LSP diagnostics.
code --install-extension period-language.vsix
-- A recursive factorial.
define factorial with n:
if n <= 1 then:
return 1.
return n * factorial with (n - 1).
Define functions with plain English and call them with with.
$ period
>>> let x be 10.
>>> show x * 2.
20
>>> exit.
Run period without arguments to start the interactive shell.
Click a tab to switch examples. The same sentence-like style runs everywhere.
-- Greet the world.
let greeting be "Hello, World!".
show greeting.
-- Count to five.
let i be 1.
while i <= 5 repeat:
show i.
set i to i + 1.
-- A recursive factorial.
define factorial with n:
if n <= 1 then:
return 1.
return n * factorial with (n - 1).
-- A tiny class.
class Person:
init with name:
set this name to name.
define greet with greeting:
show greeting + ", " + this name + "!".
let ada be new Person with "Ada".
tell ada to greet with "Hello".
Download the latest release, install it in seconds, and write your first sentence-like program.