Heyitsmeguys
Heyitsmeguys
MModular
Created by Martin Dudek on 6/11/2024 in #questions
How to understand Mojo's compiler optimization capabilities?
@Jack Clayton I think explaining which optimizations are guaranteed by the Mojo compiler vs. which ones aren't (with explanations for why) would also be a good idea for the article. All we have right now is, "The Mojo compiler isn't magic" and "Mojo provides high-level, zero-cost abstractions" which would sound like contradictory statements to people who don't have a lot of knowledge on compiler optimizations.
8 replies
MModular
Created by benny on 5/23/2024 in #community-showcase
MIL: Mojo Imaging Library
I wonder if you can join forces with @fnands (creator of Mimage) to make a unified Mojo Imaging Library (similar to what was done with Basalt, Voodoo etc.)
6 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
That's the thing. Mojo doesn't have to rely on LLVM. They've built the compiler from scratch and can replace any part of LLVM they don't like with their own.
36 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
Sometimes you only have a few logical actors and the communication between them crushes your performance.
Under the hood, S&R just uses function calls:
The first (and most common) way for such optimizations to happen is thanks to the structure of the implementation: because all the work is done within callbacks invoked on the completion of an earlier sender, recursively up to the original source of computation, the compiler is able to see a chain of work described using senders as a tree of tail calls, allowing for inlining and removal of most of the sender machinery. In fact, when work is not submitted to execution resources outside of the current thread of execution, compilers are capable of removing the senders abstraction entirely, while still allowing for composition of functions across different parts of a program.
S&R is basically callbacks on steroids. Their overhead and size are meant to be around the same as functions. So I don't think that'll be an issue.
36 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
There are ways to allow programmers to specialize certain parts of their async code to their hardware (if that part needs it) while keeping the rest high level. This is already what C++ plans on doing and it is one of the promises of Mojo.
36 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
I think the current interest is making a generic, high level, general purpose async computation and/or I/O framework. I don't know if what you're suggesting can be made into one.
36 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
It’s also worth mentioning that the term computation applies to multiple paradigms. It can be easily used to describe imperative work, it can be well assimilated by functional programmers, it can apply to reactive programming and to all stream-based paradigms; although we haven’t talked about it, we can think of computations also in the context of the actor model. We haven’t explicitly pursued this, but one can infer that computations can be used as a basis for concurrency in multiple programming paradigms.
Source - p2504r0 - Computations as a global solution to concurrency S&R can be used as the basis for an actor framework, as mentioned above. If you're interested in an actor framework for Mojo, you can look at #1445 . I wrote a whole bunch of stuff about S&R in a comment there.
36 replies
MModular
Created by Heyitsmeguys on 5/23/2024 in #questions
What is the basis for Mojo's `async`?
@Dmitry Salin @Darkmatter have you ever experimented with senders/receivers (the better alternative mentioned above)? There are many implementations: stdexec, HPX, libunifex.
36 replies
MModular
Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
Java and C++ added type inference through var and auto because developers didn't want to deal with that.
24 replies
MModular
Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
Virtual text makes everybody happy 🙂
24 replies
MModular
Created by bunny on 5/16/2024 in #questions
are we fire yet
I imagine the "Is Mojo for me?" page can be adapted to this.
10 replies
MModular
Created by Martin Dudek on 5/14/2024 in #questions
Regular Expression Engine for Mojo, any plans?
If we're talking about absolute performance, there's also hyperscan. It absolutely smashed the benchmarks. I don't know if we can write a portable regex library which is as fast as it, but one can dream. :mojo:
87 replies
MModular
Created by Orwink on 2/16/2024 in #questions
If we talk about performance code, why is MLIR better than LLVM?
All I found is this: >...MLIR shares similarities with traditional CFG-based three-address SSA representations (including LLVM IR or SIL), but it also introduces notions from the polyhedral domain as first class concepts. The notion of dialects is a core concept of MLIR extensibility, allowing multiple levels in a single representation. MLIR supports the continuous lowering from dataflow graphs to high-performance target specific code through partial specialization between dialects. >MLIR supports multiple front- and back-ends and uses LLVM IR as one of its primary code generation targets. MLIR also relies heavily on design principles and practices developed by the LLVM community. For example, it depends on LLVM APIs and programming idioms to minimize IR size and maximize optimization efficiency.[...] [MLIR] is a brand new IR, both more restrictive and more general than LLVM IR in different aspects of its design. We believe that the LLVM community will find in MLIR a useful tool for developing new compilers, especially in machine learning and other high-performance domains.
15 replies
MModular
Created by Alex Gunnarson on 2/9/2024 in #questions
Virtual thread support? ("write async like sync")
6 replies
MModular
Created by Alex Gunnarson on 2/9/2024 in #questions
Lisp/Julia style macros/codegen
Just FYI, there exists a (currently inactive) PEP to add macros to Python (https://peps.python.org/pep-0638/). Also see the discussion about it here: https://discuss.python.org/t/pep-638-syntactic-macros/5352. So it's not like there isn't a demand for these features.
16 replies
MModular
Created by Alex Gunnarson on 2/9/2024 in #questions
Virtual thread support? ("write async like sync")
Two other PLs that seem to have solved the function colouring problem are Go and Zig: https://kristoff.it/blog/zig-colorblind-async-await/ It's also claimed that effect generics can also solve the function colouring problem (explained in this video: https://youtu.be/MTnIexTt9Dk?si=1e4admSCER06nn-c)
6 replies
MModular
Created by Akshay on 2/2/2024 in #questions
Mojo for front-end development.
Until Mojo can be compiled to WebAssembly, I guess your only choice for pure Mojo frontend development is some sort of static site generator, like the one mentioned above. Even then I think you'll have to use some JavaScript since Wasm isn't intended to be a replacement for it.
3 replies
MModular
Created by michau on 1/25/2024 in #questions
Failed to initialize crashpad
Considering that the new Reference type is parametric over mutability, it's already easier to use in some ways.
8 replies
MModular
Created by michau on 1/25/2024 in #questions
Failed to initialize crashpad
8 replies
MModular
Created by michau on 1/25/2024 in #questions
Failed to initialize crashpad
Look at https://github.com/modularml/mojo/issues/1662. I think you have to upgrade to WSL2.
8 replies