Pharos

A first programming language that reads like English

Pharos is a lighthouse: something to steer by while you are still learning the waters. The language exists for the awkward moment after Scratch, when coloured blocks stop being enough but curly braces and semicolons are still a wall.

print "Hello, world"
Hello, world

Why it looks like this

Most of what trips up a beginner in a first real language has nothing to do with programming. It is punctuation. A missing semicolon, a stray brace, an elif that should have been else if. Pharos moves that difficulty out of the way by spelling things out: is greater than rather than >, otherwise rather than else, end if rather than a closing brace.

You still learn the ideas that matter, because they are the same ideas everywhere: values have types, conditions choose between paths, loops repeat, and named blocks of program can be reused. Only the spelling is gentler.

num score = 82

if score is greater than 89 then
  print "an A"
otherwise if score is greater than 79 then
  print "a B"
otherwise
  print "keep going"
end if
a B

Mistakes are explained, not punished

Pharos knows what kind of value each variable is meant to hold, and says so plainly when something does not fit. Error messages name the line and the problem in ordinary words.

num score = 7
score = "seven"
line 2: "score" was declared as num, so it cannot hold a string

A loop whose condition can never be met is stopped and reported rather than left to spin forever, and so is a codeblock that calls itself without end. Nothing hangs the machine while you are figuring things out.

Getting it running

Pharos is written in Go, so you need Go 1.23 or newer. With that in place:

git clone https://github.com/abhinavtripathy/pharos.git
cd pharos
go build -o pharos ./cmd/pharos

Then run one of the bundled programs:

./pharos run examples/hello.pharos

Or type at it directly, one line at a time, which is the quickest way to try an idea out:

./pharos repl

Prefer to skip the clone? go install github.com/abhinavtripathy/pharos/cmd/pharos@latest puts the pharos command straight on your path.

Where to go next

The guide walks through the whole language from printing a line to writing your own codeblocks, and it is meant to be read in order. The reference is the short version: every keyword in a handful of tables. The examples are complete programs you can run unchanged, each shown with exactly what it prints.

Start the guide →