Live data from Hacker News

Mojo – a new programming language for AI developers

modular.com

51–60 of 272 posts

Re: Mojo – a new programming language for AI developers

#51

Earlier quoted context omitted.

> A major goal of Clang was to be a “compatible replacement” for GCC, MSVC and other existing compilers. It is hard to make a direct comparison, but the complexity of the Clang problem appears to be an order of magnitude bigger than implementing a compatible replacement for Python. The journey there gives good confidence we can do this right for the Python community Is it though? For Mojo to be a compatible replaceme…

Thanks for your interest, I'm pretty confident we can do this. I've been working on compilers and languages for awhile. :) Your point about LLVM compile time is great one. Mojo is architected from the beginning for fast compile times, including deeply integrated caching and distributed compilation. LLVM "isn't slow" if you don't keep asking it to do the same thing over and over again. -Chris

I think Chris was referring to the leaky abstractions python grew on https://www.youtube.com/watch?v=qCGofLIzX6g

Re: Mojo – a new programming language for AI developers

#53

Earlier quoted context omitted.

I notice that Mojo still seems to use numpy or something that looks "numpyish" for compatibility. Will Mojo also have an alternative syntax for doing things like matrix multiplication that looks more native like Julia's?

Mojo fully supports arbitrary library designed types, check out the note books for examples that define custom matrix operations of various types.

How does mojo handle function polymorphism and abstraction? Julia uses multiple dispatch, Haskell type classes etc

Edit: I see you're going to have protocols/ traits. Can those be specializes/monomoprhized at function call time like Julia abstract types?

And how about function specialization? Will functions be attached to structs in a single dispatch fashion or free floating multimethods?

Re: Mojo – a new programming language for AI developers

#54
Reached end of docs. I'm sold.

- Compile time language is ~ the runtime one. That's the model most systems languages seem to have ended up at. It doesn't have macros or reflection, but neither of those seem to be very popular

- The struct/let notation and lifetime model essentially give you C++ semantics with saner syntax. The class/def notation essentially give you python semantics. This is a clean answer to the gradual-typing-for-performance problem

- You can drop into MLIR at will and the std types are implemented like that. This makes the language look a lot like syntactic sugar over writing the IR which closely matches how (at least some) compiler devs think about programming languages

Yeah, I think that'll work. Python/C++ mashup is a popular dev stack and this can make that much cleaner. Faster than C is rather unproven but given the difference in compile time control should be achievable.

Re: Mojo – a new programming language for AI developers

#56
post #37

Somewhere out there, a recruiter is gearing up to demand 5 years experience with Mojo before they will look at your resume.

I already added "Mojo Evangelism is my mojo" in my LinkedIn Title.

Dibs on Mojo Dojo (mojodojo.com), your new premier training resource for Mojo.

Re: Mojo – a new programming language for AI developers

#57
post #19

Swift already imported Python code in a similar fashion. Feels like this is a more Pythonic syntax for Swift and likely carries over all the underlying goodness. [FWIW, folks waiting for this should also look at Cython, which is different, but uses Pythonic syntax for more of a C-like semantics.]

Swift doesn't do a good job of interleaving with Python (i.e. allowing Python to call into Swift, while possible, is nothing like Numba due to various object type translation required).

Mojo seems to be targeting Mojo -> Python -> Mojo too (i.e. Mojo can do high level control flow, delegate some more control flow / unsupported ops to Python, then implement some accelerator supports that Python will call back to). This can be quite difficult if you want to have very low bridging cost (Python objects are quite large and different libraries, such as Python / numpy have different representations in C on top of these Python objects).

It is all possible (after all, we are doing computer stuff), but it is a quite difficult path comparing to other success interop stories (Swift / ObjC took a decade to achieve somewhat low bridging cost, Kotlin / Java simply gives up and doing everything in JVM).

Re: Mojo – a new programming language for AI developers

#58
post #4

A magnificent game changing project once again by the creator(s) of LLVM. I think this time they might have a proper Python alternative. Many have tried like Julia Lang, R, C#, Swift, Rust, Haskell, etc and all have failed in competing against Python. Perhaps this time, we finally have one that is a proper replacement for anything requiring intensive compute and performance without being a systems programmer, all tha…

Will I be able to use all of the existing libraries from Python? If not, it's going to be hard to make the switch

Yep, they already just work, Check the website or the demo in the launch video from Jeremy Howard. Also potentially interesting:

https://docs.modular.com/mojo/programming-manual.html#python... https://docs.modular.com/mojo/notebooks/Mandelbrot.html

Re: Mojo – a new programming language for AI developers

#59
post #2

Well, I'm blown away. If this succeeds, it will allow you to use Python for the entire AI stack: high-level model composition (as usual), fast compiled CPU code (instead of, say, libs written with C++), and on-device operations (instead of, say, libs that use CUDA). Oh, and it will make your Python code parallel (i.e., there's no GIL). Obviously, we'll have to wait until Mojo is production-ready, but I'm excited afte…

>>If this succeeds, it will allow you to use Python for the entire AI stack [...]

If this succeeds, the terminal endpoint will be the Python Software Foundation adopting Modular as the defacto and eventually official implementation since, as Modular noted in their docs, they effectively need Mojo to be absolutely amazing on generalized host CPUs as the key enabler allowing for the unified Python-superset experience across other types of general and specialized hardware ("xPU").

Julia will be dealt an adoption setback proportional to Mojo's growing success.

Post reply on HN