Lol wut. For the life of me I cannot fathom what design decision in their cconv/ABI leads to this.
add_function(PythonObject)
add_function(PythonObject, PythonObject)
add_function(PythonObject, PythonObject, PythonObject)
There was a similar pattern in the Guava library years ago, where ImmutableList.of(…) would only support up to 20 arguments because there were 20 different instances of the method for each possible argument count.
He also discussed open sourcing Mojo and where the company expects to make its money.
Here is a link to the episode listing for that podcast, which might help.
I'm logged into youtube, if you're not something with that perhaps?
That said, importing into Python this easily is a pretty big deal. I can see a lot of teams who just want to get unblocked by some performance thing, finding this insanely helpful!
This is not really true. Even though Mojo is adopting Python's syntax, it is a drastically different language under the hood. Mojo is innovating in many directions (eg: mlir integration, ownership model, comptime, etc). The creators didn't feel the need to innovate on syntax in addition to all that.
I didn't mean to undermine the ambitious goals the project has. I still wish it was a little bolder on syntax though, Python is a large and complex language as is, so a superset of Python is inherently going to be a very complicated language.
The space that I am interested in is execution time compiled programs. A usecase of this is to generate a perfect hash data structure. Say you have a config file that lists out the keywords that you want to find, and then dynamically generate the perfect hash data structure compiled as if those keywords are compile time values (because they are).
Or, if the number of keywords is too small, fallback to a linear search method. All done in compile time without the cost of dynamic dispatch.
Of course, I am talking about numba. But I think it is cursed by the fact that the host language is Python. Imagine if Python is stronger typed, it would open up a whole new scale of optimization.
> The space that I am interested in is execution time compiled programs. A usecase of this is to generate a perfect hash data structure. Say you have a config file that lists out the keywords that you want to find, and then dynamically generate the perfect hash data structure compiled as if those keywords are compile time values (because they are).
I'm not sure I understand you correctly, but these two seem connected. If I were to do what you want to do here in Python I'd create a zig build-lib and use it with ctypes.
``` python program.py --config <change this> ```
It is basically a recompilation of the whole program at every execution taking into account the config/machine combination.
So if the config contains no keyword for lookup, then the program should be able to be compiled into a noop. Or if the config contains keyword that permits a simple perfect hash algorithm, then it should recompile itself to use that mechanism.
I dont think any of the typical systems programming allows this.
Sadly the contenders on the corner get largely ignored, so we need to contend with special cased JIT DSLs, or writing native extensions, as in many cases CPython is only implementation that is available.
’’’ 3628800 Time taken: 3.0279159545898438e-05 seconds for mojo
3628800 Time taken: 5.0067901611328125e-06 seconds for python ’’’
In all fairness, their website now reads: "Mojo is a pythonic language for blazing-fast CPU+GPU execution without CUDA. Optionally use it with MAX for insanely fast AI inference."
So I suppose now is just a compiled language with superficially similar syntax and completely different semantics to Python?
That said, the upside is huge. If they can get to a point where Python programmers that need to add speed learn Mojo, because it feels more familiar and interops more easily, rather than C/CPP that would be huge. And it's a much lower bar than superset of python.
I'd argue that I am not sure what kind of Python programmer is capable of learning things like comptime, borrow checking, generics but would struggle with different looking syntax. So to me this seemed like a deliberate misrepresentation of the actual challenges to generate hype and marketing.
Which fair enough, I suppose this is how things work. But it should be _fair_ to point out the obvious too.
I feel like that depends quite a lot on what exactly is in the non-subset part of the language. Being able to use a library from the superset in the subset requires being able to translate the features into something that can run in the subset, so if the superset is doing a lot of interesting things at runtime, that isn't necessarily going to be trivial.
(I have no idea exactly what features Mojo provides beyond what's already in Python, so maybe it's not much of an achievement in this case, but my point is that this has less to do with just being a superset but about what exactly the extra stuff is, so I'm not sure I buy the argument that the marketing you mention of enough to conclude that this isn't much of an achievement.)
I liked mojo as a python superset. Wanted to be able to run arbitrary python through it and selectively change parts to use the new stuff.
A "pythonic language" sounds like that goal has been dropped, at which point the value prop is much less clear to me.
"1001 Ways to Write CUDA Kernels in Python"
https://www.youtube.com/watch?v=_XW6Yu6VBQE
"The CUDA Python Developer’s Toolbox"
https://www.nvidia.com/en-us/on-demand/session/gtc25-S72448/
"Accelerated Python: The Community and Ecosystem"
https://www.youtube.com/watch?v=6IcvKPfNXUw
"Tensor Core Programming in Python with CUTLASS 4.0"
https://www.linkedin.com/posts/nvidia-ai_python-cutlass-acti...
There is also Julia, as the black swan many outside Python community have moved into, with much more mature tooling, and first tier Windows support, for those researchers that for whatever reason have Windows issued work laptops.
https://info.juliahub.com/industries/case-studies
Mojo as programming language seems interesting as language nerd, but I think the judge is still out there if this is going to be another Swift, or Swift for Tensorflow, in regards to market adoption, given the existing contenders.
This may appeal to people wanting to run their code on different hardware brands fro various reasons.
I’m always disappointed when I hear anything about mojo. I can’t even fully use it, to say nothing of examine it.
We all need money, and like to have our incubators, but the LLVM guy thinks like Jonathan Blow with jai?
I don’t see the benefit of joining an exclusive club to learn exclusively-useful things. That sounds more like a religion or MLM than anything RMS ever said :p
mindwok•4h ago
I'm just nervous how much VC funding they've raised and what kind of impacts that could have on their business model as they mature.
mkaic•3h ago