Skip to content

elsantiF/qn

Repository files navigation

qn

qn is a simple, experimental programming language designed for learning and prototyping. It transpiles to JavaScript. It is inspired by languages like JavaScript, TypeScript, Rust, Scala, Kotlin, and Zig. The language aims to be simple, minimalistic, and expressive.

Warning

This project is in its early stages and is not yet suitable for production use. The syntax and features are subject to change.

Usage

The prefered way to use qn is building and running it with Node.js.

npm i
npm run build
node dist/index.cjs --eval --file examples/hello.qn

You can also use it with bun but expect less performance than with Node.js.

bun i
bun run src/index.ts --eval --file examples/hello.qn

CLI Options

--repl: Start a REPL (Read-Eval-Print Loop) session. --file <path>: Specify the path to a qn source file to be evaluated or compiled. --eval: Evaluate the provided code in the --file option. --print-tokens: Print the tokens generated by the lexer. --print-ast: Print the Abstract Syntax Tree (AST) generated by the parser. --emit: Emit the transpiled JavaScript code (in stout for now). --all: Print all information including tokens, AST, and emitted code. --bench: Benchmark the compilation process.

Documentation

See the original qn specification here and the actual grammar here.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A WIP programming language that compiles to JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors