"Faster than C" is a lot more plausible for Mojo than the claim of running arbitrary Python code eventually ;)
Indeed, I can see this from their emphasis on generic SIMD, which looks pretty nice. It is nice that there is now a language with first-class SIMD support, comparing with something implemented with a library or autovectorization which may not work.
> "Faster than C" is a lot more plausible for Mojo than the claim of running arbitrary Python code eventually ;)
Seems so. I don't recall reading the claim about running arbitrary Python code, and I think requiring rewriting Python code is reasonable as normal Python code may utilize runtime reflection/dynamic type and they are hard to implement efficiently, and probably require a GC for memory management.
The term superset of Python kind of implies this I think. Beyond the runtime reflection, Python also has eval.... :D
If the language is flexible enough (in particular, it has to support operator overloading), I don’t see any disadvantages to implementing that in a library.
See for example https://developer.apple.com/documentation/swift/simd
Except that it also claims to be a superset of Python. That is, you can use it to run any Python program without changes. So explain to me how it’s faster than C while also literally being Python. That’s more outrageous than V.
> what they've actually got at the moment is two languages glued together, where one of the languages will "unlock performance" and the other language is literally the CPython interpreter.
On the main page of the website, they claim it lets you "Write everything in one language" and "Unlock Python performance" – but what they've actually got at the moment is two languages glued together, where one of the languages will "unlock performance" and the other language is literally the CPython interpreter.
> Although not as outrageous as V...
Comes across as adding drama. Like arguing with one guy, then slapping another, thinking it will be funny or because one might get away with it.
I know it was made for AI, but could it be a rival to rust/C++ in general? Seems like it could replace either of those.
Also, it is still WIP so I am not sure how things like type works in this language, whether or not it support parameterized lifetime, reference counted objects, union type, closure, etc. Currently, they seems to be focusing on numerical applications, targeting the AI crowd, so it is uncertain how things will go later.
This is very clearly explained on the website:
https://web.archive.org/web/20200629153446/https://vlang.io/
Can you point to that claim?
Here's 4 years ago:
https://web.archive.org/web/20190828170427/https://vlang.io/
> V manages memory at compilation time (like Rust). Right now only basic cases are handled. For others, manual memory management is required for now.
> V doesn't use garbage collection or reference counting. The compiler cleans everything up during compilation. If your V program compiles, it's guaranteed that it's going to be leak free.
This was later worded better. But I agree, the docs should have never had such wording.
For performance, if the compiler backend performs enough optimization, the code is run natively without any VM, the performance can be same or better than C (as some language features may provide more optimization opportunities). At the end of the day, C programs are compiled into some IR code and optimized by the backend as well, so the frontend language is more about balancing limitation for optimization and expressiveness.
I do feel a bit uncomfortable about their marketing strategy, which compares a simple implementation against one with SIMD and parallelization... I think the real win here is simpler SIMD/parallel programming comparing with C/C++, instead of the language itself being faster.