Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nox Logo

Nox

A clean, expressive scripting language — built from scratch.

License: MIT Python Platform


What is Nox?

Nox is a Python-like scripting language with its own parser, interpreter, bytecode compiler, and virtual machine.

Requirements

  • Python 3.12+ (if building/running from source)
  • Windows or Linux

Quick Start

Choose one of two ways to use Nox: Standalone Executable (no Python required) or From Source.

Option A: Standalone Executable (Recommended for users)

Download the prebuilt binary (nox.exe on Windows, nox on Linux) and run it directly:

nox hello.nox

Note: The standalone release contains only the Nox runtime. Libraries like NoxDocs are installed separately.

Option B: From Source (Recommended for developers)

  1. Clone the repository and run setup:

    git clone https://github.com/devnexe/nox
    cd nox
    python setup.py

    The setup script creates a .venv and installs required dependencies.

  2. Activate the virtual environment:

    • Windows (PowerShell): .venv\Scripts\Activate.ps1
    • Windows (CMD): .venv\Scripts\Activate.bat
    • Linux: source .venv/bin/activate
  3. Run Nox via Python:

    python -m nox hello.nox

Usage

Replace nox with python -m nox if running from source without an active alias/binary.

Run Your First Script

  1. Create a file named hello.nox:

    name = input("What's your name? ")
    display("Hello, " + name)
    
  2. Execute the script:

    nox hello.nox
  3. Launch the REPL (Interactive Mode):

    nox

Running a Project Directory

Run a directory directly:

nox my_project

Nox automatically looks for an entry point in this order: __main__.noxmain.noxapp.nox.

Command Line Reference

Command Description
nox script.nox Execute a script
nox Launch the REPL
nox dump file.noxc Display bytecode instructions
nox profile script.nox Profile script performance
nox fmt script.nox Format script source code
nox lint script.nox Run linter on script
nox test Run test suite
nox package list List installed packages
nox package install Install dependencies from nox.toml
nox package install <pkg> Install a specific package

Project Configuration

Create a nox.toml file in your project root:

[project]
name = "my-app"
version = "0.1.0"

[dependencies]
# NoxWeb = "devnexe-alt/NoxWeb"

Install configured dependencies:

nox package install

Library Commands (.nxinfo)

Libraries can expose custom CLI commands using a .nxinfo manifest:

name = NoxDocs
entry = main.nox
command = docs

Once installed, invoke the library command directly:

nox docs

Arguments passed after the command are available inside the script via the argv list:

if len(argv) > 0:
    display(argv[0])

Bytecode Cache

Nox automatically compiles scripts and caches bytecode alongside source files:

project/
├── app.nox
└── __noxcache__/
    ├── app.noxc
    └── app.noxc.sha256

The cache is managed internally and does not require manual intervention.


Documentation

Full documentation is distributed as the NoxDocs package.

  1. Install the documentation package:

    nox package install NoxDocs

    (For compiled binaries, NoxDocs must be installed in the same directory as the executable).

  2. Launch the documentation server:

    nox docs
  3. Open http://127.0.0.1:8080 in your browser to access guides on:

    • Getting Started & Syntax
    • Types & Functions
    • Control Flow
    • Standard Library & NoxWeb

Libraries

📦 Official Nox libraries (NoxWeb, NoxDocs, etc.) are published at github.com/devnexe-alt.


Project Status

Nox is under active development. The runtime utilizes both an AST interpreter and a bytecode Virtual Machine (VM). Advanced constructs may temporarily fall back to the AST interpreter.

License

Distributed under the MIT License. See LICENSE for details.

About

Nox is a clean, expressive programming language created from scratch in pure Python. Includes C/C++ FFI, async/await and its own ecosystem.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages