Replies: 4 comments
Mojo 核心语法特性:import python-lib
import C/C++ lib
let vs var, fn vs def
Functional
泛型:泛型符号 [] vs <> 在可读性上的影响, 是非常明显的。
截图第一个函数,阅读上,就不够直观。很难不受到 map/dict 干扰。
虽然 python dict, 自带 dict.get() 方法, 很少使用 dict[key] 方式获取数据,但选择[] 而不是 <> 来设计泛型,还是给阅读代码增加开销。(好在python整体语法非常简洁,这个障碍不大) |
0 replies
|
TODO |
0 replies
|
TODO |
0 replies
|
TODO |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Mojo 笔记
笔记:
__init__(data: pointer<scalar<si8>>, length: Int) -> Selfget[i: Int, T: AnyType](self: Self) -> Tautotune[T: AnyType, *Ts: AnyType](value: T, values: !pop.pack<Ts>) -> T评价:
泛型 [T]等fn关键字, 生命周期,match,enumfnvsdef区分只读参数vs可写参数letvsvar关键字, 用于区分只读vs可写模式mut要好太多No GCpython 开发者几乎没有学习成本, 就可以快速上手.All reactions