Skip to main content
Filter by
Sorted by
Tagged with
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
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
1 vote
1 answer
524 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
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
0 votes
1 answer
73 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
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
1 answer
181 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
1 vote
1 answer
206 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
2 votes
1 answer
351 views

I'm trying to run mojo in VScode, however pressing the run button does absolutely nothing. No errors, no nothing. I can run the file from terminal and it works fine but I would love to use running and ...
Paternostro's user avatar
1 vote
1 answer
1k views

I have some sample Mojo code: fn main(): print("Hello, world!") for i in range(10000): print_no_newline(i) print_no_newline(' ') And I run mojo build test.🔥 And it ...
Tsunami014's user avatar
0 votes
1 answer
84 views

I tried the below in Jupiter, and it is working fine, But one I tried to use at at file.mojo as: from python import Python # The Python way: `import requests as http` let http = Python.import_module(...
Hasan A Yousef's user avatar
0 votes
2 answers
508 views

How can we run https://huggingface.co/tiiuae/falcon-180B the one of the current best models on mojo lang which is faster than python 35k? When we just copy this: `from transformers import ...
Bitdom8's user avatar
  • 1,482
7 votes
1 answer
423 views

I started exploring the mojo programming language and now I am trying to figure out how to properly use the Tensor module. I can't find how to statically declare the values inside a tensor. For the ...
Blue_Mecha's user avatar
1 vote
1 answer
252 views

A total newbie question. struct Item: var name: StringLiteral fn __init__(inout self): self.name = "Unnamed" fn main(): var dv = DynamicVector[Item]() var it = Item(...
user529327's user avatar
5 votes
0 answers
458 views

I am trying to create a function that takes in any object and prints it if it is _Printable, and prints "object" otherwise. To do this I am trying to use @paramter if to check the type at ...
Elan-R's user avatar
  • 576
16 votes
1 answer
11k views

Mojo, a programming language, claims to be 65000x faster than python. I am eager to understand if is there any concrete benchmark data that supports this claim? Also, how does it differ in real world ...
Muneeb's user avatar
  • 1,700
0 votes
1 answer
2k views

I am trying to declare a Pandas DataFrame in mojo using a list of data. I have followed the examples seen for importing and using Numpy but declaring a DataFrame is only giving errors. How do I fix ...
Jesse Sealand's user avatar
0 votes
0 answers
161 views

when I switched to WSL(from windows) and ran: curl https://get.modular.com | \ MODULAR_AUTH=###################### \ sh - multiple times the download process stopped within seconds: % Total % ...
raman shariati's user avatar
3 votes
2 answers
2k views

According to the docs: vectorize vectorize[simd_width: Int, func: fn[Int](Int) capturing -> None](size: Int) Maps a function which is parametrized over a simd_width over a range from 0 to size in ...
George Ogden's user avatar
2 votes
1 answer
81 views

The following program tries to store a Thing in a Holder: struct Holder: var thing: Thing fn __init__(inout self, owned thing: Thing): self.thing = thing pass struct Thing: ...
Max Heiber's user avatar
  • 15.7k
1 vote
1 answer
284 views

I run the following in the Mojo Plyaground (https://playground.modular.com/) and get an error, what am I doing wrong? struct MyPair[type:AnyType]: var first: type var second: type # We ...
qpit3a's user avatar
  • 13