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

Installing via Magic script

I am following https://docs.modular.com/mojo/manual/get-started/ and using a devcontainer in the process. (See https://github.com/jake-danton/mojo_test for reference). I got it mostly working, but had some additional dependencies to install (build-essential, etc) to go from a clean Ubuntu setup (see repro for more info). So there may need to be either prerequisites added to the docs or an update to the script. The two big things I haven't got working are:...

Compilation with constant lookup table

In my project I need to have constant lookup table. I wanted to implement it with: alias LOOKUP = InlineArray[UInt64, 104960]( ...here all elements that I want for my table... ) ...

Any plans to release mojo vscode extension to openvsx?

I am using windsurf and cursor IDEs but the mojo extension is only in the vscode marketplace, it would be helpful for sure to have it in openvsx marketplace as well! If it helps for the maintainers heres a useful guide to publish in openvsx https://github.com/eclipse/openvsx/wiki/Publishing-Extensions...

Conditional Conformance Based on Origin

I'm trying to get a better understanding of origins and mutability. I'd like to try and write a function that have a mutable origin. For example, I'd like something like: ```mojo from memory.pointer import Pointer ...

Problem with simple card shuffle program

Hello all, sorry if this is just me being dopey, but I have been playing around and made a simple card shuffle program, but I get nonsensical results like "2 of Jack" and "0 of Diamonds". I just wanted to check if it's just me? I can't see why a face would become a suit in this instance? ```from random import random_ui64, seed from time import monotonic ...

How to start move my project to mojo?

I have a big project that I have worked on for years. Written in python. I do wish to reduce its runtime but rewrite the whole thing is an impossible option for me. I wonder if it is possible to run the whole project through mojo instead out of the box (with some modifications to make it run) And when i find time I'll modify some classes once in a while Im using python 3.11 with numpy and numba (also a lot more but just to let you know)...

Mojo Error: Unable to find suitable c++ compiler for linking

When following this tutorial in WSL (https://docs.modular.com/mojo/manual/get-started/) I am getting an error when running mojo build in part 2. Has anyone run into something similar?

Using BMI (pext_u64 and pdep_u64) in Mojo

How can I use pext and pdep in my Mojo project? I need that Bit Manipulation Instructions to be efficient with some fancy lookups. Is there a way to use those instructions on x86 currently? Those instructions are supported by every CPU with BMI2. I can use them in Rust simply importing them "use std::arch::x86_64::{_pdep_u64, _pext_u64};" I can use them in Julia simply invoking them from C. ...

Issues with ```mojo build``` accross different OSes (fedora 42, debian 12 bookworm)

This is the error i am encountering every time, regardless of platform ```sh user@node1~/life# mojo build -I ./ life.mojo -o ./life /usr/bin/ld: cannot find -lz: No such file or directory /usr/bin/ld: cannot find -ltinfo: No such file or directory...

An question about compile-time parameters

Hey all, So I was trying to make a Matrix struct: ```rs #linalg.mojo from complex import ComplexSIMD...

Issue when running `mojo test --debug`

When running: magic run mojo test --debug I get error: .magic/envs/default/bin/mojo: error: File exists...

More NVIDIA GPU Support coming?

Any plans to include RTX 4090 / 6000ADA or older devices?

Hey there,

I'm running magic-llama-3.1 on an Threadripper 1920x and a RTX3070Ti with Ubuntu 24.04.1 LTS. I have a few errors/questions: - with "magic run serve --huggingface-repo-id modularai/llama-3.1" i got this right at the Beginning "INFO: MainThread: root: ...

Is there a way to reflect changes to a variable in the reference?

Here's a small reproducible example: ```rs struct MyList: var list: List[Int] ...

Is there a way to package a python code run under mojo compiler as an executable on android?

I want to copy a codebase from any available source code on GitHub and get it running as an android apk on my phone. Is it possible or is it a pipe dream, btw I am new to programming and don't know much about how a code goes from ide to apk?

Channel for Jupyter/Mojo issues?

Is there a channel that discusses the difficulties in getting JupyterLab to find a mojo kernel?

Why is `"\0A"` the default `end` value for `print`?

I saw this in some hover text in vscode and wondered if that was correct. Sure enough the docs confirm this. I sort of understand the null termination, but why the 'A' after the null byte? In the future, can we expect print to handle null bytes?...

Mojo for-loop performance

https://github.com/sstadick/rust-vs-mojo-loop While profiling other code, trying to get my perf to match Rust, I noticed that my vanilla for-loop seemed to be one large source of difference. I'm not great with assembly, but looking at what was generated it seemed like Rust was able to skip bound checks when indexing into the arrays since the length of the array was/is given in the range. Has anyone else ran into this? While this is a toy example, I've run into in more complex scenarios and with real data as well....

Try finally when opening a file

Hi all, the following code: fn main() raises: var file: FileHandle try:...

Run into telemetry issue

Hey folks 👋 , I tried to follow the getting started tutorial from https://docs.modular.com/mojo/manual/get-started. And, ran into the issue while executing magic init life --format mojoproject : ```text Created /mojo-dev/life/mojoproject.toml...
Next