Skip to main content
0 votes
0 answers
44 views

I'm investigating the method reduce_bit_count() from Mojo's SIMD API. According to the documentation: Returns the total number of bits set in the SIMD vector. I expected the following behavior: 3 ...
Daniel's user avatar
  • 8,775
0 votes
0 answers
47 views

sort() can be used on lists of integers without further ado. But if I define my own type, which trait shall I implement on it so that lists made of it can be sorted? @value struct MyStruct(...
Thomas Hügel's user avatar
2 votes
1 answer
96 views

I cannot use the Mojo dependency called lightbug_http in a fresh Mojo project. magic init hello_web --format mojoproject cd hello_web magic shell Printing «Hello world» works fine. Then I add https://...
Thomas Hügel's user avatar
0 votes
1 answer
104 views

I am new to Mojo and just started learning the language. I am practicing some code on my Jupyter notebook in my Mac mini. My Mojo version is 24.4.0 CASE1: The below simple code for ListLiterals gives ...
dig_123's user avatar
  • 2,398
1 vote
1 answer
528 views

How can I implement asynchroneous code in mojo (using async etc.)? In the Changelog, I find the following example (slightly adjusted): async fn add_three(a: Int, b: Int, c: Int) -> Int: return ...
Samufi's user avatar
  • 2,740
3 votes
0 answers
596 views

I am setting up a test environment to try the MOJO language in my Windows 11 Pro laptop (V 10.0.22631 Build 22631). Since MOJO doesn't have a Windows SDK available (yet), I installed WSL2 using ...
diagonjope's user avatar
1 vote
0 answers
31 views

I'm trying to write a solution to a problem I found online using Mojo. The problem is a graph theory related so I wanted to implement the data structure by hand to get more familiar with the language. ...
Ethan Harness's user avatar
1 vote
1 answer
131 views

The code below fails. fn greet(n: Bool) -> String: return "Hello, 2!" fn greet(name: String) -> String: return "Hello, " + name + "!" fn main(): ...
Alex Craft's user avatar
  • 15.8k
0 votes
1 answer
75 views

I have this code : trait State: fn to_string(self) -> String: ... struct StateTtt(State): fn __init__(inout self): pass fn to_string(self) -> String: ...
danilo_lr's user avatar
0 votes
1 answer
143 views

I would like to use eval() for validation of short function synthesis. The search space may be fairly large, e.g. more than a million different functions. Functions will be synthesized as a string ...
Paul Jurczak's user avatar
  • 8,628
0 votes
1 answer
498 views

I've just started learning Mojo, following the documentation to get started. I've run into a problem with importing the Python module numpy. Below is the code I am using which is taken from the ...
awscy's user avatar
  • 27
0 votes
2 answers
129 views

I want to implement a class with a property whose type I can change globally at compile time. For example, let ID_TYPE = Int @value struct MyStruct: var a: ID_TYPE However, let seems not to be ...
Samufi's user avatar
  • 2,740
0 votes
1 answer
182 views

I have a python module : myScript.py. Normally, I run it like this python3 myScript.py -i example.jpg I want to pass this argument to this python modules's main function from python import Python fn ...
Justin's user avatar
  • 67
0 votes
1 answer
225 views

I've installed mojo on my compute : and went to ran the code 'nano__.zprofile' previously when downloading modular/mojo I ve got network issue, couple of times so I've done it multiple times Now when ...
SRINIVASA-ABHIRAM's user avatar
1 vote
1 answer
211 views

As most Mac users, I have two separate versions of python on my machine: The one installed by Apple (version 3.9 in /usr/bin) and one installed via Homebrew (version 3.11 in /opt/homebrew/bin). I've ...
volkerschulz's user avatar
  • 2,212

15 30 50 per page