Remix.run Logo
ronsor 4 days ago

The fact that the "language" is still Python code which has to be traced in some way is a bit off-putting. It feels a bit hacky. I'd rather a separate compiler, honestly.

JonChesterfield 4 days ago | parent | next [-]

Mojo for python syntax without the ast walking decorator, cuda for c++ syntax over controlling the machine, ah hoc code generators writing mlir for data driven parametric approaches. The design space is filling out over time.

pizlonator 4 days ago | parent [-]

The fact that these are all add on syntaxes is strange. I have my ideas about why (like you want to write code that cooperates with host code).

Do any of y’all have clear ideas about why it is that way? Why not have a really great bespoke language?

saagarjha 4 days ago | parent [-]

Hard to beat trifecta of familiar language, same source files and toolchain, JIT compiled

pizlonator 4 days ago | parent [-]

That’s sort of what I assumed, yeah. And I think that makes sense.

But they end up adding super sophisticated concepts to the familiar language. Makes me wonder if the end result is actually better than having a bespoke language.

saagarjha 4 days ago | parent [-]

I mean you used to be able to write TTGIR directly this is mostly sugar on top of that

zer0zzz 4 days ago | parent | prev | next [-]

This is pretty common among these ml toolchain, and not a big deal. They use pythons ast lib and the function annotations to implement an ast walker and code generator. It works quite well.

derbOac 4 days ago | parent | prev [-]

Yeah that struck me as odd. It's more like a Python library or something.

zer0zzz 4 days ago | parent [-]

It’s a dsl not a library. The kernel launch parameters and the ast walk generate ir from the Python.