Skip to content
andy64lolPublic

About

This is a custom programming language made using C++ and Rust with simple grammar.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Lynxer

Lynxer logo Build Linux AMD64 Build Linux ARM64 Build Windows AMD64 Build Windows ARM64

Lynxer is a small, statically-flavoured, C-style scripting language. Programs use the .lynx extension and run on the standalone native interpreter in lynxer/ — no VM, no bytecode. The same interpreter can also compile a program into a single executable.

global setup(){
    str name = input("What's your name? ");
}

global main(){
    println("Hello, ", name, "!");
}

→ Documentation | Installation | Language reference | Functions | Macros | Standard library


Platforms

Lynxer supports 64-bit Linux and 64-bit Windows on amd64 and arm64. The Linux-specific system calls in os (and the sys module) are excluded on Windows; builds fail early rather than mix syscall tables. Windows builds provide the interpreter, --compile, the embedding runtime, and --emit-library through MSYS2 MinGW-w64/CLANGARM64. See docs/windows.md.


Status

v0.1.8.4 — a standalone C++ implementation with:

  • a native interpreter and an AST optimizer;
  • 40 standard-library modules, native (C++/Rust) backends included;
  • a frozen native-module ABI for third-party backends;
  • class inheritance with extends and super(...), first-class functions and closures, inferred generic parameters, and scoped named lambdas;
  • static analysis via --lint, a source debugger via --debug, and a language server in lynxer/lsp.py;
  • single-file executables via --compile and C ABI shared libraries via --emit-library;
  • performance benchmarks via make benchLynxer;
  • a full test suite on amd64 and arm64.

Planned gaps are tracked in docs/limitations.md.


Quick start

make build                                       # build the interpreter and every stdlib module
./lynxer/lynxer syntax.lynx                      # run a source file
./lynxer/lynxer --compile syntax.lynx -o syntax  # compile to a standalone executable
./lynxer/lynxer --version                        # print the version
./lynxer/lynxer --help                           # list every command

make test                                        # build and run the full test suite

To install the interpreter system-wide (default prefix /usr, override with LYNXER_PREFIX):

sudo ./lynxer/lynxer --install

Language at a glance

global setup(){
    importAs("math", "m");
    const str LANG = "Lynxer";
}

global greet(str name){
    println("Hello, ", name, "!");
}

global main(){
    int x = 10;
    float pi = 3.14;
    bool ok = true;

    x += 5;

    if(x > 10){
        global.greet(LANG);
    }

    for(int i = 0; i < 3; i = i + 1){
        println(i);
    }

    // stdlib
    println(global.m.sqrt(144));
}

Documentation

The documentation lives in docs/ and is rendered into a static site by site/build.py (output under site/).

Page Contents
Installation How to build and run Lynxer
CLI reference Complete command-line usage
Language reference Types, variables, control flow, functions, and scoping
Functions global, func, local, and named lambda declarations, inferred generic parameters, and caller-supplied codeblocks
Operators Arithmetic, comparison, boolean and bitwise operators, precedence, deprecated spellings
Errors The try/catch statement, raise, and exceptionInfo()
Type reference Primitive, fixed-width integer, and fixed-width float types
Built-ins Core language functions and unmanaged memory operations
Lists list and tuple values and their builtins
importAs importAs("module", "alias") — import under a custom name
Module system import(), importAs(), namespaces, writing your own modules
Standard library Per-module documentation pages
Native-module ABI The shared C ABI for C++ and Rust backends
Extending Adding a module: wrapper, backend, fixture, contract
Vargroups Named typed records (struct-like)
Structs Data-only named types with positional constructors
Classes Instances, constructors, fields, methods, and extends inheritance
Enums Rust-style tagged unions, payloads, and pattern matching
Limitations Planned implementation gaps

Links

Resource Link
GitHub repository https://github.com/andy64lol/Lynxer

Project layout

lynxer/        The interpreter and its standard library
  *.cpp, *.hpp   Lexer, parser, interpreter, optimizer, formatter, CLI
  stdlib/        Native and pure stdlib modules
  rust/          Rust-backed native modules
docs/          Documentation (Markdown source)
site/          Static website: home page plus docs/ rendered to HTML
packaging/     Distribution packaging (AUR)
syntax.lynx    Full syntax showcase
Makefile
README.md

packaging/ supports distribution and installation.


License

MIT — see LICENSE.

About

This is a custom programming language made using C++ and Rust with simple grammar.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages