#Keder's Rust Grind atleast 30 mins a day

127 messages · Page 1 of 1 (latest)

timber kindle
#

Hello starting to learn rust from now on

timber kindle
#

Downloading cargo took 30 mins

#

Today is finished

#

(lol) jk

remote lotus
#

🤓

#

Do some more Python then do epic Rust things

timber kindle
#

Why?

timber kindle
#

@remote lotus u gotta say why I'm confuseeed

remote lotus
#

Because Rust has a lot of concepts that you are not familiar with when coming from Python

#

gotta learn about manual memory management n shi

timber kindle
#

yeah thats what ill start from

#

borrowing system

#

i believe i did python for enough

timber kindle
#

@remote lotus realised rust is not for me

#

i cant even manage to add a crate

#

OH WHAT

#

WHEN İ DİD CARGO RUN İT WORKED

#

Okay guys rust is for me

#

dont worry

remote lotus
timber kindle
#

but iw as runing the code with rust compiler

#

instead of cargo run

remote lotus
#

I've touched rustc like 3 times during my (limited) Rust experience 🤣

#

cargo just works

timber kindle
#

lol

#

hohooho

#

i did it

#

it probably passed 30 mins but yeah

timber kindle
#

learned how to not handle memory managment

remote lotus
#

😂

#

Rust does it for you 💯

timber kindle
#

i had to use sqlite

#

cause i had to move value

#

i couldn't get the value back

remote lotus
#

😎

#

A little cloning

timber kindle
#

if i clone do the values match even if i add new stuff

remote lotus
#

Clone creates a copy of the value at the point in time when you are cloning

timber kindle
#

eh then its not useful?

#

@remote lotus

#

lets say i got a list i append msg id to

#

then how do i acess it back again?

#

cause i move it

remote lotus
#

You clone the message ID when appending and then the copy is moved into the list

#

And you still have the value

timber kindle
#

i clone message id when appending ok

#

OOH

#

msgid.clone()

#

?

remote lotus
#

Yeah

timber kindle
#

doesnt work

timber kindle
#

so messageids also move

remote lotus
#

I believe the first move occurs when you print, no?

timber kindle
#

its not the msgid

#

its the vector

remote lotus
#

Is it necessary to spawn a blocking thread here?

timber kindle
#

and i want this task to be another task when im gonna do bigger file uploads

#

so app doesnt stop

remote lotus
#

I guess you're building something similar to Discord?

remote lotus
#

What is it you're building here

timber kindle
#

just a python project i had before

#

basicly using serenity

#

to uplaod file

#

and get their id

#

s

#

saved

#

gn guys

#

Done :)

#

im just so smort

#

used copilot for this messageids arc mutex thingy

#

idk what does it evne do

#

Well i used Google to check

#

It said makes it only editable by one thread

#

Okay I readed an article

#

Arc = good

#

Jk

#

Atomic reference counter

timber kindle
timber kindle
#

ok that didn't work also

#

fixed it with using channels

timber kindle
#

progress :)

timber kindle
#

helped someone for the first time

timber kindle
undone citrus
#

oogood lucj

timber kindle
#

thanks

timber kindle
#

hah update

#

now i know how to use sqlite with rst

#

can return the files now

timber kindle
#

Finished

#

fully written with rust

remote lotus
#

saucy

#

man got a nice CLI

#

or CUI even

timber kindle
#

cui?

#

yeah u can kinda control it

#

i found this on cargo

#

iinquire

#

I was shocked when there was no input on rust

#

So I searched a bit

smoky crypt
#

Is rust oop?

remote lotus
#

I'd say it has more functional influences than OOP influences but there are structs with methods attached to them (also look at the trait system please you will love it)

timber kindle
#

Yep

#

I used that for file data storing

#

Traits right

smoky crypt
#

You are inspiring me Keder, I might have to start my journey soon