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

Creating Syntactic Sugar

Does anyone here knows if it is possible and if yes, then how to create different syntax structures in the language itself like custom keywords or something to alter the syntax structure? I heard it somewhere that something like that is possible however I don't know if that's actually true or even sensible...

Mojo FFI with Dart on smart phone Dart2Mojo

How I can use Mojo like Dart2Rust ffi method? I wanna use at the on smart phone background Mojo and I wanna connect with Dart.

Cannot run a Fibonacci sequence function in the Playground.

I just copied a simple Python function to a playground cell, and the code won't run, and gives me the error:
expression failed to parse (no further compiler diagnostics)
The function is a run-of-the-mill array based Fibonacci sequence generator. ...

Range of SIMD[DType, 1]

Will the range function ever be extended to work for values of SIMD types? This question can also expand to the various methods and functions that expect other datatypes that are inherently similar to SIMD types. I know I can use the to_int() method on the SIMD type, but that just makes the code larger and potentially loss performance.

majo packages

I was wondering if mojo has any packages outside the ones that has been preinstalled with it. And if so how do I download them?.

VScode plug-in :the path to the modular_home containing the mojo sdk installation

I use macos , I can't find the path . I'm new in programming , how to solve this problem ? thanks :mojo:
No description

Mojo in llm?

Hello, guys! I am currently investigating the capabilities of the Mojo, especially in the context of pretraining large-scale models. Does anyone know if Mojo provides support for this kind of extensive pretraining? Additionally, I am looking for any recent research or case studies that discuss the use of Mojo for pretraining large models. If there are benchmarks or any comparisons with other frameworks, that would be particularly helpful. If you've had experience with Mojo in this area or know o...

Differences between class and struct

I know classes aren't implemented yet and structs aren't complete, but do we have a sense what they are going to look like when they're done and what their differences will be? I have a few specific questions: 1. Will classes be a high-level pythonic version of structs (like def is to fn) or will classes have low-level performance? 2. I know structs will eventually work with traits and will probably be able to use extensions in a way similar to inheritance. Will classes work with traits or will they have to inherit from other classes? 3. Given that Mojo is aiming for python compatibility, I imagine classes are going to have to support multiple inheritance. Since it can be a pretty controversial feature, will structs support anything like multiple inheritance through multiple extensions?...

Outputting Items in a tensor

I there ant way to print all the items in a tensor at once rather than iterating through the tensor index by index.

Examples of Python code that will never work with Mojo?

Hello, afaik, Mojo is intended to be a Python superset (a sort of Python++), but at the same time, Modular has made it very clear that Mojo won’t be a “Python compiler”, implying that some of the more dynamic Python features won’t work as expected in Mojo (that’s what I understood from some of the Q&A sessions and interviews). Do you have any specific examples of Python features that will never work with Mojo, not because they aren’t supported yet, but because by design Mojo won’t be able (or willing) to compile them? For example, redefining intrinsics/builtins? Walking and modifying its own AST and semantics (as some Python-based DSLs do)? Deleting and redefining class methods or attributes? C extensions, C++/Rust bindings?...

My code is not working

let builtins = Python.import('builtins'); let array = Python.import('array'); the import on both of these is red and swiggly, the full code is ...

Error debugging Mojo in Visual Studio Code

I'm getting the following error when trying to debug a mojo file in vscode using latest version of Mojo on WSL and latest version of the Mojo extension in vscode: "(debugConfiguration.env || []) is not iterable" I notice an issue has been raised in Github very recently so may be a new problem. ...

How to Implement Recursive data type

I want to Implement abstract syntax tree in mojo, so far no luck, Something simple as this in C : https://github.com/orangeduck/mpc/blob/master/mpc.h#L291 ``` struct ast {...

Fastest Matrix Multiplication

I have read somewhere in this discord that the matmul function showcased in the matmul notebook is not the fastest implementation possible in Mojo. When will the Mojo language include the fastest implementation, if ever?

Where are the types documented?

The programming manual has a section on strong types, but it doesn't actually enumerate the primitive types there. Where can I find a full enumeration of the available primitives?

Inspect and modify AST (eg of a simple function)

Hi is it possible to inspect or modify the ast of a function within my program?

SQL Database support

hey guys. i wanna know mojo have any library like sqlalchemy in python? i rather to use a full mojo library instead of python library...

is it wise to start with Modular as your first language?

I want to know if it is wise to start with Mojo or elsewhere first. If starting with Mojo is the way to go what documents do we have to share or work with as we learn? Thanks...

How run python code in mojo ?

I am using django run code to un models in the mojo