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 ↗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.
PRINT "Hello, world!"The compiler does the bookkeeping.
You express the work.
Grow from a one-line utility to a native application without changing languages.
Type inference keeps the small things small. Records, choices, generics and typed collections give larger programs a solid structure.
Meet the language ↗Independent values, checked borrowing and explicit resource transfers. Files and other owners clean up deterministically, including on failure.
Understand ownership ↗Stackful coroutines, typed tasks, channels and SELECT. Ordinary functions can suspend without spreading async syntax through your code.
Work with tasks ↗A self-hosted compiler and integrated native linker. Ordinary application builds produce standalone Linux executables, with unused components omitted.
Build your first program ↗Real BASIL. Small, complete examples.
Choose a starting point and see what comes next.
Copyable values have independent contents. Updating a copied list leaves the original untouched. Read-only parameters borrow; BYREF explicitly permits mutation.
original = [10, 20, 30]
copy = original
copy[0] = 99
PRINT original[0]
PRINT copy[0]10 99
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 →TYPE Customer
Id AS INTEGER
Name AS STRING = "Unknown"
END TYPE
customer = DecodeJSON("{""Id"":42}") AS Customer
PRINT customer.Id
PRINT customer.Name42 Unknown
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 →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 FUNCTION144
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 →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"Saved hello.png
These are native programs, not an in-browser interpreter. Build and run them locally ↗
Text and data. Networks and databases. Images and interfaces. BASIL’s standard library handles the everyday work, with additional libraries when your application needs more.
Explore the libraries →Not just a list of functions. A guided path from hello, world to borrowing, coroutines and complete applications — with examples along the way.