Nature
is a programming language and compiler, may you be able to experience the joy of programming.
GET STARTEDDOWNLOAD![nature logo](/assets/images/nature-7810a9b646eb8239daeaf268729454ac.png)
fib.n
import fmt
fn fib(int n):int {
if n <= 1 {
return n
}
return fib(n - 1) + fib(n - 2)
}
fmt.printf('fib result is %d', fib(30))
Functions Defined
A fib evaluation function was defined using recursion.
Call the fib function and pass its result to fmt.printf for output.
Install nature and execute the compile command
> nature build fib.n && ./main
fib result is 832040
What's possible
đŽ
Game engine and game production
đ¤
Science and AI computing
đ°
Operating Systems and Internet of Things
đ
WEB development
Features
âī¸ Reliable
The type system assists you in writing efficient and reliable applications, while cross-platform static compilation can help you quickly build and deploy your applications.
đ Concise
A concise syntax and smooth learning curve minimize your learning cost and allow you to write concise and elegant code.
đŗ Open
Nature is a programming language that belongs to its users. Everyone has the ability to contribute their own ideas or directly participate in its development.
Code Examples
![error handle](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogserror_handle_3.jpeg)
Error handle
![generics](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230630132324.png)
Generics
![function label](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230630120447.png)
Function label
![union type](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230630132845.png)
Union type
![coroutine](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230630120423.png)
Coroutine
![http server](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230630131801.png)