nature
nature copied to clipboard
🍀 The Nature Programming Language, may you be able to experience the joy of programming.
```zig // The naturelang code is a modified version of the original Odin code from // https://github.com/odin-lang/Odin/blob/m_aster/core/unicode/utf8/utf8.odin // 0000_0000 0000_0000 0000_0000 0000_0000 var RUNE_ERROR = 0xefbfbd as u32 var RUNE_SELF...
example: ``` arr a = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] // 允许最后一个`,`存在 ```
Using nature 0.4.0-beta, I was messing around with structs. I noticed that if this standalone function `argh()` has the print statement with "Made it this far!" before the declaration of...
Hi! Recently I checked Profile-Guided Optimization (PGO) improvements on multiple projects. The results are [here](https://github.com/zamazan4ik/awesome-pgo/). E.g. PGO results for LLVM-related tooling are [here](https://github.com/llvm/llvm-project/issues/63486). According to the tests, PGO usually helps...
``` # ls fib.n # tree . └── fib.n 0 directories, 1 file # cat fib.n import fmt fn fib(int n):int { if n
- 其中的 builtin_temp.n 进行了全局 import, 所以不需要进行 import 也可以访问其中的符号,入 errort/println/print 等都定义在该 temp 中 - 这里有几个特殊的地方,首先为什么我们不需要通过 libc_temp.sleep() 的方式访问 sleep 呢?在 c 语言中其实没有作用域的概念,所有的符号都是全局符号,所以继承到 anture ->nature 中 (https://nature-lang.org/zh-Hans/docs/digging-deeper/temp)
大佬,有空可以搞个在线playground,这样更利于语言的推广。
## vscode syntax highlight plugin github: https://github.com/Chanyon/vscode-nature (参考vscode-vlang) 
nature 的首个泛型版本只会支持简单的功能与严格的限制,这样才能在未来有更多的可能,而没有太多的历史负担。💪 ### 泛型类型 其实泛型类型称为自定义类型参数更加的准确,在之前的语法中,我们已经有 `type T = ...` 这是和变量定义非常相似的一种自定义类型(类型别名)的语句,其原型参考自 `var v = ...` 。 所以实现泛类型非常的简单,只需要进一步模仿 `fn f() = ...` 对 `type T` 声明进行优化即可,语法如下 ``` nature type box = struct...
Due to the existence of the `any` type, type inference is necessary. However, the method similar to golang `any.(Type)` requires one small symbol, one large symbol, and two parentheses, which...