Mojo 1.0 Beta

原始链接: https://mojolang.org/

def vector_add( a: TileTensor[float_dtype, type_of(layout), element_size=1, ...], b: TileTensor[float_dtype, type_of(layout), element_size=1, ...], result: TileTensor[ mut=True, float_dtype, type_of(layout), element_size=1, ... ],): var i = global_idx.x if i < layout.size(): result[i] = a[i] + b[i]

Hacker Newsnew | past | comments | ask | show | jobs | submitloginMojo 1.0 Beta (mojolang.org)23 points by sbt567 3 hours ago | hide | past | favorite | 2 comments help modeless 2 minutes ago | next [–] When I first heard about Mojo I somehow got the impression that they intended to make it compatible with existing Python code. But it seems like they are very far away from that for the foreseeable future. I guess you can call back and forth between Python and Mojo but Mojo itself can't run existing Python code.replydllu 10 minutes ago | prev [–] I remember reading about this 4 years ago as the new Chris Lattner project and was super excited, though a little skeptical.I think that nowadays with vibe/agentic coding, high performance Python-like languages become ever more important. Directly using AI agents to code, say, C++, is painful as the verbose nature of the language often causes the context window to explode.reply Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact Search:
相关文章

原文

def vector_add(

a: TileTensor[float_dtype, type_of(layout), element_size=1, ...],

b: TileTensor[float_dtype, type_of(layout), element_size=1, ...],

result: TileTensor[

mut=True, float_dtype, type_of(layout), element_size=1, ...

],

):

var i = global_idx.x

if i < layout.size():

result[i] = a[i] + b[i]

联系我们 contact @ memedata.com