Basic Next: program with clarity.

A programming language for learning, exploring ideas, and building applications. Run code interpreted or compiled, work with data, and build web backends, with debugging built in.

Available for WindowsLinuxmacOS

invoice.bn
FUNCTION Start() AS VOID
    LET name AS STRING = "Ada"
    LET hours AS INTEGER = 12
    LET hourlyRate AS FLOAT = 87.5
    LET total AS FLOAT = (hours AS FLOAT) * hourlyRate

    PRINT name, "worked", hours, "hours"
    PRINT "Amount due:", total
END FUNCTION

Output

Ada worked 12 hours
Amount due: 1050.0

Features

What you can build with Basic Next

The standard library ships with the installation. Each module is imported by name, only when the program needs it.

Database applications

Use SQLite through the BNSqlite module: in-memory or file databases, transactions with Begin, Commit, and Rollback, and queries that return tables ready for analysis.

  • BNSqlite
  • BNData

See exampleReference (opens in a new tab)

Web backends

The BNWeb module registers explicit routes and filters to answer HTTP requests, validating URLs before they reach your code. In this release, web programs run on the bni interpreter.

  • BNWeb
  • HOST.Net

See exampleReference (opens in a new tab)

Math and statistics

BNMath brings mathematical functions — roots, powers, logarithms, trigonometry, rounding — and descriptive statistics: mean, median, mode, quartiles, variance, and standard deviation.

  • BNMath

See exampleReference (opens in a new tab)

Toolchain

Run, compile, and debug

Basic Next ships two programs: bni is the interpreter and bnc is the compiler. Both use the same front end and show the same error messages.

Interpreted execution

The bni interpreter runs a program straight from source, with no project file and no build step. Just pass the file: running is the default mode.

Terminal
bni hello.bn

Compilation

The bnc compiler produces a native executable or WebAssembly through LLVM. It needs clang installed and on your PATH.

Terminal
bnc hello.bn -o hello

Debugging

bni dap connects your editor to the debugger: breakpoints, stepping, and variable inspection. bni check validates a program without running it.

Terminal
bni check hello.bn

Integrations

Use your development tools

Write Basic Next in the editor you already use, or in notebooks for classes and analysis.

Examples

See Basic Next in action

Short programs, tested on version 0.6.8. The output shown is exactly what bni prints.

First program

Every program starts at FUNCTION Start(). Each block closes with its own END, and PRINT writes values separated by a space.

Dependencies
None
Run
bni hello.bn
hello.bn
FUNCTION Start() AS VOID
    PRINT "Hello, Basic Next"
END FUNCTION

Output

Hello, Basic Next

Installation

Get started on your system

Install, check the version, and run your first program in a few minutes.

Version 0.6.8 · Pre-alpha. Meant for experimentation; do not use it in business processes.

Requirements: Windows 10 or 11 (x86_64) with PowerShell. No administrator rights needed. To compile with bnc, also install clang (LLVM).

  1. Install

    In PowerShell, download and run the installer. It installs to %LOCALAPPDATA%\Programs\BasicNext and adds bin to your user PATH.

    PowerShell
    irm https://raw.githubusercontent.com/cquintella/BasicNext/main/scripts/install.ps1 | iex
  2. Check the installation

    Close and reopen the terminal to load the new PATH, then check the version.

    PowerShell
    bni --version

    Output

    bni 0.6.8
  3. Run your first program

    Save the code below as hello.bn and run it.

    hello.bn
    FUNCTION Start() AS VOID
        PRINT "Hello, Basic Next"
    END FUNCTION
    PowerShell
    bni hello.bn

    Output

    Hello, Basic Next

Principles

Why Basic Next

The language removes accidental difficulty — configuration, hidden conversions, cryptic syntax — so attention stays on the problem. That makes it good for working and for teaching.

Small core

Reserved words only for the essentials. Databases, web, and statistics arrive as modules imported by name: nothing is available unless the program asks for it.

Explicit types

Every variable, parameter, and return value states its type, as in LET total AS FLOAT. With no implicit conversions, readers see the contract and errors surface before the program runs.

Portability through capabilities

A program asks the environment for capabilities — HOST.FileSystem for files, HOST.Net for networking — instead of calling Windows or Linux APIs. The same code serves all three systems.

Made for teaching

Blocks close with END IF and END WHILE, failures show up in return types, and error messages explain cause and fix. Types, memory, and flow stay visible.

From the author

The idea behind the language

I created Basic Next to solve a problem I saw throughout my career in systems architecture, infrastructure, and teaching: the path from having an idea for a program to having that program working had grown too long. Switching languages or tools did not fix it.

What makes that path long is rarely the algorithm. It is build configuration, framework conventions, type conversions that happen without warning, and errors that only show up in production. All of it takes attention away from the problem itself.

Programming used to be fun. When the tool stops getting in the way, we enter a state of flow, and an idea becomes a program without friction. Basic Next aims to bring that state back. To do so, it combines the clarity of BASIC, the discipline of Pascal, and the small core of C. It was also designed to teach programming.

Carlos Alvaro Quintella, creator of Basic Next — adapted from the preface of the book.

Open source · MPL 2.0

Follow the project

Basic Next is developed in the open. Read it, try it, and follow every release.