Given that NVidia now decided to get serious with Python JIT DSLs in CUDA as announced at GTC 2025, I wonder how much mindshare Mojo will managed win across researchers.
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.
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.
fnands 3 hours ago [-]
Mojo (and Modular's whole stack) is pretty much completely focused at people who are interested in inference, not training nor research so much at this moment.
So going after people who need to build low latency high-throughput inference systems.
Also as someone else pointed out, they also target all kinds of hardware, not just NVidia.
pjmlp 3 hours ago [-]
Currently looks more like CPUs and eventually AMD, from what I have been following up on their YouTube sessions, and whole blog post series about freedom from NVidia and such.
They also miss CPUs on Windows, unless using WSL.
MohamedMabrouk 2 hours ago [-]
Already GPU code, kernels, and complete models can run on datacenter AMD GPUs using the same code, the same programming model, and same language constructs.
pjmlp 2 hours ago [-]
Laptops?
MohamedMabrouk 24 minutes ago [-]
not sure, modular is focusing mainly on enterprise applications. but if you look at the current PRs you can see people hacking support for standalone consumer-grade Nvidia and AMD gpus because it is easy, you just add the missing or different intrinsics for the architecture in the lowest level (in pure mojo code) and wire it up in a few places and voila you already program and run code on this GPU. iGPU/Apple GPUs are still not supported yet but it would interesting to see their integration
bsaul 4 hours ago [-]
Mojo is marketed as a way to get maximum hardware performance on any hardware, not just nvidia.
This may appeal to people wanting to run their code on different hardware brands fro various reasons.
pjmlp 3 hours ago [-]
True, however that goal is not yet available today, it doesn't even run on Windows natively.
And for those that care, Julia is available today on different hardware brands, as there are other Python DSL JITs as well.
I agree they will get there, now the question is will they get there fast enough to matter, versus what the mainstream market cares about.
melodyogonna 3 hours ago [-]
Mojo GPU kernels can run on both Nvidia and AMD GPUs today
pjmlp 2 hours ago [-]
Specific models if I recall correctly.
melodyogonna 1 hours ago [-]
Nah, outside of Models you can write Mojo code today that work on both Nvidia and AMD gpus, the code itself doesn't have to be AI specific.
fulafel 5 hours ago [-]
The limitations of DSLs and the pull of Python make it a practical sweet spot I think if they manage to get the Python compatibility up to par.
ForHackernews 2 hours ago [-]
I love Julia and want to see it break through. It suffers from the lack of a big corporate patron.
pjmlp 2 hours ago [-]
Plenty of them exist already, that is why I pointed out this, that HNers keep overlooking
Sure, a bunch of companies use Julia but none of them are backing it the way Google backs Go, Oracle backs Java, or Mozilla (formerly) backed Rust.
pjmlp 40 minutes ago [-]
Didn't hurt that much for Python, Ruby, not having a big name in the early days.
Just like I would consider MIT and a few of the companies on that listing as relevant, doesn't need to always be a FAANG.
GeekyBear 7 hours ago [-]
Chris Lattner (the tech lead behind Mojo, LLVM, Clang, Swift and MLIR) appeared on a podcast a bit over a week ago and discussed the state of Mojo and where it is going.
He also discussed open sourcing Mojo and where the company expects to make its money.
I'm logged into youtube, if you're not something with that perhaps?
JonChesterfield 5 hours ago [-]
The factorial test giving zero on majo suggests they aren't doing arbitrary precision integer arithmetic.
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.
melodyogonna 3 hours ago [-]
From Chris Lattner on Modular discord few days ago:
Yep, that's right. Int behaving like a machine integer is very important for systems performance. Leaving the "int" namespace untouched allows us to have a object-based bigint in the future for compatibility with python.
As others have mentioned above, it is still a goal to be compatible with python in time, just not a short term priority
bishabosha 5 hours ago [-]
They explicitly casted it to an 'Int' on the mojo side, but the modular website claims that isnt a specific bit-width so i am surprised
mhh__ 2 hours ago [-]
Python as a language is basically tasteless crap so it is a shame if they end up basically in limbo between the two sides.
0xpgm 16 minutes ago [-]
Your comment is quite subjective, and Python's popularity both in teaching and in industry would suggest otherwise.
mindwok 8 hours ago [-]
I am really rooting for Mojo. I love what the language is trying to do, and making it easier to run SOTA AI workloads on hardware that isn't Nvidia + CUDA will open up all kinds of possibilities.
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 8 hours ago [-]
If they can manage to make good on their plans to open-source it, I'll breathe a tentative sigh of relief. I'm also rooting for them, but until they're open-source, I'm not willing to invest my own time into their ecosystem.
jillesvangurp 4 hours ago [-]
They already released their code under the Apache 2.0 license. Not everything in their stack is open source but the core things appear to be open source.
ayhanfuat 1 hours ago [-]
Their compiler is not open source. They only released stdlib code.
anon-3988 7 hours ago [-]
I am not that intrigued that Python that can call some pre-compiled functions, this is already possible with any language that produces a dynamic library.
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.
pjmlp 5 hours ago [-]
I would rather image CPython being like Common Lisp, Scheme, Raket, Smalltalk, Self compilation model.
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.
devjab 6 hours ago [-]
> I am not that intrigued that Python that can call some pre-compiled functions, this is already possible with any language that produces a dynamic library.
> 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.
anon-3988 5 hours ago [-]
Can Zig recompile itself if I change a config in production? I am talking about this
```
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.
js2 7 hours ago [-]
For anyone not up to speed on Mojo: Mojo is a pythonic language for blazing-fast CPU+GPU execution without CUDA:
I've never been thats sold on Mojo, I think I'm unfairly biased away from it because I find new languages interesting, and its big sell is changing as little as possible from an existing language.
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!
atomicapple 5 hours ago [-]
> its big sell is changing as little as possible from an existing language.
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.
benrutter 5 hours ago [-]
You're right- I probably should have said something like "part of its sell" or "one of its selling points" or something.
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.
Someone 3 hours ago [-]
FTA (emphasis added): “Chris Lattner mentioned that Python can actually CALL Mojo code now”
So, the message is that it is possible to create nice Python bindings from Mojo code, but only if your Mojo code makes the effort to create an interface that uses PythonObject.
Useful, but I don’t see how that’s different from C code coding the same, as bindings go.
Both make it easier to gradually move Python code over to a compiled language.
Mojo presumably will have the advantage that porting from Python to Mojo is much closer to a copy paste job than porting Python to C is.
Tiberium 7 hours ago [-]
> as I'm definitely in the market for a simple compiled language that can offer Python some really fast functions
So, Nim? https://github.com/yglukhov/nimpy
mindwok 7 hours ago [-]
The real point of Mojo is not the language, it's the deep roots into MLIR which is an attempt to do what LLVM did for compilers, and do it on GPUs / ML hardware. Chris Lattner is leading the project and he created LLVM and MLIR.
amval 5 hours ago [-]
For a language that announced itself (and raised a lot of money on the premise of) claiming to be "a Python superset", this does not sound like a huge achievement.
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?
Certhas 4 hours ago [-]
I think it was pretty clear immediately that running python code was a far away goal. There was a lot more talk about lifetimes and ownership semantics than details about Python interop. Mojo is more like: Can we take the learnings of Swift and Rust and solve the usability and compile time issues, while building on MLIR to target arbitrary architectures efficiently (and call it a Python superset to raise VC money).
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.
amval 4 hours ago [-]
It marketed itself explicitly as a "Python superset", which could allow Python programmers to avoid learning a second language and write performant code.
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.
Certhas 2 hours ago [-]
Absolutely. The public sales pitch did not match the reality. This is what I meant with the "Claim to be Ṕython to get VC money" point.
To first order, today every programmer starts out as a Python programmer. Python is _the_ teaching language now. The jump from Python to C/Cpp is pretty drastic, I don't think that it's absurd that learning Mojo concepts step by step coming from Python is simpler than learning C. Not syntactically but conceptually.
pjmlp 2 hours ago [-]
Maybe young generations have some issue learning polyglot programming, I guess.
While I agree using Mojo is much preferable to writing C or C++ native extensions, back on my day people learned to program in K&R C or C++ ARM in high school, kids around 12 years old, hardly something pretty drastic.
ForHackernews 2 hours ago [-]
I've tried learning C a couple times and given up because the curve is too steep to be worth the climb. It's not even the language itself, it's the inherited weight of half a century's worth of cruft. I can't spend weeks fighting with compiler nonsense, header files and #include. Screw it, I'll just use Go instead.
I'm learning Rust and Zig in the hope that I'll never have to write a line of C in my career.
blks 2 hours ago [-]
Geez, what a comment. C is much much more simpler than Rust. You’re not supposed to be spending weeks fighting includes or compiler errors, that means you’re have some very basic misconceptions about the language.
Just read K&R “The C programming language” book.
It’s fairly small and it’s a very good introduction to C.
m11a 2 hours ago [-]
C syntactically is straight forward, but conceptually may be harder than Rust. You’re exposed to the bare computer (memory management, etc) far more than with a GC language or even Rust arguably, at least for simple programs.
Towards deployment is even harder. You can very easily end up writing exploitable, unsafe code in C.
If I were a Python programmer with little knowledge about how a computer works, I’d much prefer Go or Rust (in that order) to C.
blks 2 hours ago [-]
Rust memory model is very complicated. C memory model is very straightforward.
DasIch 2 hours ago [-]
C before C11 has no memory model. Rust doesn't have one but effectively it inherits the C++/C memory model, so there is actually no difference.
ynik 18 minutes ago [-]
That applies only if you take "memory model" to mean modeling the effects of concurrent accesses in multithreaded programs.
But the term could also be used more generally to include stuff like pointer provenance, Rust's "stacked borrows" etc.
In that case, Rust is more complicated than C-as-specified. But C-in-reality is much more complicated, e.g. see https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2263.htm
tialaramex 31 minutes ago [-]
The model you're referring to, a Memory Ordering Model, is literally the same model as Rust's. The "exception" is an ordering nobody knows how to implement which Rust just doesn't pretend to offer - a distinction which makes no difference.
codethief 2 hours ago [-]
I do sympathize with the parent: The language itself might not be that difficult but you also have to factor in the entire ecosystem. What's the modern way to a build a GUI application in C? What's the recommended way to build a CLI, short of writing your own arg parser? How do you handle Unicode? How do you manage dependencies, short of vendoring them? Etc.
tialaramex 27 minutes ago [-]
Errors too. When, inevitably, you make mistakes the C might just compile despite being nonsense, or you might get incomprehensible diagnostics. Rust went out of its way to deliver great results here.
ForHackernews 2 hours ago [-]
Even more than that: "How do you do a string?" has like 100 answers in C depending on what libraries are available, what your deploy target is...
Certhas 1 hours ago [-]
THe thing is, if one is an expert it is incredibly difficult to understand the beginner perspective. Here is one attempt:
C is simpler than Rust, but C is also _much_ simpler than Python. If I solve a problem in Python I have a good standard library of data types, and I use concepts like classes, iterators, generators, closures, etc... constantly. So if I move to Rust, I have access to the similar high-level tools, I just have to learn a few additional concepts for ressource management.
In comaprison, C looks a lot more alien from that perspective. Even starting with including library code from elsewhere.
pjmlp 2 hours ago [-]
Agreed, I do bash C a lot, and it has plenty of issues, but hardly a monster that a mythological hero has to face.
And as tip for pointers, regardless of the programming language, pen and paper, drawing boxes and arrows, are great learning tools.
goodpoint 2 hours ago [-]
Writing hello world in C is easy. Writing complex software without memory issues and vulnerability is pretty hard.
fnands 3 hours ago [-]
They've backed off a little from the Python superset claims and leaned more into "Python family".
> I'd argue that I am not sure what kind of Python programmer is capable of learning things like comptime, borrow checking
One who previously wrote compiled languages ;-).
It's not like you forget everything you know once you touch Python.
amval 3 hours ago [-]
The second part of the sentence is very important ;)
"... but would struggle with different looking syntax"
oxidi 3 hours ago [-]
I think the point was that Python syntax is simpler than e.g. borrow checking.
Although Python has some seriously PERLesque YOLO moments, like "#"*3 == "###". This is admittedly useful, but funny nonetheless.
pixelpoet 1 hours ago [-]
I suppose if you accept the innocent-looking "#"+"#"=="##" then your example kind of algebraically follows. Next it's time to define what exp("#") is :)
mkl 2 hours ago [-]
* does different things depending on the types of the operands, which is Python's strong typing at work, not Perlesque weak typing. Repeating a string is a useful thing to be able to do, and this is a natural choice of syntax for it. The same thing works for lists: [1]*3 == [1, 1, 1].
oxidi 2 hours ago [-]
I was referring to the "creative syntax" and it wasn't meant to be an attack on Python.
We cannot deny that Python has some interesting solutions, such as the std lib namedtuple implementation. It's basically a code template & exec().
I don't think these are necessarily bad, but they're definitely funny.
johnofthesea 4 hours ago [-]
> and call it a Python superset to raise VC money
What else was proclaimed just to raise VC money?
dragonwriter 4 hours ago [-]
The real unique selling point of Mojo is "CPU+GPU execution without CUDA", specifically, you write code that looks like code without worrying about distinctions like kernels and device functions and different ways of writing code that runs on GPU vs. code that runs on CPU, and mojo compiles it to those things.
saghm 4 hours ago [-]
> For a language that announced itself (and raised a lot of money on the premise of)
claiming to be "a Python superset", this does not sound like a huge achievement
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.)
melodyogonna 3 hours ago [-]
I've written this somewhere else before, Modular did not raise $130m to build a programming language, nobody does that.
They raised that much money to revolutionize AI infrastructure, of which a language is just a subset. You should definitely check some of the things they've put together, they're amazing
Imustaskforhelp 2 hours ago [-]
Yes. They are revolutionizing AI infrastructure but I guess a lot of world is just babbling about AI, but not every developer needs to worry about AI.
And so his improvements in mojo and now calling mojo code from python just make a lot more net positive to the community than being, some other Ai infrastructure company.
So I do wish a lot of good luck to mojo. I have heard that mojo isn't open source but it has plans to do so. I'd like to try it once if its as fast / even a little slower than rust and comparable to understanding as python.
melodyogonna 1 hours ago [-]
I don't think investors look at what makes a net positive to the community when making large investments like in Modular. I was calling out the part of the post that said Modular raised a lot of Money to develop Mojo, that isn't entirely true as just creating a language isn't enough reason to invest $130m into a company, no matter how much net-positivity the language would bring.
meander_water 3 hours ago [-]
Fwiw the website still claims this:
> Further, we decided that the right long-term goal for Mojo is to adopt the syntax of Python (that is, to make Mojo compatible with existing Python programs) and to embrace the CPython implementation for long-tail ecosystem support
Which I don't think has changed.
boxed 4 hours ago [-]
I believe they're still working towards making the syntax and semantics more python-like.
dismalaf 4 hours ago [-]
It was never going to have Python semantics and be fast. Python isn't slow because of a lack of effort or money, it's slow because of all the things happening in the interpreter.
bgwalter 2 hours ago [-]
No, Python cannot run Mojo. Like Cython and hundreds of other projects, Mojo creates a C-extension, which is then loaded.
curl -fsSL https://pixi.sh/install.sh | sh
pixi init life \
-c https://conda.modular.com/max-nightly/ -c conda-forge \
&& cd life
No, thanks. C++ is easier.
tgma 7 hours ago [-]
I hope this ends up superseding Cython
williamstein 6 hours ago [-]
Same, and I literally started Cython. :-)
fnands 3 hours ago [-]
I think that's one of the real strong use cases I see coming up.
If they can make calling Mojo from Python smooth it would be a great replacement for Cython. You also then get easy access to your GPU etc.
boguscoder 7 hours ago [-]
Are labels on first output misplaced or mojo was actually slower?
’’’
3628800
Time taken: 3.0279159545898438e-05 seconds for mojo
3628800
Time taken: 5.0067901611328125e-06 seconds for python
’’’
mkl 2 hours ago [-]
The Python function is implemented in C and uses a faster algorithm [1], and this particular factorial is so small they put it in a lookup table [2]. It is a strange and very unequal choice for a demo.
My guess is that the slight overhead of interacting with mojo led to this speed discrepancy, and if a higher factorial (that was within the overflow limits etc) was run, this overhead would become negligible (as seen by the second example). Also similar to jax code being slower than numpy code for small operations, but being much faster for larger ones on cpus etc.
gjvc 6 hours ago [-]
i wish python were as fast as perl for equivalent string-based workloads
b33j0r 4 hours ago [-]
I’m someone who should be really excited about this, but I fundamentally don’t believe that a programming language can succeed behind a paywall or industry gatekeeper.
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
almostgotcaught 8 hours ago [-]
> Functions taking more than 3 arguments. Currently PyTypeBuilder.add_function() and related function bindings only support Mojo functions that take up to 3 PythonObject arguments: fn(PythonObject, PythonObject, PythonObject).
Lol wut. For the life of me I cannot fathom what design decision in their cconv/ABI leads to this.
rybosome 5 hours ago [-]
I was wondering if it is function overloads of the same name, defining it non-variadically:
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.
2 hours ago [-]
bmacho 2 hours ago [-]
Probably not, since they would surely up it at least 15 arguments, instead of 3. But what else, then?
> We have committed to open-sourcing Mojo in 2026. Mojo is still young, so we will continue to incubate it within Modular until more of its internal architecture is fleshed out.
Soon it might be though.
Simon_O_Rourke 1 hours ago [-]
Many thanks for the update on this particular aspect of it. That rules it out of any production deployment until 2026 so.
diggan 45 minutes ago [-]
> That rules it out of any production deployment until 2026 so.
Has that stopped everyone before? Java, C#/.NET, Swift and probably more started out as closed-source languages/platforms, yet seemed to have been deployed to production environments before their eventual open-sourcing.
pelcg 37 minutes ago [-]
Many developers had no problem using .NET and C# in production despite them starting out as closed-source for years.
Was lowkey hoping this was about Mojolicious, the Perl web framework
dkechag 56 minutes ago [-]
Yeah, I also get confused with references. I was annoyed from the start, when "Mojo" was announced as a Python family language. Mojolicious uses the "Mojo" namespace and is referred to as that quite often. I know Perl is not as popular as it used to be, but Mojolicious is probably the most popular framework of a language that is roughly in the same "space" as Python, so that naming choice was very ignorant IMHO.
"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.
So going after people who need to build low latency high-throughput inference systems.
Also as someone else pointed out, they also target all kinds of hardware, not just NVidia.
They also miss CPUs on Windows, unless using WSL.
This may appeal to people wanting to run their code on different hardware brands fro various reasons.
And for those that care, Julia is available today on different hardware brands, as there are other Python DSL JITs as well.
I agree they will get there, now the question is will they get there fast enough to matter, versus what the mainstream market cares about.
https://info.juliahub.com/industries/case-studies
Just like I would consider MIT and a few of the companies on that listing as relevant, doesn't need to always be a FAANG.
He also discussed open sourcing Mojo and where the company expects to make its money.
https://www.youtube.com/watch?v=04_gN-C9IAo
Here is a link to the episode listing for that podcast, which might help.
https://www.youtube.com/@LatentSpacePod
I'm logged into youtube, if you're not something with that perhaps?
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.
Yep, that's right. Int behaving like a machine integer is very important for systems performance. Leaving the "int" namespace untouched allows us to have a object-based bigint in the future for compatibility with python. As others have mentioned above, it is still a goal to be compatible with python in time, just not a short term priority
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.
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.
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.
> 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.
https://news.ycombinator.com/item?id=35790367
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.
So, the message is that it is possible to create nice Python bindings from Mojo code, but only if your Mojo code makes the effort to create an interface that uses PythonObject.
Useful, but I don’t see how that’s different from C code coding the same, as bindings go.
Both make it easier to gradually move Python code over to a compiled language.
Mojo presumably will have the advantage that porting from Python to Mojo is much closer to a copy paste job than porting Python to C is.
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.
To first order, today every programmer starts out as a Python programmer. Python is _the_ teaching language now. The jump from Python to C/Cpp is pretty drastic, I don't think that it's absurd that learning Mojo concepts step by step coming from Python is simpler than learning C. Not syntactically but conceptually.
While I agree using Mojo is much preferable to writing C or C++ native extensions, back on my day people learned to program in K&R C or C++ ARM in high school, kids around 12 years old, hardly something pretty drastic.
I'm learning Rust and Zig in the hope that I'll never have to write a line of C in my career.
Just read K&R “The C programming language” book. It’s fairly small and it’s a very good introduction to C.
Towards deployment is even harder. You can very easily end up writing exploitable, unsafe code in C.
If I were a Python programmer with little knowledge about how a computer works, I’d much prefer Go or Rust (in that order) to C.
But the term could also be used more generally to include stuff like pointer provenance, Rust's "stacked borrows" etc. In that case, Rust is more complicated than C-as-specified. But C-in-reality is much more complicated, e.g. see https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2263.htm
C is simpler than Rust, but C is also _much_ simpler than Python. If I solve a problem in Python I have a good standard library of data types, and I use concepts like classes, iterators, generators, closures, etc... constantly. So if I move to Rust, I have access to the similar high-level tools, I just have to learn a few additional concepts for ressource management.
In comaprison, C looks a lot more alien from that perspective. Even starting with including library code from elsewhere.
And as tip for pointers, regardless of the programming language, pen and paper, drawing boxes and arrows, are great learning tools.
> I'd argue that I am not sure what kind of Python programmer is capable of learning things like comptime, borrow checking
One who previously wrote compiled languages ;-). It's not like you forget everything you know once you touch Python.
"... but would struggle with different looking syntax"
Although Python has some seriously PERLesque YOLO moments, like "#"*3 == "###". This is admittedly useful, but funny nonetheless.
We cannot deny that Python has some interesting solutions, such as the std lib namedtuple implementation. It's basically a code template & exec().
I don't think these are necessarily bad, but they're definitely funny.
What else was proclaimed just to raise VC money?
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.)
And so his improvements in mojo and now calling mojo code from python just make a lot more net positive to the community than being, some other Ai infrastructure company.
So I do wish a lot of good luck to mojo. I have heard that mojo isn't open source but it has plans to do so. I'd like to try it once if its as fast / even a little slower than rust and comparable to understanding as python.
> Further, we decided that the right long-term goal for Mojo is to adopt the syntax of Python (that is, to make Mojo compatible with existing Python programs) and to embrace the CPython implementation for long-tail ecosystem support
Which I don't think has changed.
https://docs.modular.com/mojo/manual/get-started/
No, thanks. C++ is easier.If they can make calling Mojo from Python smooth it would be a great replacement for Cython. You also then get easy access to your GPU etc.
’’’ 3628800 Time taken: 3.0279159545898438e-05 seconds for mojo
3628800 Time taken: 5.0067901611328125e-06 seconds for python ’’’
[1] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a...
[2] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a...
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
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.
> As of February 2025, the Mojo compiler is closed source
And that's where the story begins and ends for me.
> Will Mojo be open-sourced?
> We have committed to open-sourcing Mojo in 2026. Mojo is still young, so we will continue to incubate it within Modular until more of its internal architecture is fleshed out.
Soon it might be though.
Has that stopped everyone before? Java, C#/.NET, Swift and probably more started out as closed-source languages/platforms, yet seemed to have been deployed to production environments before their eventual open-sourcing.