Modular

M

Modular

This server is the home of the MAX and Mojo community. Join us to chat about all things Modular!

Join

questions

community-showcase

Will mojo support JIT compilation?

From what I understand mojo does have already some JIT capabalities (like notebooks) but i'm talking about things like being able to pass run time variables to parameters (not arguments) in functions.

How to read args from environment

Hi, I am trying to write a simple program where I would read args from terminal and print them. I found this function in the documentation but well...there is no documentation https://docs.modular.com/mojo/stdlib/sys/arg/argv I am wondering how is people learning to code in mojo considering documentation is at this level...

Will mojo upstream its borrow checker to llvm?

I understand mojo's borrow checker is built upon mlir, like everything in mojo, and I suspect you guys might have developed a lot of infrastructure that could benefit other projects using mlir. I wonder if mlir could include a standard dialect for doing borrow checking, and I think mojo could provide a great starting point. Would you mind sharing some details about how borrow-checking currently works internally?

Assigning slice of a tensor to a variable?

As best I can tell there is no direct way to assign a slice of a tensor to a new variable. I am looking for something Python-esque like ``` fn blah(): var t = Tensor[DType.float64](...

what can I really do with mojo at the moment?

Hi, I have been following Mojo since release but still haven’t seen any project i could use. 1. We always see mojo is meant to be used for ai but as far as i know there is no pytorch/flux or similar. So how would i be able to train my goof vector to sequence model? What would be the real diff vs using pytorch with cuda? 2. I have another usecase where i build high speed libraries with rust that scan over hashmaps in memory and provide ms response. Would mojo allow me to do something similar?...

mojo compiler implementation

What is the current implementation of the mojo compiler written in? Is there a plan for mojo to be self hosting? Is this why the compiler itself is not open source yet?

Passing a trait as a parameter to `Dict`?

This is related to a proposal for adding Middleware functionality to Lightbug HTTP: https://github.com/saviorand/lightbug_http/pull/33#issuecomment-2105547981 We're trying to do something like the following: ``` HTTPHandler is an interface for handling HTTP requests in the RouterMiddleware. It is a leaf node in the middleware chain....

Printing at compile time

How to print at compile time? Something that looks like the following code, which currently does not compile: ```rust fn main(): alias n = 99 print"Compiling with n = ", n...

What UnsafePointer can point to and allocate mem for?

I opened an issue last week in which I reported a problem with allocating for an array of Sets https://github.com/modularml/mojo/issues/2503 This issue was closed as not planned'which leaves me confused right now,. From the docu it says ...

Classification on the Cloud

Instead of doing a custom GCP image hosting and Python image classifier. Is this something that the MAX Platform Supports? We are looking for a hosted classification system to train our models and then allow access to the model for classification.

What's the status of Mojo for compile-time validation?

It sounds like there's great stuff going on in Mojo to bring some of Rust's memory safety guarantees without as much conscious effort as Rust requires. I'm curious about compiling a (well-annotated) Mojo program. To what extend Mojo does catch errors (type mismatches, say) on compile the way a statically typed language does? If that's not happening these days, does anybody know where that is on the roadmap?...

Trait `Comparable`

I looked around, but do not see an answer so far. Does Mojo have a Trait like Comparable to indicate that a Struct has implemented all of the comparison dunder methods? Something like: ```mojo trait Comparable: # == equal fn eq(self, other: Self) -> Bool: ......

Mojo test

Did anyone get unit tests working? I run mojo test on the following folder structure: ``` ├── my_package │   ├── init.:fire:...

Mojo VS Code LSP Issue: Unsupported server configuration

Hi I'm looking to get started with mojo. I have downloaded the nightly build and want to start programming mojo with vs code. When I run VS Code I get the following LSP Error shown in the image. For context I'm running mojo on a M1 Max MacBool Pro....
No description

Mojo and AWS.

How difficult is it to run Mojo apps in AWS, I intend to run an app in AWS ECS pointed to by API Gateway.

type conversion between alias types

A matrix type is defined as ``` alias type = DType.float32 struct Matrix[rows: Int, cols: Int]:...

Return with move semantics

Is that possible to use the move semantic when returning a value from a function? The code below would give error: ``` from tensor import Tensor ...

How to efficiently sum a SIMD

Is there a way to sum a SIMD vector faster then a for loop?

convert error: 'Int' to 'IntLiteral' trying to implement the FloatLiteral.__round__(ndigits) method

I'm trying to contribute implementing the FloatLiteral.round() method with the current implementation: ``` @always_inline("nodebug") fn round(self, ndigits: IntLiteral = 0) -> Self: """Return the rounded value of the FloatLiteral. ...