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整体语法非常简洁,这个障碍不大) |
Beta Was this translation helpful? Give feedback.
0 replies
-
TODO |
Beta Was this translation helpful? Give feedback.
0 replies
-
TODO |
Beta Was this translation helpful? Give feedback.
0 replies
-
TODO |
Beta Was this translation helpful? Give feedback.
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) -> Self
get[i: Int, T: AnyType](self: Self) -> T
autotune[T: AnyType, *Ts: AnyType](value: T, values: !pop.pack<Ts>) -> T
评价:
泛型 [T]
等fn
关键字, 生命周期,match
,enum
fn
vsdef
区分只读参数
vs可写参数
let
vsvar
关键字, 用于区分只读
vs可写
模式mut
要好太多No GC
python 开发者
几乎没有学习成本, 就可以快速上手.Beta Was this translation helpful? Give feedback.
All reactions