Nyx is a new programming language that combines the syntax of Python and JavaScript. It is designed to be fast, easy to read, easy to write, resource efficient, and cross-platform compatible. Nyx compiles to native executables for various operating systems.
Warning
This project is under construction and is not yet ready for production use. Please check back later for updates. We do not recommend using this project in its current state. This project is still in the early stages of development and is not yet ready for use. We are developing it publicly to allow for community feedback and contributions. Please check back later for updates.
- Combines the best features of Python and JavaScript
- Easy-to-read syntax
- Interprets
.nyx
files directly without compilation
-
Clone the repository:
git clone https://github.com/nyxland/nyx.git cd nyx
-
Install the necessary dependencies:
bun install
-
Build the project using the TypeScript compiler (tsc):
bun run build
To run Nyx code, use the cli
JS file generated in the build process. The cli
JS file takes a Nyx source file as input and interprets it directly.
bun run dist/cli.js path/to/your_code.nyx
This will interpret and execute the Nyx code in the specified file.
To run a Nyx source file, use the following command:
npx nyx example/index.nyx
This will interpret and execute the Nyx code in the example/index.nyx
file.
Nyx syntax combines elements of Python and JavaScript. Here are some examples:
let x = 10
const y = 20
def add = (a, b) => {
return a + b;
}
if x > y:
print("x is greater than y");
else:
print("x is not greater than y");
for i in range(10) {
print(i);
}
class Person:
def __init__ = (self, name, age) => {
self.name = name
self.age = age
}
def greet = (self) => {
print(f"Hello, my name is {self.name} and I am {self.age} years old")
}
Contributions are welcome! Please read the contributing guidelines for more information.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.