A modern, compiled BASIC / Linux x86-64

Familiar roots.
Room to grow.

BASIL brings the clarity of BASIC to modern native programming. Static types, safe ownership, and lightweight tasks — with a syntax you can read at a glance.

No interpreter. No ceremony. Just your program.

BASIL — Back to the BASICS
01 / A FAMILIAR BEGINNINGPRINT "Hello, world!"
BASIC readabilityChecked ownershipNative executionStructured concurrency
01 — The language

Simple to start.
Substantial by design.

The compiler does the bookkeeping.
You express the work.
Grow from a one-line utility to a native application without changing languages.

01 / CLARITY

Readable, with real types.

Type inference keeps the small things small. Records, choices, generics and typed collections give larger programs a solid structure.

Meet the language ↗
02 / OWNERSHIP

Safety without a collector.

Independent values, checked borrowing and explicit resource transfers. Files and other owners clean up deterministically, including on failure.

Understand ownership ↗
03 / CONCURRENCY

Let your program do more.

Stackful coroutines, typed tasks, channels and SELECT. Ordinary functions can suspend without spreading async syntax through your code.

Work with tasks ↗
04 / NATIVE

From source to executable.

A self-hosted compiler and integrated native linker. Ordinary application builds produce standalone Linux executables, with unused components omitted.

Build your first program ↗
02 — A little code goes a long way

Looks familiar.
Goes further.

Real BASIL. Small, complete examples.
Choose a starting point and see what comes next.

Independent by default

A copy is your own.

Copyable values have independent contents. Updating a copied list leaves the original untouched. Read-only parameters borrow; BYREF explicitly permits mutation.

Values, borrowing & ownership →
independent.bas BASIL
original = [10, 20, 30]
copy = original
copy[0] = 99

PRINT original[0]
PRINT copy[0]
OUTPUT
10
99
Data with a shape

From JSON to your types.

Decode straight into a record. Defaults handle missing fields, and invalid supplied data raises a checked error. No hand-written field extraction.

Explore typed serialization →
customer.bas BASIL
TYPE Customer
    Id AS INTEGER
    Name AS STRING = "Unknown"
END TYPE

customer = DecodeJSON("{""Id"":42}") AS Customer
PRINT customer.Id
PRINT customer.Name
OUTPUT
42
Unknown
Concurrency you can follow

Start work. Keep the result.

A typed task owns its running work. Join it to observe a result or cancellation, with errors routed through the normal checked error model.

Coroutines & concurrent tasks →
task.bas BASIL
worker = SPAWN Square(12)
IF LET answer = Join(worker) THEN
    PRINT answer
ELSE
    PRINT "Cancelled"
END IF

FUNCTION Square(value AS INTEGER) AS INTEGER
    RETURN value * value
END FUNCTION
OUTPUT
144
Pixels, without a window

A native creative toolkit.

Create images, draw shapes and text, and encode PNGs without a GUI or external image library. Canvas follows the same checked ownership rules as your code.

Discover Canvas →
picture.bas BASIL
image = NewCanvas(320, 120)
ClearCanvas(BYREF image, RGB(17, 21, 16))
FillRect(BYREF image, 20.0, 20.0, 80.0, 80.0,
    RGB(103, 200, 0))
DrawBitmapText(BYREF image, "BASIL", 120, 50,
    RGB(240, 245, 235), scale=2)
SaveImage(image, "hello.png")
PRINT "Saved hello.png"
OUTPUT
Saved hello.png

These are native programs, not an in-browser interpreter. Build and run them locally ↗

03 — Ready for real work
04 — Learn at your own pace

A proper manual.
From the beginning.

Not just a list of functions. A guided path from hello, world to borrowing, coroutines and complete applications — with examples along the way.

  • 25 teaching chapters, from first principles
  • Detailed built-in and library references
  • A searchable web edition and an offline PDF
Your next line starts here

Back to the joy
of making things.

Write your first program →Or take a look under the hood ↗

Find your way around BASIL

Type to search the manual.