Write directly.
Indentation groups your code. The compiler works out variable types wherever the values provide enough information.
Language basicsA programming language in development
Nagi puts readable code and efficient execution at the center of its design. You can try it with a small program or a Web API that reads and stores data.
Nagi is currently a 0.1 prototype. See its development status
def double(number: i64) -> i64:
return number * 2
def main():
answer = double(21)
print(answer)
double is a function that doubles a number. Calling it from main with 21 prints 42.
The ideas behind Nagi
Indentation groups your code. The compiler works out variable types wherever the values provide enough information.
Language basicsNagi checks types and how you use data after passing it to another function. Operations that can fail return a result you can handle as success or failure.
Handling failuresNagi translates your code into Low, then Rust, to build a native executable. When you need to, you can read the Low code and replace individual functions.
High and LowWhat you can try today
Begin by printing text and numbers, then move on to functions, lists, and structured data. Working examples help you learn one step at a time.
Setup and your first runThe examples receive JSON over HTTP, read it into typed data, store it in SQLite, and return a response.
Introduction to HTTP and HTMLIn VS Code, you can inspect variable types, complete fields, and jump to definitions. Try the editor features
Where the name comes from
Even when the inside is working intensely,
the surface stays as calm as a quiet sea.
The name comes from the Japanese word 凪 (nagi): a lull in the wind and a calm sea. It expresses an idea behind the language: even when much is happening underneath, the code you work with should feel calm and clear.
Development status
Nagi is a 0.1 prototype. Its syntax and features are still being developed and may change. The Docs distinguish working features from those that have yet to be implemented.
Archives are available for Windows x64, Linux x86_64, macOS Apple Silicon, and macOS Intel. CI checks builds and execution on each platform. You need Rust/Cargo and a C build environment to try Nagi.