Nox ko "Progressive Complexity" ke liye design kiya gaya hai. Isme teen alag-alag moods hain: Default, Intermediate, aur Expert.
Beginners ke liye seedha aur saaf syntax.
Nox me variables declare karne ke liye kisi keyword ki zaroorat nahi hai.
name = "Nox"
age = 25print() aur input() ki jagah natural language keywords use hote hain:
say "Hello World"
answer = ask "What is your name?"
say "Hello " + answerAgar aapko safety aur explicit typing chahiye, to file ke top par !strict add karein.
!strict
is name: string = "Nox"
mut count: int = 1Restrictions in Strict Mode:
- Explicit typing mandatory.
- Immutable by default (use
mutfor changes). - Strict imports mandatory.
Functions dono arrow aur block syntax support karte hain.
fn square(n) => n * napp.get("/", fn: say "Welcome!")Nox me node_modules nahi hote. Dependencies URLs se aati hain.
import { math } from "https://nox-lib.io/math/map.nx.json"
import helper from "github:user/repo/map.nx.json"match value {
1 => say "one"
2 => say "two"
_ => say "other"
}for i in 1..10 {
say i
}- Pipe Operator (
|>):data |> process |> say - Safe Call (
?.):user?.address?.city - Short-hand Async (
!):data = fetch(url)!