weiwenhao

Results 4 issues of weiwenhao

代码仓库: https://github.com/nature-lang/nature 文档: https://nature-lang.org/docs/getting-started/meet-nature ## 功能 nature 是一种编程语言,语法上追求简洁优雅,关注使用者的编写与阅读体验。 目前版本已经实现的功能有 - 变量定义与赋值 - 控制流语句 - 函数与闭包 - 类型系统与自定义类型 - 一元与二元运算符 - struct 结构支持 - 内置 list/map/set/tuple 数据结构 - 错误处理 - 模块管理...

weekly

```assembly >0x60e1a0 mov (%rbx),%rdi │ │ 0x60e1a3 test %rdi,%rdi │ │ 0x60e1a6 je 0x60e1b0 │ │ 0x60e1a8 jmpq 0x60e1ba │ │ 0x60e1ad nopl (%rax) │ │ 0x60e1b0 sub $0x8,%rsp │...

nature 的首个泛型版本只会支持简单的功能与严格的限制,这样才能在未来有更多的可能,而没有太多的历史负担。💪 ### 泛型类型 其实泛型类型称为自定义类型参数更加的准确,在之前的语法中,我们已经有 `type T = ...` 这是和变量定义非常相似的一种自定义类型(类型别名)的语句,其原型参考自 `var v = ...` 。 所以实现泛类型非常的简单,只需要进一步模仿 `fn f() = ...` 对 `type T` 声明进行优化即可,语法如下 ``` nature type box = struct...

proposal

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...

proposal