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
- C++ compiler (e.g., GCC, Clang, MSVC)
- CMake (version 3.10 or higher)
-
Clone the repository:
git clone https://github.com/nyxland/nyx.git cd nyx
-
Create a build directory and navigate to it:
mkdir build cd build
-
Run CMake to configure the project:
cmake ..
-
Build the project:
cmake --build .
To run Nyx code, use the nyx
executable generated in the build process. The nyx
executable takes a Nyx source file as input and interprets it directly.
./nyx 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:
./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.
This project uses GitHub Actions to automate the build process. The workflow is triggered on push and pull request events to the main
branch. The workflow sets up a C++ environment, installs CMake, and builds the project using the CMakeLists.txt
file.
You can view the build status in the GitHub repository under the "Actions" tab. The build status for each commit and pull request will be displayed there.