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.
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
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
The standard library ships with the installation. Each module is imported by name, only when the program needs it.
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.
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.
BNMath brings mathematical functions — roots, powers, logarithms, trigonometry, rounding — and descriptive statistics: mean, median, mode, quartiles, variance, and standard deviation.
Toolchain
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.
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.
bni hello.bn
The bnc compiler produces a native executable or WebAssembly through LLVM. It needs clang installed and on your PATH.
bnc hello.bn -o hello
bni dap connects your editor to the debugger: breakpoints, stepping, and variable inspection. bni check validates a program without running it.
bni check hello.bn
Technical details: toolchain and the bni(1) and bnc(1) manuals (opens in a new tab)
Integrations
Write Basic Next in the editor you already use, or in notebooks for classes and analysis.
Syntax highlighting, standard-module snippets, and run with integrated debugging through bni dap.
Highlighting, indentation, :BasicNextRun to run the file, and :make to list errors in the quickfix list. Installs with one git clone.
A kernel that runs Basic Next cells in notebooks, mixing code, results, and explanations — useful for teaching and data analysis.
Examples
Short programs, tested on version 0.6.8. The output shown is exactly what bni prints.
Every program starts at FUNCTION Start(). Each block closes with its own END, and PRINT writes values separated by a space.
FUNCTION Start() AS VOID
PRINT "Hello, Basic Next"
END FUNCTION
Output
Hello, Basic Next
Opens an in-memory database, creates a table, inserts rows, and reads the result as a data table (DataFrame).
Operations that can fail return … OR Error: the program handles the error before using the value.
IMPORT BNData AS Data
IMPORT BNSqlite AS Sqlite
FUNCTION Start() AS VOID
LET db AS Sqlite.Connection OR Error = Sqlite.Open(":memory:")
IF db IS Error THEN
PRINT "Error:", db.Message
RETURN
END IF
db.Exec("CREATE TABLE books (title TEXT, year INTEGER);")
db.Exec("INSERT INTO books VALUES ('Dune', 1965);")
db.Exec("INSERT INTO books VALUES ('Neuromancer', 1984);")
LET df AS Data.DataFrame OR Error = db.Query("SELECT title, year FROM books ORDER BY year;")
IF df IS Error THEN
PRINT "Error:", df.Message
RETURN
END IF
PRINT "Books:", df.RowCount()
PRINT df.GetString(0, "title"), df.GetInteger(0, "year")
PRINT df.GetString(1, "title"), df.GetInteger(1, "year")
db.Close()
END FUNCTION
Output
Books: 2 Dune 1965 Neuromancer 1984
Registers the GET / route, starts the server on 127.0.0.1:8080, and dispatches a test request to check the response.
In this release, bnc does not compile BNWeb yet: run it with bni.
IMPORT BNWeb AS Web
IMPORT HOST.Net AS Net
FUNCTION Hello(request AS Web.Request, response AS Web.Response) AS VOID
response.SetHeader("Content-Type", "text/plain; charset=utf-8")
response.Write("Hello from Basic Next")
END FUNCTION
FUNCTION Start() AS VOID
LET server AS Web.Server = NEW Web.Server()
server.Route("GET", "/", Hello)
LET ip AS Net.Address OR Error = Net.Address.Parse("127.0.0.1")
IF ip IS Error THEN
RETURN
END IF
LET endpoint AS Net.Endpoint OR Error = Net.Endpoint.Create(ip, 8080)
IF endpoint IS Error THEN
RETURN
END IF
server.Start(endpoint)
PRINT "Server:", server.Status()
LET request AS Web.Request = NEW Web.Request()
LET response AS Web.Response = NEW Web.Response()
server.Dispatch(request, response)
PRINT "GET / ->", response.Status(), response.Header("Content-Type")
server.Stop(1000)
END FUNCTION
Output
Server: Accepting GET / -> 200 text/plain; charset=utf-8
Computes measures over a vector of grades with BNMath functions. FLOAT[6] declares a vector of six real numbers.
The standard deviation is the sample one (n − 1); ROUND limits the decimal places.
IMPORT BNMath AS Math
FUNCTION Start() AS VOID
LET grades AS FLOAT[6] = [7.5, 8.0, 6.5, 9.0, 8.0, 10.0]
PRINT "Mean:", Math.ROUND(Math.MEAN(grades), 2)
PRINT "Median:", Math.MEDIAN(grades)
PRINT "Mode:", Math.MODE(grades)
PRINT "Std deviation:", Math.ROUND(Math.STDEV(grades), 2)
PRINT "Range:", Math.RANGE(grades)
END FUNCTION
Output
Mean: 8.17 Median: 8.0 Mode: 8.0 Std deviation: 1.21 Range: 3.5
Installation
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).
In PowerShell, download and run the installer. It installs to %LOCALAPPDATA%\Programs\BasicNext and adds bin to your user PATH.
irm https://raw.githubusercontent.com/cquintella/BasicNext/main/scripts/install.ps1 | iexClose and reopen the terminal to load the new PATH, then check the version.
bni --version
Output
bni 0.6.8Save the code below as hello.bn and run it.
FUNCTION Start() AS VOID
PRINT "Hello, Basic Next"
END FUNCTIONbni hello.bn
Output
Hello, Basic Next
Requirements: Linux x86_64 or aarch64 with curl and tar. The prebuilt binaries need glibc 2.39 or newer (for example, Ubuntu 24.04). To compile with bnc, also install clang.
The installer downloads the latest release, verifies the checksums, and installs to ~/basicnext without sudo.
curl -fsSL https://raw.githubusercontent.com/cquintella/BasicNext/main/scripts/install.sh | bash -s -- --prefix "$HOME/basicnext"Add bin to your PATH:
echo 'export PATH="$HOME/basicnext/bin:$PATH"' >> ~/.bashrc && source ~/.bashrcMake sure the terminal finds the interpreter.
bni --version
Output
bni 0.6.8Save the code below as hello.bn and run it.
FUNCTION Start() AS VOID
PRINT "Hello, Basic Next"
END FUNCTIONbni hello.bn
Output
Hello, Basic Next
Requirements: macOS on Apple Silicon or Intel. curl and tar ship with the system. To compile with bnc, install the Command Line Tools (xcode-select --install), which include clang.
The installer downloads the latest release, verifies the checksums, and installs to ~/basicnext without sudo.
curl -fsSL https://raw.githubusercontent.com/cquintella/BasicNext/main/scripts/install.sh | bash -s -- --prefix "$HOME/basicnext"Add bin to your PATH (zsh, the default macOS shell):
echo 'export PATH="$HOME/basicnext/bin:$PATH"' >> ~/.zshrc && source ~/.zshrcMake sure the terminal finds the interpreter.
bni --version
Output
bni 0.6.8Save the code below as hello.bn and run it.
FUNCTION Start() AS VOID
PRINT "Hello, Basic Next"
END FUNCTIONbni hello.bn
Output
Hello, Basic Next
Prefer to download the files? Binaries and checksums are on GitHub Releases (opens in a new tab).
Principles
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.
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.
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.
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.
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.
Read the philosophy document (opens in a new tab).
From the author
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.
Open source · MPL 2.0
Basic Next is developed in the open. Read it, try it, and follow every release.