News for hackers. Stuff that matters.
Re:Mojo: The usability of Python with the performance of C by grandma_tea on Friday September 22, 2023 @03:38PM (#37616702)
Both C and Python are open source. I can't take Mojo seriously until it does the same.
Re:Mojo: The usability of Python with the performance of C by anakaine on Friday September 22, 2023 @07:18PM (#37619032)
They've also claimed both on the page and in the podcast that certain testing reveals a 68,000x speed up vs Python. That's probably true in a select case, but this is why you use libraries in Python - to make use of all the hard work that already exists in C/C++ in those libraries, with Python serving as a high level and far easier to write functional wrapper. Ie anyone serious about performance isn't going to be looking at that metric seriously, rather they're going to be asking what the real performance gains are vs standard practice. In that case the answer seems to be rather roughly a 1.5x speed up based on what's on the performance page of their site when comparing to PyTorch and CUDA, which is a more realistic scenario.

I am curious about how much work the compiler does to automatically identify available hardware and distribute the load on its own vs how much you need to specify as a developer.

Re:Mojo: The usability of Python with the performance of C by nottorp on Saturday September 23, 2023 @04:13AM (#37621520)
All I know from the news is they have a marketing team that decided to jump on the AI hype bandwagon. Plus the aforementioned outlandish performance claims.

Unfortunately marketing like this tends to trigger an equal and opposite reaction in me.

Anyone with AI programming experience can comment on whether they have made any specific believable claims about performance?

Re:Mojo: The usability of Python with the performance of C by singularity2001 on Saturday September 23, 2023 @04:42AM (#37621627)
If it wasn't for Chris Lattner I'd put Mojo in the same bucket as V thanks to said dissociated marketing team
Re:Mojo: The usability of Python with the performance of C by nottorp on Saturday September 23, 2023 @05:15AM (#37621736)
Hey, V and R are nice language names. How do you search for them with the current engines?

And that company… whatsitsname… X?

Re:Mojo: The usability of Python with the performance of C by Hikikomori on Saturday September 23, 2023 @07:19AM (#37622213)
How do you search for C?
Re:Mojo: The usability of Python with the performance of C by nottorp on Saturday September 23, 2023 @07:52AM (#37622435)
You type Rust and someone has rewritten the C application in it already.

In C’s defense it was made before search engines.

Re:Mojo: The usability of Python with the performance of C by goku12 on Saturday September 23, 2023 @08:11AM (#37622578)
It's quite easy for languages. You just append 'lang' or language to the name. Works even for single letter languages like C, D, R and V.
Re:Mojo: The usability of Python with the performance of C by hashtag-til on Saturday September 23, 2023 @04:43AM (#37621630)
Still early days to see whether this is niche or mainstream.

As of today, I’d bet it is niche like Julia, R, etc.

Re:Mojo: The usability of Python with the performance of C by coldtea on Saturday September 23, 2023 @04:17AM (#37621536)
>That's probably true in a select case, but this is why you use libraries in Python - to make use of all the hard work that already exists in C/C++ in those libraries, with Python serving as a high level and far easier to write functional wrapper.

Yes, but that's also the issue they address. That you cant just write plain Python for something not covered by libraries and have it be fast. You need to then mess with extending with C, Cython, and so on.

Re:Mojo: The usability of Python with the performance of C by kbrkbr on Saturday September 23, 2023 @07:14AM (#37622182)
Or you use numba [1]. Then you can use a subset of plain Python.

[1] https://numba.pydata.org/

Re:Mojo: The usability of Python with the performance of C by taway1237 on Saturday September 23, 2023 @07:49AM (#37622403)
Why is cython (python-like fast language) worse than mojo (python-like fast language)?
Re:Mojo: The usability of Python with the performance of C by CoreyFieldens on Saturday September 23, 2023 @11:37AM (#37624227)
There's no a strong reason to use Mojo over cython right now, but if Mojo can deliver on their claims, I think there will be. Mojo will have a borrow checker, better IDE support, support overloading, and better SIMD support are things that stick out to me.
Re:Mojo: The usability of Python with the performance of C by coldtea on Saturday September 23, 2023 @01:14PM (#37625226)
Aside from the rest of stuff they offer (and higher speed, if they're telling the truth) Mojo is also a standalone language you can use, whereas Cython is meant for dual-mode use alongside Python.
Re:Mojo: The usability of Python with the performance of C by pjmlp on Saturday September 23, 2023 @05:09AM (#37621713)
C isn't open source.

To make a conforming C compiler, someone has to buy the ISO C standard (208 CHF), which other folks will then spend development resources in creating C compilers that obey said standard.

The biggest open source compilers, clang and GCC, only keep being up to date with ISO C, because of the money from IBM, Red-Hat, Apple, ARM, Intel, Green-Hills,... place in assigning company resources to work on them.

Re:Mojo: The usability of Python with the performance of C by gnomewascool on Saturday September 23, 2023 @05:45AM (#37621859)
What the OP meant is that there are (multiple!) open source C compilers, which you agree is the case.

Questions about the standard/specification are a different matter:

1. Whether the language has one? (Many languages, both open source and proprietary don't! I believe mojo doesn't have one?)

2. Whether it's available for free (gratis)?

3. Whether it's under a free (libre) license that allows redistribution with modifications?

Re:Mojo: The usability of Python with the performance of C by AlotOfReading on Saturday September 23, 2023 @05:50AM (#37621876)
What development resources is green hills contributing to GCC or clang? As far as I know, they don't actively develop either, aside from selling a completely unrelated compiler that used to be called "gcc" long before the Gnu compiler ever used that name. They also haven't meaningfully participated in the mailing lists under their company name.

In any case, it's my understanding that the C standards have largely been community driven efforts that formalized things already being done by major compilers like Gnu rather than driven by the technical needs of industry the way C++ has.

Re:Mojo: The usability of Python with the performance of C by pjmlp on Saturday September 23, 2023 @09:37AM (#37623098)
Their new compiler is a clang fork, they contribute at least to LLVM.
Re:Mojo: The usability of Python with the performance of C by AlotOfReading on Saturday September 23, 2023 @11:34AM (#37624200)
Interesting, how did you find that out and which product was it for (if you can say)? They recently (as in this year) assured me that the safety certified compiler was home-grown. I'm inclined to believe them given how broken the parser is and how many features it lacks.
Re:Mojo: The usability of Python with the performance of C by pjmlp on Saturday September 23, 2023 @02:04PM (#37625729)
Sorry about that, I typed from head without cross-checking.

I thought having read it somewhere on one of those embedded forums like embedded.com.

Upon further investigation they are still using their own stuff.

https://www.ghs.com/products/compiler.html

Re:Mojo: The usability of Python with the performance of C by benj111 on Saturday September 23, 2023 @06:57AM (#37622109)
> C isn't open source

I would debate that.

1. The C language spec isn't code, open source is only concerned with the code.

2. Philosophically, I would say that if you can write and compile standards conforming c code on an open source compiler, and the standard is freely available then to all intents and purposes C is open. It isn't as if GCC doesn't know what the standard is, it isn't as if they can't describe GCC as a c compiler.

It's like saying a bsd or Linux isn't unix, just because they haven't paid some fee.

Re:Mojo: The usability of Python with the performance of C by flohofwoe on Saturday September 23, 2023 @07:18AM (#37622211)
The C standard really isn't all that relevant in practice though, for instance the Microsoft C compiler had been trailing the standard by about 2 decades until quite recently but this didn't stop people from using it. Also most C code that's written to compile across gcc, clang and msvc most likely doesn't even build with -pedantic on gcc or clang.

(eg in practice C is more like a language family, with an attempt to standardize a common core feature set and syntax as an afterthought and call that a "standard" - it's good that it exists, but it's hardly relevant or even useful for real world projects)

Re:Mojo: The usability of Python with the performance of C by pjmlp on Saturday September 23, 2023 @09:38AM (#37623106)
It is relevant to anyone writing portable code, or requiring certification.
Re:Mojo: The usability of Python with the performance of C by aeurielesn on Saturday September 23, 2023 @05:15AM (#37621734)
I was taken aback by the sign up to try it out.