Skip to content
theworker02Public

About

Nexus (.nex) language — TypeScript toolchain, self-hosting, design language, and Nex LSP for VS Code / Open VSX

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nexus

Nex Lang

A gradually typed, expression-oriented language with a TypeScript-first toolchain,
bytecode VM, self-hosted .nex pipeline, design language, and upcoming package registry.

Nex LSP (Open VSX) · Docs · Getting started · Design language · Changelog · Roadmap · Security · Privacy · Contributing


Brand mark

The Nexus mark is the ribbon N only (magenta → purple → cyan). Wordmarks such as “Nexus� or “Package Registry� are not part of the image � use the mark file plus separate text in UI and docs.

Asset Path
SVG (scalable mark) assets/logo.svg
PNG (transparent mark) assets/logo.png
Extension / CLI media vscode-nexus/media/logo.svg, logo.png, marketplace icon.png
Language site static vscode-nexus/examples/site/web/static/img/ (bundled; no registry needed)

What Nexus is (today)

Nexus (.nex) is a practical language for scripting, tooling, and small web apps, with an honest bootstrap story:

  • Primary runtime: TypeScript host under vscode-nexus/ (tree-walk evaluator + optional bytecode VM).
  • Editor: Nex LSP â€â€� install from Open VSX (theworker02.nex-lsp) for VS Code / VSCodium; also built from this package.
  • Self-hosting: Lexer / parser / evaluator written in .nex under vscode-nexus/selfhost/, loaded by the TS host.
  • Design language: Declarative UI themes + layout in .nex → real HTML/CSS via host builtins.
  • Language site: Design-authored homepage + docs landing via npm run site / npm run build:site (GitHub Pages).
  • Packages: nexus.toml + publish/install client; optional local sibling nex-registry for package-hub demos (not published with this repo).
  • Legacy Go CLI: Still in this monorepo (cmd/nex, pkg/*) for some Go-only features (notably try).

Host builtins (filesystem, HTTP, crypto, DB adapters, etc.) are not pure .nex � every language needs a native substrate. Self-hosting shrinks that substrate; it does not eliminate it. See Self-hosting.


Quick start (TypeScript-first)

cd vscode-nexus
npm install
npm run compile

# Run programs

<p align="center">
  <a href="https://theworker02.github.io/nex-lang/"><img src="https://img.shields.io/badge/docs-live-0B1F33?style=for-the-badge&labelColor=C9A227" alt="Docs"></a>
  <a href="https://github.com/theworker02/nex-lang/releases/tag/v1.0.0"><img src="https://img.shields.io/badge/release-v1.0.0-success?style=for-the-badge" alt="Release"></a>
  <a href="https://github.com/theworker02/nex-lang/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-see%20LICENSE-blue?style=for-the-badge" alt="License"></a>
  <a href="https://github.com/theworker02/nex-lang"><img src="https://img.shields.io/badge/status-maintained-informational?style=for-the-badge" alt="Status"></a>
</p>

<p align="center">
  <img src="https://img.shields.io/badge/version-1.0.0-0B1F33.svg" alt="version">
  <img src="https://img.shields.io/badge/category-product-C9A227.svg" alt="category">
  <img src="https://img.shields.io/badge/pages-enabled-222.svg" alt="pages">
  <img src="https://img.shields.io/badge/docs-thickened-brightgreen.svg" alt="docs">
  <img src="https://img.shields.io/badge/notes-detailed-lightgrey.svg" alt="notes">
</p>
node out/cli.js run .\examples\modules_demo.nex
node out/cli.js run .\examples\vm_demo.nex --vm
node out/cli.js selfhost .\examples\selfhost_demo.nex

# REPL + tests
npm run repl
npm run test:nex

# Language homepage (self-contained � no registry)
npm run site
# → http://localhost:8090

# Static export for GitHub Pages
npm run build:site
# → ../site/

Website: https://theworker02.github.io/nex-lang/ (GitHub Pages)

CLI entry after compile: vscode-nexus/out/cli.js (nex-ts). Full command list: node out/cli.js help.

Optional local registry

A private sibling checkout of nex-registry can be served with npm run registry for package-hub demos. It is not part of this GitHub repository.


Monorepo map

nex-lang/
��� assets/                 # Brand mark (logo.svg / logo.png) � mark only
��� vscode-nexus/           # ★ Primary TS toolchain + VS Code extension + docs
�   ��� src/language/       # Lexer, parser, evaluator, builtins, diagnostics
�   ��� src/vm/             # Bytecode compiler + stack VM
�   ��� src/compiler/       # Multi-tier engine + WASM/LLVM text codegen
�   ��� src/host/           # HTTP host, templates, design→HTML, memory DB
�   ��� src/registry/       # Package publish/install client
�   ��� src/cli.ts          # run / repl / test / selfhost
�   ��� selfhost/           # .nex lexer / parser / evaluator
�   ��� stdlib/             # Importable .nex modules (incl. design.nex)
�   ��� media/              # Extension icons + logo
�   ��� docs/               # Language & toolchain documentation
�   ��� examples/           # Demos (+ examples/site design demo)
�   ��� tests/              # *_test.nex
��� packages/sdk/           # TypeScript registry control client (`@theworker02/nex-sdk`)
��� cmd/nex, pkg/*          # Legacy Go CLI / host
��� stdlib/                 # Shared .nex modules (mirrored in vscode-nexus/stdlib)
��� examples/, tests/       # Shared demos / tests at repo root
��� docs/                   # Spec + roadmap (TS docs live under vscode-nexus/docs)
��� storage/                # Local artifact / seed storage (when used)
��� bin/                    # Built Go binaries (optional)

Optional local sibling (not published): nex-registry/ � package registry web app for demos. Served by npm run registry from vscode-nexus when checked out beside this repo. Control it from TypeScript with packages/sdk (@theworker02/nex-sdk).


Architecture

flowchart TB
  subgraph editor [Editor]
    VSCode[VS Code / VSCodium / Open VSX]
  end

  subgraph ts [TypeScript toolchain - vscode-nexus]
    CLI[nex-ts CLI]
    Ext[Extension commands]
    Lex[Lexer / Parser]
    Eval[Tree-walk evaluator]
    VM[Bytecode VM]
    Host[HTTP web host]
    Design[Design → HTML/CSS]
    Self[selfhost/*.nex]
    Client[RegistryClient]
  end

  subgraph apps [Apps]
    Prog[".nex programs"]
    Reg[nex-registry website]
    Site[examples/site]
  end

  subgraph legacy [Legacy]
    GoCLI[Go nex CLI]
    Pg[(Postgres)]
  end

  VSCode --> Ext
  Ext --> Eval
  Ext --> VM
  Ext --> Self
  Ext --> Client
  CLI --> Lex --> Eval
  CLI --> VM
  CLI --> Self
  CLI --> Host
  Host --> Design
  Host --> Reg
  Host --> Site
  Prog --> CLI
  Client --> Reg
  GoCLI --> Pg
  GoCLI -.-> Eval
Loading

Engine tiers

Tier Command / setting What it runs Limits (honest)
eval (default) run, nexus.executionEngine=eval Full tree-walk + modules + host builtins + HTTP Preferred for apps / registry
vm run --vm, Run File (Bytecode VM) Core language on stack VM No import, no web-host builtins
selfhost selfhost .nex lex→parse→eval Deliberate subset (see selfhost docs)
wasm / llvm / native Editor compile commands Emit .wat / .ll (+ native notes) Core subset only � not a full AOT product

Language overview (implemented surface)

Documented in depth under vscode-nexus/docs/language/. Highlights:

  • let, functions / closures, if / while / for, break / continue
  • Gradual type annotations
  • Arrays, hashes, indexing / members
  • struct / enum, match (-> / =>)
  • Pipes |>, Results ok / err / unwrap (TS path; try early-return is Go-only)
  • Modules: import "strings"; with resolution across relative paths, .modules/, stdlib/
  • English-ish sugar lowered by the parser (string-safe and / or / not)
  • Experimental / partial: effects, regions, macros, async/spawn/chan â€â€� not production guarantees

Design language

Nexus doubles as a design language: themes, layout, forms, and chrome authored in .nex and rendered to HTML/CSS.

  • Spec & API: vscode-nexus/docs/design/README.md
  • Authoring walkthrough: vscode-nexus/docs/design/guide.md
  • Stdlib: import "design" (stdlib/design.nex)
  • Host builtins: design_document, design_response, design_render, design_css, html_doc
  • Brand chrome: brand / brand_link take a mark URL (image) plus separate name/tag text â€â€� the mark file has no wordmark baked in
cd vscode-nexus
npm run site         # live language site → http://localhost:8090
npm run build:site   # static export → ../site/ (GitHub Pages artifact)

Public Pages URL: https://theworker02.github.io/nex-lang/


Editor extension � Nex LSP (Open VSX)

Install: Nex LSP on Open VSX � extension id theworker02.nex-lsp.

Works with VS Code, VSCodium, and other Open VSX–compatible editors. Display name Nex LSP · icon: ribbon N mark (vscode-nexus/media/logo-256.png).

cd vscode-nexus
npm run compile
npm run package          # builds nex-lsp-*.vsix (local / sideload install)
# optional local Open VSX publish (needs token):
# npx ovsx publish *.vsix --pat $env:OVSX_PAT

CI publishes Nex LSP to Open VSX on GitHub Release (or workflow_dispatch with confirm=publish) via .github/workflows/openvsx.yml.

Configure later (maintainers): add repository secret OVSX_PAT � create a token at open-vsx.org/user-settings/tokens and store it under GitHub → Settings → Secrets. Until that secret is set, CI still packages the VSIX but skips the publish step. You do not need OVSX_PAT to develop or contribute.


Funding / Sponsors

Configured in .github/FUNDING.yml (github + thanks_dev).


Optional local package registry

cd vscode-nexus
npm run compile
npm run registry   # requires sibling ../nex-registry � not published with nex-lang
Mode How Notes
TS host + memory DB npm run registry (default) Demo DB seeded from STORAGE_DIR
TS host + DATABASE_URL Env set Uses Postgres via pg when the URL is reachable; falls back to memory on failure

Package client docs: vscode-nexus/docs/packages.md.


Documentation index

Doc Topic
vscode-nexus/docs/README.md Primary docs hub
Getting started Install, run, REPL, tests, editor
Language overview What Nexus is today
Syntax · Types · Control · Functions · Modules · Match Language reference
Builtins · Stdlib Runtime surface
Toolchain Engines, CLI, WASM/LLVM, settings
Self-hosting Bootstrap status & subset
Packages · Website apps Registry & HTTP
Design language Themes → HTML/CSS
Examples Demo index
Language site / Pages Self-host homepage + GitHub Pages
SECURITY.md · PRIVACY.md · TERMS.md Trust / legal
CODE_OF_CONDUCT.md · CONTRIBUTING.md · SUPPORT.md Community
docs/spec.md Implemented surface (TS-first)
docs/ROADMAP.md Near-term priorities
cd vscode-nexus && npm run docs   # prints absolute path to docs/

Examples

Location Contents
vscode-nexus/examples/ Modules, VM, selfhost, language demos
vscode-nexus/examples/site/ Language homepage (npm run site / npm run build:site)
examples/ Shared root demos (also usable from Go CLI)
tests/ · vscode-nexus/tests/ *_test.nex / language tests

Contributing

See CONTRIBUTING.md for setup, PR expectations, and maintainer notes (including optional Open VSX OVSX_PAT). Quick outline:

  1. Prefer changes in vscode-nexus/ (TS is the supported path).
  2. npm install && npm run compile && npm run smoke && npm run test:nex
  3. Keep docs honest � document implemented behavior; call out subsets and stubs.
  4. Follow the Code of Conduct. Questions: SUPPORT.md.

Trust & legal

Doc Purpose
SECURITY.md Vulnerability reporting
PRIVACY.md Privacy policy (local CLI/extension + static Pages)
TERMS.md Terms of use (MIT / as-is)
CODE_OF_CONDUCT.md Community standards
SUPPORT.md Where to ask for help
LICENSE MIT

Site mirrors: /privacy, /security, /terms, /conduct.


License

Source-available proprietary — evaluation under LICENSE; commercial / production use via COMMERCIAL.md. See LICENSE_TRANSITION_NOTICE.md and NOTICE.


License & acquisition

This project is proprietary. Production use, redistribution, and commercial deployment require a written commercial license or completed acquisition. See LICENSE and ACQUISITION.md. Contact @theworker02.

Acquisition diligence

Buyer-facing diligence materials live in docs/acquisition/. Commercial licensing contact path: COMMERCIAL.md.

Badges & release notes

Badge Meaning
docs live Public documentation / Pages surface for nex-lang
release v1.0.0 Stable tagged release with narrative notes
license See repository LICENSE for terms
status maintained Actively kept in the @theworker02 portfolio
version 1.0.0 Documentation and brand completeness milestone
pages enabled Site intended at https://theworker02.github.io/nex-lang/

Detailed narrative for the stable line lives in CHANGELOG.md and the v1.0.0 GitHub Release.

About

Nexus (.nex) language — TypeScript toolchain, self-hosting, design language, and Nex LSP for VS Code / Open VSX

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages