[HN Gopher] The Next Big Step in Mojo Open Source
       ___________________________________________________________________
        
       The Next Big Step in Mojo Open Source
        
       Author : melodyogonna
       Score  : 93 points
       Date   : 2024-03-28 18:43 UTC (4 hours ago)
        
 (HTM) web link (www.modular.com)
 (TXT) w3m dump (www.modular.com)
        
       | williamstein wrote:
       | Mojo just open sourced their standard library.
       | https://github.com/modularml/mojo/tree/nightly/stdlib
       | 
       | It's very interesting to browse, since it's a huge collection of
       | (presumably) working tested example code doing mundane things
       | using Mojo, which is extremely useful to browse when trying to
       | figure out how to efficiently use the language. Similarly,
       | browsing the implementation of the stdlib has helped me a lot
       | with learning zig.
        
         | chrislattner wrote:
         | Awesome, we'll be releasing a bunch more, but this is a pretty
         | exciting starting point. The standard library has a lot of the
         | lowest level details, and shapes most of the language - because
         | so much of Mojo is library defined.
         | 
         | -Chris
        
       | Trung0246 wrote:
       | So it looks like the actual runtime is still closed.
        
         | melodyogonna wrote:
         | You mean compiler. And yes, it has not been open-sourced just
         | yet.
        
           | dartos wrote:
           | Won't touch it until it is, but I'm very exited for it to
           | happen.
        
       | jeremiahguy wrote:
       | C++cels... our response?
        
       | modernerd wrote:
       | Mojo feels like a great fit for so many domains outside of AI. It
       | could be a killer general purpose language.
       | 
       | It's easy to read and write, offers memory safety without RC or
       | GC or even much mental overhead, will (eventually) be a superset
       | of Python, and it's very performant already.
       | 
       | So far I've been hesitant to invest more time in it when it's
       | pitched as "the programming language for all AI developers", when
       | it's distributed inside the MAX package[1], and when Modular is
       | prioritising features around AI over all else. (I understand why
       | for all these things, I just wish it were otherwise.)
       | 
       | It's great to see the library in the open, but it would be much
       | more compelling for me if Mojo were a separate entity, with its
       | own open site and foundation, to be used by Modular but with more
       | diverse adoption encouraged. Of course it's early days, but I
       | hope it takes on a life more like Rust than Swift (which --
       | despite its potential as a general-purpose language, is still
       | largely used in one ecosystem).
       | 
       | 1: https://www.modular.com/blog/max-is-here-what-does-that-
       | mean...
        
         | achandran wrote:
         | If Mojo can nail single-file deployment and have a Cargo-like
         | packaging experience, along with the characteristics you
         | highlighted, it could be an excellent general purpose language
         | for web backends, cli tools etc
        
           | modernerd wrote:
           | Yes! But also games and other hard real-time systems, desktop
           | apps, microcontrollers and so much more...
           | 
           | I think it will get there with packaging. (Modular was
           | recently hiring someone to work on Mojo's dev tooling full
           | time, which sounds awesome, and I don't see that role any
           | more so perhaps it was filled.)
           | 
           | Mojo is already the language I want to reach for for 100
           | things outside of AI. It would just help to know that the
           | team behind it will actively support/encourage use of it in
           | those spaces first.
        
             | chrislattner wrote:
             | We totally want to see Mojo go into all these places! It's
             | just that Modular can't fund use of Mojo in (eg) gamedev or
             | embedded development (at least not in the foreseeable
             | future). Open sourcing the implementation is a big part of
             | helping catalyze those developments in the community.
             | 
             | In my experience, a diverse community of people who want
             | similar but /different/ things is what builds out a
             | thriving community. This is why LLVM is pretty great for
             | example: lots of people have a shared view on what
             | technical excellence means, but they all want different
             | things so you get a well balanced ecosystem, not just
             | "Apple's compiler".
             | 
             | -Chris
        
         | chrislattner wrote:
         | You're right that Mojo is a completely general purpose
         | programming language. Community members are already building
         | gui libraries and serving stuff etc.
         | 
         | It might not be the best thing, but here's the rationale for
         | why we do this: it's basically that Mojo is still early, and
         | being "good" at something requires more than a language - you
         | also need a library ecosystem and committed community around
         | there. We don't think it is time to declare that Mojo is a
         | great solution for GUI development (for example) until these
         | things happen.
         | 
         | In contrast, Modular is pushing hard to build out the AI part
         | of the ecosystem and already has MAX engine and even more
         | things coming, so we're pretty confident that Mojo will be
         | great in the AI domain.
         | 
         | As the community builds out, we can expand positioning where it
         | makes sense. We just don't want to overclaim.
         | 
         | -Chris
        
       | nickysielicki wrote:
       | When mojo was initially released I didn't think much of it
       | because: 1. It was announced prior to being available, even in
       | closed source form. 2. Emoji filenames meant to me that it wasn't
       | taking itself too seriously. 3. Many people have tried to make
       | Python fast and failed, and that was my naive take on it, and
       | despite the fact that LLVM allstars were working on it, it seemed
       | like a lofty goal. 4. Closed source programming languages usually
       | suck.
       | 
       | They presented at the LLVM conference in 2023 and this video
       | totally changed my view:
       | https://youtu.be/SEwTjZvy8vw?si=itaRiFCIwGnyOQcc
       | 
       | There are some fascinating ideas here, I'm especially excited
       | about what could come from their templated IR. Recommend others
       | give it a watch if they're confused on why they should pay
       | attention to this project.
        
         | chrislattner wrote:
         | If you're interested in compiler nerdery, you should totally
         | check out the source code, you'll see just how much we meant by
         | "Syntactic sugar for MLIR" :-)
         | 
         | A relatively accessible example is the `Int` type:
         | https://github.com/modularml/mojo/blob/main/stdlib/src/built...
         | 
         | implemented in terms of the index dialect (that Modular
         | upstreamed to MLIR):
         | https://mlir.llvm.org/docs/Dialects/IndexOps/
         | 
         | -Chris
        
       | CurriedLambda wrote:
       | Is anyone else surprised at the straightforward collections
       | implementations? From reading this site (and leetcode interviews)
       | I expected to find advanced data structures under the hood. This
       | is not a negative comment, I'm pro Mojo, just wondering who the
       | heck is using the fancy stuff we get quizzed on in interviews if
       | not stdlib devs.
        
       ___________________________________________________________________
       (page generated 2024-03-28 23:01 UTC)